/* ============================================================
   UVITA FAMILY REUNION — App styles
   Shares the navy & gold palette of catalina-garcia.com with a
   tropical teal accent for Costa Rica.
   ============================================================ */

:root {
    --navy-darkest: #060F1E;
    --navy-dark:    #0A2342;
    --navy-mid:     #1A3F6F;
    --navy-light:   #2C5F8A;
    --gold:         #C9A84C;
    --gold-light:   #E8C97A;
    --teal:         #1B9C85;
    --teal-light:   #3FBFAA;
    --white:        #FFFFFF;
    --off-white:    #F4F7FB;
    --gray-light:   #E8EDF5;
    --gray-mid:     #B0BAC9;
    --gray-text:    #64748B;
    --dark-text:    #1A1A2E;
    --danger:       #C0392B;

    --shadow-sm: 0 2px 8px rgba(10, 35, 66, 0.09);
    --shadow-md: 0 4px 24px rgba(10, 35, 66, 0.14);

    --radius:    12px;
    --radius-sm:  6px;

    --font-heading: 'Playfair Display', Georgia, serif;
    --font-body:    'Inter', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-body);
    color: var(--dark-text);
    background: var(--off-white);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; }

h1, h2, h3 { font-family: var(--font-heading); line-height: 1.2; color: var(--navy-dark); }

/* ---- Top bar ---- */
.app-header {
    background: linear-gradient(120deg, var(--navy-dark) 0%, var(--navy-mid) 60%, var(--teal) 130%);
    color: var(--white);
    padding: 22px 24px 0;
}

.app-header-top {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 18px;
}

.app-title {
    font-size: 1.7rem;
    color: var(--white);
}
.app-title .sub {
    display: block;
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gold-light);
    margin-top: 2px;
}

.guest-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.25);
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.85rem;
}
.guest-badge button {
    background: none;
    border: none;
    color: var(--gold-light);
    font-weight: 600;
    cursor: pointer;
    font-size: 0.8rem;
}

/* ---- Tab nav ---- */
.nav-toggle {
    display: none;
    width: 100%;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.25);
    color: var(--white);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    margin: 0 auto 10px;
    max-width: 1080px;
}

.app-nav {
    max-width: 1080px;
    margin: 0 auto;
    display: flex;
    gap: 4px;
    overflow-x: auto;
}
.app-nav button {
    background: none;
    border: none;
    color: rgba(255,255,255,0.75);
    padding: 12px 16px;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}
.app-nav button:hover { color: var(--white); }
.app-nav button.active {
    color: var(--white);
    border-bottom-color: var(--gold);
}

/* ---- Main layout ---- */
.app-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 32px 24px 80px;
}

.view-title {
    font-size: 1.6rem;
    margin-bottom: 6px;
}
.view-subtitle {
    color: var(--gray-text);
    margin-bottom: 24px;
    font-size: 0.95rem;
}

/* ---- Cards / grid ---- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px;
    margin-bottom: 18px;
}

.grid {
    display: grid;
    gap: 18px;
}
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.stat-card {
    text-align: center;
    padding: 20px;
}
.stat-value {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    color: var(--navy-dark);
}
.stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--gray-text);
    margin-top: 4px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
}
.btn-navy { background: var(--navy-mid); color: var(--white); border-color: var(--navy-mid); }
.btn-navy:hover { background: var(--navy-light); border-color: var(--navy-light); }
.btn-teal { background: var(--teal); color: var(--white); border-color: var(--teal); }
.btn-teal:hover { background: var(--teal-light); border-color: var(--teal-light); }
.btn-gold { background: var(--gold); color: var(--navy-darkest); border-color: var(--gold); }
.btn-gold:hover { background: var(--gold-light); border-color: var(--gold-light); }
.btn-outline { background: transparent; color: var(--navy-mid); border-color: var(--gray-mid); }
.btn-outline:hover { border-color: var(--navy-mid); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: var(--white); }
.btn-sm { padding: 6px 12px; font-size: 0.78rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Forms ---- */
.field { margin-bottom: 14px; }
.field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--navy-dark);
    margin-bottom: 6px;
}
.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    background: var(--white);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--teal);
}
.field-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.checklist {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    background: var(--white);
}
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 400;
    color: var(--navy-dark);
    cursor: pointer;
}
.checklist-item input[type="radio"],
.checklist-item input[type="checkbox"] {
    margin-top: 3px;
    width: auto;
    flex-shrink: 0;
}
.static-value {
    padding: 10px 12px;
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius-sm);
    background: var(--off-white);
    font-size: 0.9rem;
    color: var(--navy-dark);
}
.team-edit-input,
.room-edit-input {
    width: 170px;
    padding: 5px 8px;
    border: 1.5px solid var(--gray-light);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.85rem;
}

/* ---- Tables ---- */
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--gray-light); }
th { color: var(--gray-text); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.5px; }
tr:last-child td { border-bottom: none; }
.table-wrap { overflow-x: auto; }

/* ---- Badges ---- */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.badge-coming { background: rgba(27,156,133,0.15); color: var(--teal); }
.badge-pending { background: rgba(201,168,76,0.18); color: #8a6d1f; }
.badge-not_coming { background: rgba(192,57,43,0.12); color: var(--danger); }

/* ---- Itinerary ---- */
.day-group { margin-bottom: 20px; }
.day-heading {
    font-family: var(--font-heading);
    color: var(--teal);
    font-size: 1.15rem;
    margin-bottom: 10px;
    border-bottom: 2px solid var(--gray-light);
    padding-bottom: 6px;
}
.itinerary-item {
    display: flex;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px dashed var(--gray-light);
}
.itinerary-item:last-child { border-bottom: none; }
.itinerary-time {
    flex-shrink: 0;
    width: 76px;
    font-weight: 700;
    color: var(--navy-mid);
    font-size: 0.85rem;
}

/* ---- Lists with actions ---- */
.list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-light);
}
.list-item:last-child { border-bottom: none; }
.list-item-main strong { display: block; }
.list-item-meta { font-size: 0.8rem; color: var(--gray-text); }

/* ---- Photos ---- */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.photo-grid figure {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow-sm);
}
.photo-grid img { width: 100%; height: 150px; object-fit: cover; display: block; }
.photo-grid figcaption { padding: 8px 10px; font-size: 0.78rem; color: var(--gray-text); }

/* ---- Modal ---- */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(6,15,30,0.6);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
    padding: 20px;
}
.modal {
    background: var(--white);
    border-radius: var(--radius);
    padding: 28px;
    max-width: 440px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
}
.modal h2 { font-size: 1.3rem; margin-bottom: 6px; }
.hint { color: var(--gray-text); font-size: 0.85rem; }
.modal p.hint { margin-bottom: 18px; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--gray-text);
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--navy-dark);
    color: var(--white);
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    box-shadow: var(--shadow-md);
    z-index: 3000;
}
.toast.error { background: var(--danger); }

@media (max-width: 640px) {
    .app-header-top { flex-direction: column; align-items: flex-start; }
    .itinerary-item { flex-direction: column; gap: 4px; }
    .itinerary-time { width: auto; }

    .app-header { padding-bottom: 18px; }
    .nav-toggle { display: flex; margin-bottom: 0; }
    .app-nav {
        display: none;
        flex-direction: column;
        gap: 0;
        overflow-x: visible;
        background: rgba(6,15,30,0.35);
        border-radius: var(--radius-sm);
        margin-bottom: 10px;
        padding: 4px;
    }
    .app-nav.open { display: flex; }
    .app-nav button {
        width: 100%;
        text-align: left;
        padding: 13px 12px;
        border-bottom: 1px solid rgba(255,255,255,0.1);
        border-left: 3px solid transparent;
    }
    .app-nav button:last-child { border-bottom: none; }
    .app-nav button.active {
        border-bottom-color: rgba(255,255,255,0.1);
        border-left-color: var(--gold);
        background: rgba(255,255,255,0.06);
    }
}
