/* ============================================================
   DJ Kids Meal Planner — app.css
   ============================================================ */

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', sans-serif; background: #FFF4E6; color: #2C3E50; line-height: 1.6; }
a { text-decoration: none; }
img { max-width: 100%; }

/* ── CSS VARIABLES ── */
:root {
    --orange:      #FF8C42;
    --green:       #4CAF50;
    --cream:       #FFF4E6;
    --navy:        #2C3E50;
    --orange-lt:   #FFF0E6;
    --green-lt:    #E8F5E9;
}

/* ── SPINNER ── */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
    width: 64px; height: 64px;
    border: 5px solid var(--orange-lt);
    border-top-color: var(--orange);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
    margin: 0 auto 24px;
}

/* ── NAVBAR ── */
.navbar {
    background: var(--navy); color: #fff;
    padding: 0 24px; height: 60px;
    display: flex; align-items: center; justify-content: space-between;
}
.sticky-nav { position: sticky; top: 0; z-index: 100; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-family: 'Fraunces', serif; font-weight: 700; font-size: 18px; }
.nav-logo { width: 34px; height: 34px; background: var(--orange); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.nav-ig { color: var(--orange); font-weight: 600; font-size: 13px; }
.nav-center-title { font-family: 'Fraunces', serif; font-weight: 700; font-size: 16px; }
.btn-back { color: #fff; background: none; border: none; cursor: pointer; font-size: 15px; font-family: 'Inter', sans-serif; }

/* ── BUTTONS ── */
.btn-primary {
    background: var(--orange); color: #fff; border: none;
    padding: 16px 44px; border-radius: 50px; font-size: 17px;
    font-weight: 700; cursor: pointer; display: inline-block;
    box-shadow: 0 8px 32px rgba(255,140,66,.4);
    transition: transform .15s, box-shadow .15s;
    font-family: 'Inter', sans-serif;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 12px 36px rgba(255,140,66,.5); }
.btn-lg { padding: 18px 52px; font-size: 18px; }
.btn-full { width: 100%; }
.btn-orange-sm { background: var(--orange); color: #fff; border: none; padding: 8px 18px; border-radius: 20px; font-weight: 600; font-size: 13px; cursor: pointer; font-family:'Inter',sans-serif; }
.btn-ig { background: #E1306C; color: #fff; padding: 12px 24px; border-radius: 30px; font-weight: 700; font-size: 14px; display: inline-block; }

/* ── HERO ── */
.hero { background: var(--cream); padding: 72px 24px 48px; text-align: center; }
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero-badge {
    display: inline-block; background: rgba(255,140,66,.15); color: var(--orange);
    padding: 6px 18px; border-radius: 20px; font-size: 13px; font-weight: 600; margin-bottom: 20px;
}
.hero-title { font-family: 'Fraunces', serif; font-size: clamp(2rem,5vw,3rem); line-height: 1.2; color: var(--navy); margin-bottom: 20px; }
.text-orange { color: var(--orange); }
.text-white { color: #fff; }
.text-muted { color: #aaa; }
.text-green { color: var(--green); }
.hero-sub { font-size: 18px; color: #666; max-width: 480px; margin: 0 auto 36px; }
.hero-note { margin-top: 16px; color: #aaa; font-size: 13px; }

/* ── SECTIONS ── */
.section-white { background: #fff; padding: 64px 24px; }
.section-navy  { background: var(--navy); padding: 64px 24px; }
.section-title { font-family: 'Fraunces', serif; font-size: 28px; text-align: center; color: var(--navy); margin-bottom: 8px; }
.section-sub   { text-align: center; color: #999; margin-bottom: 32px; font-size: 15px; }
.container-sm  { max-width: 600px; margin: 0 auto; }
.container-lg  { max-width: 720px; margin: 0 auto; }

/* ── HOW IT WORKS STEPS ── */
.steps-card { background: #fff; border-radius: 20px; padding: 8px 24px; box-shadow: 0 4px 24px rgba(0,0,0,.06); }
.step-item { display: flex; align-items: flex-start; gap: 16px; padding: 16px 0; }
.step-num {
    width: 40px; height: 40px; border-radius: 50%; background: var(--orange);
    color: #fff; font-weight: 700; font-size: 18px; display: flex;
    align-items: center; justify-content: center; flex-shrink: 0;
}
.step-label { font-weight: 700; color: var(--navy); font-size: 16px; margin-bottom: 4px; }
.step-desc { color: #666; font-size: 14px; }
.step-divider { height: 1px; background: #EEE; }

/* ── PREVIEW CARDS ── */
.preview-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.preview-card { background: #fff; border-radius: 16px; padding: 20px; border-top: 4px solid transparent; }
.border-orange { border-top-color: var(--orange); }
.border-green  { border-top-color: var(--green); }
.preview-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.preview-icon { font-size: 24px; }
.preview-day { font-family: 'Fraunces', serif; font-weight: 700; color: var(--navy); }
.preview-tag { font-size: 12px; font-weight: 600; }
.preview-item { font-size: 13px; color: #555; padding: 4px 0; border-bottom: 1px solid #F5F5F5; display: flex; gap: 6px; }

/* ── FAQ ── */
.faq-item { border-bottom: 1px solid #EEE; padding-bottom: 4px; }
.faq-btn {
    width: 100%; background: none; border: none; padding: 16px 0;
    display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; text-align: left; font-weight: 600; color: var(--navy);
    font-size: 15px; font-family: 'Inter', sans-serif;
}
.faq-icon { color: var(--orange); font-size: 20px; flex-shrink: 0; margin-left: 8px; }
.faq-body { padding-bottom: 16px; color: #666; font-size: 14px; line-height: 1.7; }

/* ── FOOTER ── */
.footer { background: var(--navy); color: #fff; text-align: center; padding: 32px 24px; }
.footer-brand { font-family: 'Fraunces', serif; font-size: 18px; margin-bottom: 8px; }
.footer-ig { color: #aaa; font-size: 13px; margin-bottom: 8px; }
.footer-ig a { color: var(--orange); }
.footer-note { color: #555; font-size: 12px; }

/* ── FORM PAGE ── */
.form-container { max-width: 560px; margin: 0 auto; padding: 40px 24px 80px; }
.form-title { font-family: 'Fraunces', serif; font-size: 28px; color: var(--navy); margin-bottom: 4px; }
.form-sub { color: #888; margin-bottom: 32px; }
.form-grid { display: grid; gap: 16px; }
.form-group { display: flex; flex-direction: column; }
.form-label { font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--navy); }
.required { color: #e53e3e; }
.form-input {
    width: 100%; padding: 12px 16px; border-radius: 12px;
    border: 2px solid #E5E5E5; font-size: 15px; color: var(--navy);
    outline: none; background: #fff; transition: border-color .2s;
    font-family: 'Inter', sans-serif;
}
.form-input:focus { border-color: var(--orange); }

/* ── DROP ZONE ── */
.drop-zone {
    border: 2px dashed #DDD; border-radius: 16px;
    padding: 32px 24px; text-align: center; cursor: pointer;
    background: #fff; transition: all .2s;
}
.drop-zone.dragging { border-color: var(--orange); background: var(--orange-lt); }
.drop-label { font-weight: 600; color: var(--navy); margin: 8px 0 4px; }
.drop-hint  { font-size: 13px; color: #aaa; margin: 0; }
#drop-preview img { max-height: 160px; border-radius: 8px; margin-bottom: 8px; }

/* ── CONSENT ── */
.consent-label { display: flex; align-items: flex-start; gap: 12px; margin-top: 24px; cursor: pointer; font-size: 14px; color: #555; line-height: 1.5; }
.consent-check { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--orange); flex-shrink: 0; }
.link-orange { color: var(--orange); font-weight: 600; }

/* ── ERROR BOX ── */
.error-box { background: #FFE8E8; border: 1px solid #FFC0C0; border-radius: 12px; padding: 12px 16px; margin-bottom: 20px; color: #C00; font-size: 14px; }

/* ── LOADING OVERLAY ── */
#loading-overlay {
    position: fixed; inset: 0; background: var(--cream);
    display: flex; align-items: center; justify-content: center;
    z-index: 9999; flex-direction: column;
}
.loading-box { text-align: center; padding: 24px; }
.loading-title { font-family: 'Fraunces', serif; font-size: 24px; color: var(--navy); margin-bottom: 12px; }
.loading-sub { color: #aaa; margin-bottom: 32px; }
.progress-dots { display: flex; justify-content: center; gap: 8px; }
.progress-dots .dot { width: 40px; height: 6px; border-radius: 3px; background: #E5E5E5; transition: background .4s; }
.progress-dots .dot.active { background: var(--orange); }

/* ── RESULT PAGE ── */
.result-container { max-width: 720px; margin: 0 auto; padding: 32px 24px 80px; }
.success-banner { background: var(--green); border-radius: 16px; padding: 20px 24px; margin-bottom: 24px; color: #fff; display: flex; align-items: center; gap: 16px; }
.success-title { font-family: 'Fraunces', serif; font-weight: 700; font-size: 17px; margin-bottom: 4px; }
.success-sub { font-size: 13px; opacity: .9; }

.theme-bar { background: rgba(255,140,66,.08); border-left: 4px solid var(--orange); padding: 14px 20px; border-radius: 0 12px 12px 0; margin-bottom: 24px; }
.theme-label { font-weight: 700; color: var(--orange); font-size: 13px; }
.theme-text { font-family: 'Fraunces', serif; font-size: 18px; color: var(--navy); margin-top: 4px; }

/* ── TABS ── */
.tab-bar { display: flex; gap: 8px; margin-bottom: 24px; background: #fff; padding: 4px; border-radius: 16px; }
.tab-btn { flex: 1; padding: 12px; border-radius: 12px; border: none; cursor: pointer; background: transparent; color: var(--navy); font-weight: 600; font-size: 14px; transition: all .2s; font-family: 'Inter', sans-serif; }
.tab-btn.active { background: var(--orange); color: #fff; }

/* ── DAY CARDS ── */
.day-cards { display: grid; gap: 14px; }
.day-card { border: 2px solid #EEE; border-radius: 16px; overflow: hidden; transition: all .3s; }
.day-card.open { box-shadow: 0 4px 20px rgba(255,140,66,.15); }
.day-card-wed.open { box-shadow: 0 4px 20px rgba(76,175,80,.15); }
.day-card-header {
    width: 100%; padding: 16px 20px; background: none; border: none;
    cursor: pointer; display: flex; align-items: center; gap: 12px;
    text-align: left; font-family: 'Inter', sans-serif;
}
.day-icon { font-size: 28px; }
.day-header-text { flex: 1; }
.day-name-row { display: flex; align-items: center; gap: 8px; }
.day-name { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 700; color: var(--navy); }
.sig-badge { background: var(--green); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px; }
.day-tagline { font-size: 13px; font-weight: 600; margin-top: 2px; }
.day-arrow { font-size: 20px; transition: transform .3s; }
.day-arrow.open { transform: rotate(180deg); }
.day-card-body { padding: 0 20px 20px; border-top: 1px solid #EEE; }
.day-meta { font-size: 13px; color: #888; margin: 12px 0 8px; }
.items-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.food-item { padding: 10px 14px; border-radius: 10px; font-size: 14px; color: var(--navy); display: flex; align-items: center; gap: 8px; }
.macros-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.macro-chip { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 20px; display: inline-block; }
.progress-bars { margin-top: 8px; }
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bar-lbl { font-size: 12px; color: var(--navy); width: 100px; }
.bar-track { flex: 1; height: 7px; background: #eee; border-radius: 10px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 10px; transition: width .8s ease; }
.bar-pct { font-size: 12px; font-weight: 600; color: var(--navy); width: 34px; text-align: right; }

/* ── TIMETABLE ── */
.timetable-card { background: #fff; border-radius: 16px; padding: 20px; }
.tt-school { font-family: 'Fraunces', serif; font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.tt-class  { color: #888; font-size: 14px; margin-bottom: 16px; }
.tt-table  { width: 100%; border-collapse: collapse; font-size: 13px; }
.tt-table thead tr { background: var(--navy); }
.tt-table thead th { padding: 10px 12px; color: #fff; text-align: center; }
.tt-table thead th:first-child { text-align: left; }
.tt-row-even { background: #fff; }
.tt-row-odd  { background: var(--cream); }
.tt-period   { padding: 8px 12px; font-weight: 600; color: var(--navy); }
.tt-cell     { padding: 8px 12px; text-align: center; }
.tt-badge    { padding: 3px 8px; border-radius: 8px; font-size: 12px; font-weight: 500; display: inline-block; }
.tt-legend   { display: flex; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.tt-legend-chip { padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.cog-load      { margin-top: 24px; }
.cog-load-title{ font-weight: 700; margin-bottom: 12px; font-size: 14px; }
.cog-load-chips{ display: flex; gap: 8px; flex-wrap: wrap; }
.cog-chip      { padding: 6px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; }

/* ── SHARE BOX ── */
.share-box { margin-top: 32px; background: var(--navy); border-radius: 20px; padding: 24px; text-align: center; }
.share-title { color: #fff; font-family: 'Fraunces', serif; font-size: 20px; margin-bottom: 8px; }
.share-sub   { color: #aaa; font-size: 14px; margin-bottom: 20px; }
.share-btns  { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
    .hero-title { font-size: 2rem; }
    .items-grid { grid-template-columns: 1fr; }
    .preview-grid { grid-template-columns: 1fr; }
    .navbar { padding: 0 14px; }
}
