@font-face {
    font-family: 'Brown Sugar';
    src: url('../fonts/brown-sugar.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    src: url('../fonts/roboto-regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    color-scheme: light;
    --font-heading: 'Brown Sugar', cursive;
    --font-body: 'Roboto', sans-serif;
}

body {
    background-color: #f8fafc;
    color: #1f2937;
    font-family: var(--font-body);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
}

.section-block {
    margin: 2.5rem 0;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #64748b;
    margin: 0 0 2.35rem;
}

.section-heading::before,
.section-heading::after {
    content: "";
    flex: 1 1 60px;
    height: 1px;
    background: linear-gradient(90deg, rgba(226, 232, 240, 0), rgba(148, 163, 184, 0.8));
}

.section-heading span {
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(226, 232, 240, 0.45);
    box-shadow: inset 0 0 0 2px var(--schedule-gold);
    color: var(--schedule-gold);
}

.section-header {
    margin-bottom: 1.75rem;
}

.section-title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.75rem, 2vw + 1rem, 2.65rem);
    font-weight: 700;
    color: #d4af37;
}

.section-subtitle {
    margin: 0;
    color: #475569;
    max-width: 40rem;
}

.section-intro p {
    margin: 0 0 1rem;
    color: #475569;
    line-height: 1.7;
}

.section-intro p:last-child {
    margin-bottom: 0;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: light;
    }
    body {
        background-color: #f8fafc;
        color: #1f2937;
    }
}

.hero {
    text-align: center;
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.messages {
    list-style: none;
    padding: 0;
}

.message {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    background: #f0f4ff;
}

.message.success {
    background: #e6ffed;
    border: 1px solid #b7f5c2;
}

.error {
    color: #b91c1c;
    font-size: 0.9rem;
}

#rsvp-card {
    margin-top: 2rem;
}

.member-card {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fff;
}

.member-card__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.member-card__header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.member-meta {
    margin: 0;
    color: #6b7280;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toggle-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.toggle-field .toggle {
    display: inline-flex;
    gap: 0.5rem;
}

.slider-control {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 3rem;
    height: 1.5rem;
}

.slider-control input[type="checkbox"] {
    position: absolute;
    inset: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
}

.slider-track {
    width: 100%;
    height: 100%;
    border-radius: 999px;
    background: #e5e7eb;
    transition: background-color 0.2s ease;
    position: relative;
}

.slider-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
    transition: transform 0.2s ease;
}

.slider-control input[type="checkbox"]:checked + .slider-track {
    background: var(--schedule-gold);
}

.slider-control input[type="checkbox"]:checked + .slider-track::after {
    transform: translateX(1.5rem);
}

.slider-control input[type="checkbox"]:focus-visible + .slider-track {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35);
}

.info-box {
    margin: 0.5rem 0;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-left: 3px solid #94a3b8;
    font-size: 0.9rem;
}

.address-card {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    background: #f9fafb;
}

.address-card legend {
    font-weight: 600;
    padding: 0 0.5rem;
}

.attendance-toggle {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: grid;
    place-items: center;
    z-index: 1000;
    padding: 1.5rem;
}

.modal-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.75rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
    text-align: center;
    display: grid;
    gap: 1rem;
}

.modal-message {
    font-size: 1.05rem;
    margin: 0;
}

.modal-message.success {
    color: #047857;
}

.modal-message.info {
    color: #0f172a;
}

.member-details-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: 1rem;
}

.member-formset {
    display: grid;
    gap: 1rem;
}

.plus-one-fields {
    margin-top: 1rem;
    display: grid;
    gap: 1rem;
}

.address-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin-bottom: 1rem;
}

.rsvp-footer {
    margin-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

[data-add-child] {
    margin-bottom: 1rem;
}

.member-countdown {
    font-size: 0.9rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.qr-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
}

.qr-preview__image {
    width: min(280px, 80vw);
    height: auto;
    border-radius: 20px;
    border: 12px solid #ffffff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.15);
}



.countdown {
    font-size: 1.25rem;
    font-weight: 600;
}

.login-card {
    max-width: 420px;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.login-card form {
    display: grid;
    gap: 1rem;
}

.shake {
    animation: shake 0.45s ease;
}

@keyframes shake {
    0% { transform: translateX(0); }
    15% { transform: translateX(-10px); }
    30% { transform: translateX(10px); }
    45% { transform: translateX(-8px); }
    60% { transform: translateX(8px); }
    75% { transform: translateX(-4px); }
    90% { transform: translateX(4px); }
    100% { transform: translateX(0); }
}

/* Language Switcher */
.language-switcher {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 1rem;
}

.lang-toggle {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 600;
    color: #94a3b8;
    transition: color 0.2s;
    width: auto;
}

.lang-toggle:hover, .lang-toggle:focus {
    background: none;
    color: #64748b;
    box-shadow: none;
}

.lang-opt {
    font-size: 0.875rem;
    transition: color 0.2s;
}

.lang-opt.active {
    color: #0f172a;
}

.lang-toggle .slider {
    position: relative;
    width: 48px;
    height: 26px;
    background-color: #e2e8f0;
    border-radius: 999px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.lang-toggle .slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.lang-toggle[aria-checked="true"] .slider {
    background-color: #cbd5e1;
}

.lang-toggle[aria-checked="true"] .slider::before {
    transform: translateX(22px);
}

/* Sticky Navigation */
.sticky-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem 0;
    margin-bottom: 0; /* Removed margin since main has padding usually */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE 10+ */
    align-items: center;
    flex: 1;
    min-width: 0;
    padding-right: 0.5rem;
    position: relative; /* For absolute positioning of indicator */
}

.nav-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background-color: #0f172a;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    width: 0; /* Initial width */
}

.nav-links li a.active {
    color: #0f172a;}

.nav-links::-webkit-scrollbar {
    display: none;  /* Chrome/Safari */
}

.nav-links li {
    margin: 0;
    padding: 0;
}

.nav-links li a {
    text-decoration: none;
    color: #64748b;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: color 0.2s ease;
}

.nav-links li a:hover {
    color: #0f172a;
}

.lang-switch-item {
    margin-left: auto;
    display: flex;
    align-items: center;
}

.language-switcher-mobile {
    display: none !important;
}

@media (min-width: 1301px) {
    .nav-links {
        overflow-x: visible;
    }
}

/* Override existing language switcher margin when in nav */
.sticky-nav .language-switcher {
    margin-bottom: 0;
    flex-shrink: 0; /* Prevent shrinking */
    display: flex;
    align-items: center;
}

.sticky-nav .language-switcher form {
    margin: 0;
    display: flex;
    align-items: center;
}

/* Ensure smooth scrolling for anchor links */
html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px; /* Offset for sticky header */
}

@media (max-width: 992px) {
    .nav-links {
        gap: 1rem;
    }
    .nav-links li a {
        font-size: 0.8rem;
    }
}

/* Mobile Navigation */
.burger-menu {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 5px;
    z-index: 1001;
}

.burger-menu span {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #0f172a;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Burger Animation */
.burger-menu.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.burger-menu.open span:nth-child(2) {
    opacity: 0;
}

.burger-menu.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1300px) {
    .burger-menu {
        display: flex;
    }

    .language-switcher-mobile {
        display: flex !important;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;
        border-bottom: 1px solid rgba(0,0,0,0.1);

        /* Hide by default */
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease-in-out;

        /* Reset desktop styles */
        overflow-x: visible;
        white-space: normal;
        height: auto;
        align-items: center; /* Center items on mobile */
        padding-right: 1.5rem; /* Reset padding */
    }

    .nav-links.open {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .lang-switch-item {
        margin-left: 0;
    }

    .nav-links li a {
        font-size: 1.1rem; /* Larger touch targets */
        display: block;
        padding: 0.5rem 0;
    }

    .nav-indicator {
        display: none; /* Hide sliding line on mobile */
    }

    /* Ensure language switcher stays on right */
    .nav-container {
        justify-content: space-between;
        gap: 1rem; /* Reduce gap on mobile */
    }
}

/* Button Animations */
button[data-save-button],
.modal-card button {
    transition: transform 0.1s ease;
}

button[data-save-button]:active,
.modal-card button:active {
    transform: scale(0.95);
}

.gift-box-image {
    display: block;
    margin: 0 auto 1.5rem;
    max-width: 200px;
    height: auto;
}

.hero-image {
    width: max(200px, 800px);
}
