/* Import premium fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --primary: #2d3748;        /* Slate 700 */
    --primary-light: #4a5568;  /* Slate 600 */
    --accent: #718096;         /* Calm blue-gray */
    --accent-hover: #4a5568;   /* Darker slate */
    --bg-main: #f4f6f6;        /* Alabaster mist */
    --bg-card: #ffffff;        /* White card */
    --text-main: #2d3748;      /* Charcoal slate */
    --text-muted: #a0aec0;     /* Calm gray */
    --border-color: #e2e8f0;   /* Light gray border */
    --success: #15803d;        /* Green 700 */
    --error: #b91c1c;          /* Red 700 */
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 25px rgba(0, 0, 0, 0.05);
    --font-sans: 'Outfit', sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    --radius: 12px;
    --radius-lg: 18px;
    --transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    background-image: linear-gradient(180deg, #edf2f7 0%, #f4f6f6 100%);
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header & Navigation */
header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-link {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-text {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.4rem;
    color: var(--primary);
    letter-spacing: -0.025em;
}

.logo-accent {
    color: var(--accent);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

nav a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

nav a:hover {
    color: var(--accent);
}

.nav-btn {
    background-color: var(--accent);
    color: white !important;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius);
    font-weight: 600;
}

.nav-btn:hover {
    background-color: var(--accent-hover);
    transform: translateY(-1px);
}

/* Main Layout */
main {
    flex-grow: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 1rem;
    background: radial-gradient(circle at top, #f1f5f9 0%, var(--bg-main) 70%);
}

.hero h1 {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2rem;
}

/* Search Bar */
.search-container {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--bg-card);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.search-form {
    display: flex;
    gap: 0.5rem;
}

.search-input {
    flex-grow: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 0.75rem 1rem;
    font-family: var(--font-sans);
}

.search-btn {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-btn:hover {
    background-color: var(--accent-hover);
}

/* Showcase Grid */
.showcase-section {
    margin-top: 4rem;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--accent);
}

.memorial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.memorial-card {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.memorial-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.card-img-container {
    height: 200px;
    background-color: #e2e8f0;
    position: relative;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-name {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.card-dates {
    font-size: 0.9rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.card-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

.card-footer {
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

/* Forms (Login/Admin) */
.form-card {
    max-width: 500px;
    margin: 4rem auto;
    background-color: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.form-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--primary-light);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    outline: none;
    font-family: var(--font-sans);
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(180, 83, 9, 0.1);
}

.form-btn {
    width: 100%;
    background-color: var(--primary);
    color: white;
    border: none;
    padding: 0.85rem;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.form-btn:hover {
    background-color: var(--primary-light);
}

.btn-secondary {
    background-color: white;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-secondary:hover {
    background-color: var(--bg-main);
}

.oauth-divider {
    text-align: center;
    margin: 1.5rem 0;
    position: relative;
}

.oauth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: var(--border-color);
    z-index: 1;
}

.oauth-divider-text {
    background-color: var(--bg-card);
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    position: relative;
    z-index: 2;
}

.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    background-color: white;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    padding: 0.75rem;
    border-radius: var(--radius);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.google-btn:hover {
    background-color: var(--bg-main);
    box-shadow: var(--shadow);
}

.google-icon {
    width: 20px;
    height: 20px;
}

/* Flash Messages */
.flash-messages {
    max-width: 600px;
    margin: 1rem auto;
}

.flash-message {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.flash-success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.flash-error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Admin Dashboard Layout */
.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.admin-panel {
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1.5rem;
}

.admin-table th, .admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.admin-table th {
    font-weight: 600;
    color: var(--primary-light);
    background-color: var(--bg-main);
}

.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending { background-color: #fef3c7; color: #d97706; }
.badge-approved { background-color: #d1fae5; color: #059669; }
.badge-spam { background-color: #fee2e2; color: #dc2626; }

.action-btn {
    text-decoration: none;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    margin-right: 1rem;
    cursor: pointer;
    background: none;
    border: none;
    transition: var(--transition);
}

.action-btn:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.action-btn.delete {
    color: var(--error);
}

.action-btn.delete:hover {
    color: #991b1b;
}

/* Memorial Viewer Custom Elements */
.memorial-hero {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
    align-items: center;
    background-color: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
}

.memorial-portrait-container {
    height: 350px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 4px solid white;
    box-shadow: var(--shadow-md);
}

.memorial-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.memorial-meta h1 {
    font-family: var(--font-serif);
    font-size: 2.8rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.memorial-dates {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.4rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
}

.obituary-block {
    font-size: 1.1rem;
    color: var(--primary-light);
    white-space: pre-line;
}

/* Tabs System */
.tabs-container {
    margin-top: 3rem;
}

.tabs-nav {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    overflow-x: auto;
    gap: 0.5rem;
}

.tab-btn {
    background: none;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1.05rem;
    font-family: var(--font-sans);
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--primary);
}

.tab-btn.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.tab-content {
    display: none;
    background-color: var(--bg-card);
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Timeline/Life Events */
.timeline {
    position: relative;
    padding-left: 2.5rem;
    margin: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 7px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--border-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2.5rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: -2.5rem;
    top: 0.25rem;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--accent);
    border: 4px solid var(--bg-card);
    box-shadow: 0 0 0 2px var(--border-color);
}

.timeline-year {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.timeline-desc {
    color: var(--text-muted);
}

.relational-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.relational-link:hover {
    text-decoration: underline;
}

/* Media Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    background-color: #000;
    position: relative;
    aspect-ratio: 1;
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

.gallery-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0,0,0,0.6);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    pointer-events: none;
}

/* Guestbook comments */
.comment-form-container {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.comment-card {
    background-color: var(--bg-main);
    padding: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.comment-author {
    font-weight: 600;
    color: var(--primary);
}

.comment-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.comment-text {
    color: var(--primary-light);
    white-space: pre-line;
}

/* Mottos */
.motto-quote {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-style: italic;
    text-align: center;
    color: var(--primary);
    max-width: 800px;
    margin: 3rem auto;
    position: relative;
    padding: 0 2rem;
}

.motto-quote::before, .motto-quote::after {
    color: var(--accent);
    font-size: 4rem;
    position: absolute;
    opacity: 0.2;
}

.motto-quote::before {
    content: '“';
    left: -1rem;
    top: -2rem;
}

.motto-quote::after {
    content: '”';
    right: -1rem;
    bottom: -3rem;
}

/* Lightbox Modal */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    align-items: center;
    justify-content: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 80%;
    border-radius: var(--radius);
    box-shadow: 0 0 20px rgba(0,0,0,0.8);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

/* Footer styling */
footer {
    background-color: var(--primary);
    color: white;
    padding: 3rem 2rem;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-logo {
    font-family: var(--font-serif);
    font-weight: 700;
    font-size: 1.2rem;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.copyright {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-top: 1rem;
    text-align: center;
    width: 100%;
    border-top: 1px solid #334155;
    padding-top: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .memorial-hero {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .memorial-portrait-container {
        max-width: 250px;
        margin: 0 auto;
        height: 300px;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}
