/* ── Jungle Theme: Pat Quilter's 80th ───────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Lato:wght@300;400;700&display=swap');

:root {
    --jungle-darkest:  #0b1a0b;
    --jungle-dark:     #1a3a1a;
    --jungle-mid:      #2d5a27;
    --jungle-green:    #3a7d32;
    --jungle-light:    #5cab50;
    --jungle-pale:     #c8e6c0;
    --gold:            #d4a843;
    --gold-light:      #f0d68a;
    --gold-dark:       #a07d2e;
    --cream:           #fdf8f0;
    --brown:           #3e2a1a;
    --brown-light:     #6b4c33;
    --vine-green:      #228B22;
    --text-dark:       #1a1a1a;
    --text-light:      #fdf8f0;
    --danger:          #c0392b;
    --success:         #27ae60;
}

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

body {
    font-family: 'Lato', sans-serif;
    background-color: var(--jungle-darkest);
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Leaf / vine decorations ───────────────────────────────────────────────── */

body::before,
body::after {
    content: '';
    position: fixed;
    pointer-events: none;
    z-index: 0;
}

body::before {
    top: -40px;
    left: 0;
    right: 0;
    height: 120px;
    background:
        radial-gradient(ellipse 60px 50px at 10% 80%, var(--jungle-mid) 60%, transparent 61%),
        radial-gradient(ellipse 80px 55px at 25% 60%, var(--jungle-green) 60%, transparent 61%),
        radial-gradient(ellipse 55px 45px at 40% 85%, var(--jungle-dark) 60%, transparent 61%),
        radial-gradient(ellipse 70px 50px at 55% 55%, var(--jungle-mid) 60%, transparent 61%),
        radial-gradient(ellipse 65px 50px at 70% 80%, var(--jungle-green) 60%, transparent 61%),
        radial-gradient(ellipse 75px 55px at 85% 65%, var(--jungle-dark) 60%, transparent 61%),
        radial-gradient(ellipse 50px 40px at 95% 85%, var(--jungle-mid) 60%, transparent 61%);
    opacity: 0.7;
}

.jungle-vines {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    pointer-events: none;
    z-index: 1;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 80px,
        var(--vine-green) 80px,
        var(--vine-green) 83px,
        transparent 83px,
        transparent 160px
    );
    mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, transparent 100%);
    opacity: 0.3;
}

/* ── Layout ────────────────────────────────────────────────────────────────── */

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    position: relative;
    z-index: 2;
}

/* ── Header / Hero ─────────────────────────────────────────────────────────── */

.hero {
    text-align: center;
    padding: 4rem 2rem 3rem;
    position: relative;
}

.surprise-banner {
    display: block;
    background: var(--danger);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: clamp(0.6rem, 2.5vw, 0.85rem);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 2rem;
    white-space: nowrap;
    width: max-content;
    max-width: 100vw;
    margin-left: auto;
    margin-right: auto;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.hero-leaf {
    font-size: 1.2rem;
    color: var(--jungle-light);
    letter-spacing: 6px;
    margin-bottom: 0.5rem;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--gold);
    line-height: 1.1;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 8px rgba(0,0,0,0.5);
}

.hero h1 span {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-top: 0.3rem;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--jungle-pale);
    font-weight: 300;
    margin-top: 1rem;
}

.hero-divider {
    width: 200px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    margin: 2rem auto;
}

/* ── Party details cards ───────────────────────────────────────────────────── */

.details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.detail-card {
    background: linear-gradient(135deg, rgba(26, 58, 26, 0.8), rgba(11, 26, 11, 0.9));
    border: 1px solid var(--jungle-mid);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.detail-card:hover {
    transform: translateY(-2px);
    border-color: var(--gold);
}

.detail-card .icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.detail-card .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--gold);
    margin-bottom: 0.3rem;
}

.detail-card .value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--cream);
}

.detail-card .sub {
    font-size: 0.85rem;
    color: var(--jungle-pale);
    margin-top: 0.25rem;
}

.detail-card.full-width {
    grid-column: 1 / -1;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */

.btn {
    display: inline-block;
    padding: 1rem 2.5rem;
    border: none;
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--jungle-darkest);
    box-shadow: 0 4px 15px rgba(212, 168, 67, 0.3);
}

.btn-gold:hover {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(212, 168, 67, 0.4);
}

.btn-green {
    background: linear-gradient(135deg, var(--jungle-green), var(--jungle-dark));
    color: white;
}

.btn-green:hover {
    background: linear-gradient(135deg, var(--jungle-light), var(--jungle-green));
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger);
    color: white;
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
}

.btn-small {
    padding: 0.5rem 1.2rem;
    font-size: 0.85rem;
}

.cta-wrapper {
    text-align: center;
    margin: 2.5rem 0;
}

/* ── Forms ─────────────────────────────────────────────────────────────────── */

.form-card {
    background: linear-gradient(135deg, rgba(26, 58, 26, 0.6), rgba(11, 26, 11, 0.8));
    border: 1px solid var(--jungle-mid);
    border-radius: 16px;
    padding: 2.5rem;
    margin: 2rem 0;
}

.form-card h2 {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 2rem;
}

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

.form-group label {
    display: block;
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid var(--jungle-mid);
    border-radius: 8px;
    background: rgba(11, 26, 11, 0.6);
    color: var(--cream);
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px rgba(212, 168, 67, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.radio-option input[type="radio"] {
    accent-color: var(--gold);
    width: 18px;
    height: 18px;
}

.radio-option span {
    color: var(--cream);
    font-size: 1rem;
}

/* ── Flash messages ────────────────────────────────────────────────────────── */

.flash {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.flash.success {
    background: rgba(39, 174, 96, 0.2);
    border: 1px solid var(--success);
    color: #2ecc71;
}

.flash.error {
    background: rgba(192, 57, 43, 0.2);
    border: 1px solid var(--danger);
    color: #e74c3c;
}

/* ── Thank you page ────────────────────────────────────────────────────────── */

.thank-you {
    text-align: center;
    padding: 4rem 2rem;
}

.thank-you h1 {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    font-size: 2.8rem;
    margin-bottom: 1rem;
}

.thank-you p {
    font-size: 1.1rem;
    color: var(--jungle-pale);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.ics-download {
    margin-top: 2rem;
}

/* ── Admin styles ──────────────────────────────────────────────────────────── */

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-header h1 {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    font-size: 2rem;
}

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

.stat-card {
    background: rgba(26, 58, 26, 0.6);
    border: 1px solid var(--jungle-mid);
    border-radius: 10px;
    padding: 1.2rem;
    text-align: center;
}

.stat-card .number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--gold);
    font-family: 'Playfair Display', serif;
}

.stat-card .label {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--jungle-pale);
    margin-top: 0.3rem;
}

.guest-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.guest-table th,
.guest-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(45, 90, 39, 0.4);
}

.guest-table th {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--gold);
    background: rgba(11, 26, 11, 0.5);
}

.guest-table td {
    font-size: 0.9rem;
    color: var(--cream);
}

.guest-table tr:hover td {
    background: rgba(26, 58, 26, 0.3);
}

.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.badge-yes {
    background: rgba(39, 174, 96, 0.2);
    color: #2ecc71;
    border: 1px solid rgba(39, 174, 96, 0.4);
}

.badge-no {
    background: rgba(192, 57, 43, 0.2);
    color: #e74c3c;
    border: 1px solid rgba(192, 57, 43, 0.4);
}

.email-section {
    margin-top: 3rem;
}

.email-section h2 {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.table-wrapper {
    overflow-x: auto;
}

/* ── Admin Login ───────────────────────────────────────────────────────────── */

.login-card {
    max-width: 400px;
    margin: 6rem auto;
    text-align: center;
}

.login-card h1 {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    margin-bottom: 2rem;
    font-size: 2rem;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */

.footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--jungle-mid);
    font-size: 0.8rem;
    margin-top: 3rem;
    border-top: 1px solid rgba(45, 90, 39, 0.2);
}

/* ── Past cutoff state ─────────────────────────────────────────────────────── */

.past-cutoff-notice {
    background: rgba(192, 57, 43, 0.15);
    border: 1px solid var(--danger);
    border-radius: 8px;
    padding: 1.2rem;
    text-align: center;
    color: #e74c3c;
    font-weight: 700;
    margin: 2rem 0;
}

/* ── Photo Gallery / Inline Carousel ───────────────────────────────────────── */

.photo-gallery {
    margin: 3rem 0;
}

.gallery-title {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    font-size: 1.8rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.inline-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ic-viewport {
    flex: 1;
    overflow: hidden;
    border-radius: 12px;
    border: 1px solid var(--jungle-mid);
    background: rgba(11, 26, 11, 0.6);
}

.ic-track {
    display: flex;
    transition: transform 0.45s ease;
}

.ic-slide {
    min-width: 100%;
    position: relative;
}

.ic-slide img {
    width: 100%;
    height: 450px;
    object-fit: contain;
    display: block;
    background: rgba(11, 26, 11, 0.8);
}

.ic-caption {
    text-align: center;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    color: var(--jungle-pale);
    background: rgba(11, 26, 11, 0.7);
}

.ic-arrow {
    flex-shrink: 0;
    background: rgba(26, 58, 26, 0.7);
    border: 1px solid var(--jungle-mid);
    color: var(--gold);
    font-size: 2.2rem;
    cursor: pointer;
    padding: 0.6rem 0.9rem;
    border-radius: 10px;
    line-height: 1;
    transition: background 0.2s, border-color 0.2s;
}

.ic-arrow:hover {
    background: rgba(58, 125, 50, 0.6);
    border-color: var(--gold);
}

.ic-dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.ic-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--jungle-mid);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.ic-dot.active {
    background: var(--gold);
    transform: scale(1.3);
}

.ic-dot:hover {
    background: var(--gold-light);
}

@media (max-width: 640px) {
    .ic-slide img {
        height: 280px;
    }
    .ic-arrow {
        font-size: 1.6rem;
        padding: 0.4rem 0.6rem;
    }
}

/* ── Modal Gallery ─────────────────────────────────────────────────────────── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.93);
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
}

.modal-content img {
    max-width: 88vw;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
    -webkit-user-drag: none;
}

.modal-caption {
    color: var(--cream);
    font-size: 1.05rem;
    margin-top: 1rem;
    text-align: center;
    max-width: 600px;
}

.modal-counter {
    color: var(--jungle-pale);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    letter-spacing: 2px;
}

.modal-close {
    position: fixed;
    top: 1rem;
    right: 1.5rem;
    z-index: 1001;
    background: none;
    border: none;
    color: var(--cream);
    font-size: 2.8rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 1;
}

.modal-arrow {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--cream);
    font-size: 3rem;
    cursor: pointer;
    padding: 0.6rem 1.1rem;
    border-radius: 10px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.2s, background 0.2s;
}

.modal-arrow:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.2);
}

.modal-prev { left: 1rem; }
.modal-next { right: 1rem; }

@media (max-width: 640px) {
    .modal-content img {
        max-width: 96vw;
        max-height: 72vh;
    }
    .modal-arrow {
        font-size: 2rem;
        padding: 0.4rem 0.7rem;
    }
    .modal-prev { left: 0.3rem; }
    .modal-next { right: 0.3rem; }
}

/* ── Content Blocks (public) ──────────────────────────────────────────────── */

.content-block {
    margin: 2.5rem 0;
    text-align: center;
}

.content-title {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    font-size: 1.6rem;
    margin-bottom: 1rem;
}

.content-body {
    color: var(--jungle-pale);
    font-size: 1.05rem;
    line-height: 1.7;
}

.content-body p {
    margin-bottom: 0.8rem;
}

/* ── Photo Admin ──────────────────────────────────────────────────────────── */

.upload-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.upload-row input[type="file"] {
    color: var(--cream);
    font-size: 0.9rem;
}

.photo-admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.photo-admin-card {
    background: rgba(11, 26, 11, 0.6);
    border: 1px solid var(--jungle-mid);
    border-radius: 10px;
    overflow: hidden;
}

.photo-admin-img img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.photo-admin-controls {
    padding: 0.6rem;
}

.photo-admin-controls input[type="text"] {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--jungle-mid);
    border-radius: 6px;
    background: rgba(11, 26, 11, 0.6);
    color: var(--cream);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.photo-admin-buttons {
    display: flex;
    gap: 0.4rem;
}

.photo-admin-buttons .btn {
    flex: 1;
    text-align: center;
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
}

/* ── Content Admin ────────────────────────────────────────────────────────── */

.content-admin-row {
    display: flex;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(45, 90, 39, 0.3);
    gap: 0.5rem;
}

.content-admin-row form {
    margin-left: auto;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    .hero h1 span {
        font-size: 1.2rem;
    }
    .details-grid {
        grid-template-columns: 1fr;
    }
    .container {
        padding: 1rem;
    }
    .form-card {
        padding: 1.5rem;
    }
    .radio-group {
        flex-direction: column;
        gap: 0.75rem;
    }
    .guest-table th, .guest-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .upload-row {
        flex-direction: column;
    }
    .photo-admin-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}
