/* ============================================================
   myZenTrack – Meal Recommender styles
   Extends calculator.css which supplies .mc-landing, .mc-header,
   .mc-footer, dark-mode CSS variables, and global box-sizing.
   ============================================================ */

/* ------ Meal content shell (wider than mc-section-inner) ---- */
.mc-meal-shell {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
    padding: 40px 4% 72px;
    box-sizing: border-box;
}

/* ------ Glass panels --------------------------------------- */
.mc-meal-hero-copy,
.mc-meal-hero-card,
.mc-meal-panel,
.mc-meal-detail {
    background: rgba(255,255,255,.88);
    border: 1px solid rgba(148,163,184,.22);
    border-radius: 20px;
    box-shadow: 0 10px 36px rgba(15,23,42,.07);
    backdrop-filter: blur(10px);
}

/* ------ Hero ----------------------------------------------- */
.mc-meal-hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
    margin-bottom: 20px;
}

.mc-meal-hero-copy {
    padding: 30px 32px;
}

.mc-meal-hero-copy h1 {
    margin: 8px 0 12px;
    font-size: clamp(1.9rem, 3.5vw, 3.6rem);
    line-height: 1.06;
    letter-spacing: -.04em;
}

.mc-meal-hero-copy p {
    color: #334155;
    font-size: 1.02rem;
    max-width: 52ch;
    margin: 0;
}

.mc-meal-badge,
.mc-meal-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(16,185,129,.16), rgba(14,165,233,.16));
    color: #0f766e;
    font-size: .74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .09em;
}

/* ------ Search card ---------------------------------------- */
.mc-meal-hero-card {
    padding: 24px;
    position: relative;
}

.mc-meal-hero-card label {
    display: block;
    font-weight: 600;
    font-size: .95rem;
    margin-bottom: 10px;
    color: #0f172a;
}

.mc-meal-search-row {
    display: flex;
    gap: 10px;
}

.mc-meal-search-row input[type="search"] {
    flex: 1;
    border-radius: 14px;
    border: 1.5px solid #cbd5e1;
    padding: 13px 16px;
    font-size: 1rem;
    font-family: inherit;
    background: #fff;
    outline: none;
    transition: border-color .15s;
    -webkit-appearance: none;
}
.mc-meal-search-row input[type="search"]:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16,185,129,.12);
}

.mc-meal-btn {
    border: 0;
    border-radius: 14px;
    padding: 13px 22px;
    background: linear-gradient(135deg, #0f766e, #10b981);
    color: #fff;
    font-weight: 700;
    font-family: inherit;
    font-size: .95rem;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .15s;
}
.mc-meal-btn:hover { opacity: .86; }

/* ------ Search results dropdown ---------------------------- */
.mc-meal-search-results {
    display: none;
    flex-direction: column;
    gap: 6px;
    position: absolute;
    left: 24px;
    right: 24px;
    top: calc(100% - 6px);
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(15,23,42,.15);
    padding: 10px;
    z-index: 200;
    max-height: 340px;
    overflow-y: auto;
}

.mc-meal-search-results.mc-search-open {
    display: flex;
}

button.mc-meal-search-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    border: 1px solid #f1f5f9;
    border-radius: 12px;
    background: #fff;
    padding: 12px 14px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    width: 100%;
    transition: background .1s, border-color .1s;
}
button.mc-meal-search-item:hover {
    background: #f0fdf9;
    border-color: #a7f3d0;
}
button.mc-meal-search-item strong {
    font-size: .93rem;
    color: #0f172a;
}
button.mc-meal-search-item span {
    font-size: .81rem;
    color: #64748b;
}

/* ------ Meal browse strip ---------------------------------- */
.mc-meal-browse-wrap {
    margin-bottom: 20px;
}

.mc-meal-browse-label {
    font-size: .78rem;
    font-weight: 700;
    color: #94a3b8;
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: .08em;
}

.mc-meal-browse {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

button.mc-meal-browse-card {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    border: 1.5px solid rgba(148,163,184,.3);
    border-radius: 14px;
    background: rgba(255,255,255,.82);
    padding: 11px 16px;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    transition: transform .12s, border-color .12s, box-shadow .12s, background .12s;
}
button.mc-meal-browse-card:hover {
    transform: translateY(-2px);
    border-color: #10b981;
    box-shadow: 0 8px 20px rgba(16,185,129,.12);
    background: #fff;
}
button.mc-meal-browse-card.is-active {
    border-color: #10b981;
    background: #f0fdf9;
    box-shadow: 0 0 0 3px rgba(16,185,129,.14);
}
button.mc-meal-browse-card strong {
    font-size: .88rem;
    color: #0f172a;
    font-weight: 600;
}
button.mc-meal-browse-card span {
    font-size: .76rem;
    color: #64748b;
}

/* ------ Selected meal detail panel ------------------------- */
.mc-meal-detail {
    padding: 28px 32px;
    margin-bottom: 20px;
}

.mc-hidden { display: none !important; }
.mc-deferred-section { display: none; }

.mc-meal-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.mc-meal-detail-title .mc-meal-kicker {
    margin-bottom: 6px;
}

.mc-meal-detail-title h2 {
    margin: 0;
    font-size: clamp(1.5rem, 2.5vw, 2.4rem);
    letter-spacing: -.03em;
    line-height: 1.1;
}

.mc-meal-meta {
    color: #64748b;
    font-size: .88rem;
    margin: 4px 0 0;
}

.mc-meal-score-pill {
    white-space: nowrap;
    background: #0f172a;
    color: #fff;
    border-radius: 999px;
    padding: 8px 16px;
    font-weight: 700;
    font-size: .86rem;
    align-self: center;
}

.mc-meal-description {
    background: linear-gradient(180deg, #f8fafc, #fff);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 18px;
    color: #334155;
    line-height: 1.65;
    font-size: .92rem;
    margin-bottom: 22px;
}

.mc-meal-description p {
    margin: 0;
}

.mc-meal-prep-ideas {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed #cbd5e1;
}

.mc-meal-prep-ideas strong {
    display: block;
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #0f766e;
    margin-bottom: 6px;
}

.mc-meal-prep-ideas ul {
    margin: 0;
    padding-left: 18px;
}

.mc-meal-prep-ideas li {
    margin: 0 0 4px;
}

/* ------ Profiles (nutrients + targets) --------------------- */
.mc-meal-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 24px;
    align-items: start;
}

.mc-meal-main {
    min-width: 0;
}

.mc-meal-sidebar {
    position: sticky;
    top: 104px;
}

.mc-meal-target-sidebar {
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.mc-meal-profiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-bottom: 20px;
}

.mc-meal-main-profiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mc-meal-ingredients {
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    padding: 14px;
    background: #fff;
    color: #334155;
    line-height: 1.6;
    font-size: .92rem;
    min-height: 96px;
}

.mc-meal-ingredients p {
    margin: 0;
}

.mc-meal-ingredients-empty {
    color: #94a3b8;
    font-style: italic;
}

.mc-meal-profile-col > h3 {
    margin: 0 0 10px;
    font-size: .9rem;
    font-weight: 700;
    color: #0f172a;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.mc-slider-hint {
    font-size: .8rem;
    color: #94a3b8;
    margin: -4px 0 12px;
}

.mc-meal-nutrients,
.mc-meal-targets {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mc-meal-nutrient,
.mc-meal-target {
    border: 1px solid #e2e8f0;
    border-radius: 13px;
    padding: 11px 14px;
    background: #fff;
}

.mc-meal-nutrient-head,
.mc-meal-target-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.mc-meal-nutrient strong,
.mc-meal-target strong {
    font-size: .9rem;
    color: #0f172a;
}

.mc-meal-value {
    font-size: .87rem;
    color: #475569;
    font-weight: 600;
}

.mc-target-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mc-target-delta {
    font-size: .75rem;
    font-weight: 700;
    border-radius: 6px;
    padding: 2px 7px;
    min-width: 30px;
    text-align: center;
    transition: background .15s, color .15s;
}

.mc-delta-up   { background: #d1fae5; color: #065f46; }
.mc-delta-down { background: #fee2e2; color: #991b1b; }

/* ------ Slider row ----------------------------------------- */
.mc-meal-slider-row {
    display: grid;
    grid-template-columns: 34px 1fr 34px;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
}

button.mc-slider-btn {
    width: 34px;
    height: 34px;
    border: 1.5px solid #e2e8f0;
    border-radius: 50%;
    background: #f8fafc;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    transition: background .1s, border-color .1s;
    padding: 0;
}
button.mc-slider-btn:hover {
    background: #e0fdf4;
    border-color: #10b981;
}

.mc-meal-slider-row input[type='range'] {
    width: 100%;
    accent-color: #10b981;
    cursor: pointer;
}

/* ------ Summary bar ---------------------------------------- */
.mc-meal-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.mc-meal-summary > div {
    background: linear-gradient(180deg, #f8fafc 0%, #fff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 14px 16px;
}

.mc-meal-summary span {
    display: block;
    font-size: .74rem;
    color: #64748b;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: .07em;
    font-weight: 600;
}

.mc-meal-summary strong {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
}

/* ------ Recommendations panel ------------------------------ */
.mc-meal-panel {
    padding: 24px 28px;
}

.mc-meal-panel-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.mc-meal-panel-heading .mc-meal-kicker {
    margin-bottom: 6px;
}

.mc-meal-panel-heading h2 {
    margin: 0;
    font-size: clamp(1.2rem, 2.2vw, 1.9rem);
    letter-spacing: -.03em;
    line-height: 1.1;
}

.mc-meal-recommendation-note {
    font-size: .84rem;
    color: #64748b;
    margin: 0;
}

.mc-meal-recommendations {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

/* ------ Recommendation cards ------------------------------- */
.mc-meal-rec-item {
    border: 1px solid rgba(148,163,184,.25);
    border-radius: 16px;
    background: #fff;
    padding: 16px;
    cursor: pointer;
    transition: transform .12s, box-shadow .12s, border-color .12s;
}
.mc-meal-rec-item:hover {
    transform: translateY(-2px);
    border-color: rgba(16,185,129,.5);
    box-shadow: 0 12px 28px rgba(15,23,42,.09);
}

.mc-rec-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 5px;
}

.mc-rec-header h3 {
    margin: 0;
    font-size: .95rem;
    color: #0f172a;
    line-height: 1.3;
}

.mc-rec-match-pill {
    flex-shrink: 0;
    white-space: nowrap;
    background: #f0fdf4;
    color: #059669;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: .74rem;
    font-weight: 700;
}

.mc-rec-match-pill.mc-match-good    { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.mc-rec-match-pill.mc-match-partial { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.mc-rec-match-pill.mc-match-low     { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }

.mc-rec-meta {
    font-size: .81rem;
    color: #64748b;
    margin: 0 0 8px;
}

.mc-rec-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
}

.mc-nutrient-badge {
    font-size: .71rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 7px;
    cursor: default;
    white-space: nowrap;
}

.mc-badge-match   { background: #d1fae5; color: #065f46; }
.mc-badge-partial { background: #fef3c7; color: #92400e; }
.mc-badge-low     { background: #fee2e2; color: #991b1b; }
.mc-badge-high    { background: #ede9fe; color: #5b21b6; }
.mc-badge-missing { background: #f1f5f9; color: #64748b; }

.mc-rec-ingredients {
    font-size: .79rem;
    color: #94a3b8;
    margin: 0;
    font-style: italic;
    line-height: 1.4;
}

.mc-meal-empty {
    grid-column: 1 / -1;
    padding: 20px 24px;
    border-radius: 14px;
    background: #fff;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    font-size: .9rem;
    line-height: 1.5;
}

/* ------ Search-first page flow (Google-like) -------------- */
.mc-meal-shell-search-first {
    max-width: 1180px;
}

.mc-meal-search-stage {
    min-height: calc(100vh - 300px);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: min-height .25s ease;
}

.mc-meal-search-stage-inner {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    text-align: center;
}

.mc-meal-search-stage-inner h1 {
    margin: 12px 0 10px;
    font-size: clamp(2rem, 4.5vw, 3.9rem);
    line-height: 1.04;
    letter-spacing: -.04em;
}

.mc-meal-search-stage-inner p {
    margin: 0 auto 16px;
    max-width: 64ch;
    color: #475569;
}

.mc-meal-search-stage-card {
    max-width: 760px;
    margin: 0 auto;
    text-align: left;
}

.mc-meal-shell-search-first.has-searched .mc-meal-search-stage {
    min-height: 0;
    display: block;
    margin-bottom: 18px;
}

.mc-meal-shell-search-first.has-searched .mc-meal-search-stage-inner {
    max-width: 100%;
    text-align: left;
}

.mc-meal-shell-search-first.has-searched .mc-meal-badge {
    display: none;
}

.mc-meal-shell-search-first.has-searched .mc-meal-search-stage-inner h1 {
    font-size: clamp(1.25rem, 2.5vw, 1.8rem);
    margin: 0 0 8px;
}

.mc-meal-shell-search-first.has-searched .mc-meal-search-stage-inner p {
    margin: 0 0 10px;
    max-width: none;
    font-size: .92rem;
}

.mc-meal-shell-search-first.has-searched .mc-meal-search-stage-card {
    max-width: 100%;
    padding: 18px 20px;
}

/* ------ Responsive ----------------------------------------- */
@media (max-width: 1200px) {
    .mc-meal-recommendations {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .mc-meal-layout {
        grid-template-columns: 1fr;
    }
    .mc-meal-sidebar {
        position: static;
        top: auto;
    }
    .mc-meal-hero,
    .mc-meal-profiles {
        grid-template-columns: 1fr;
    }
    .mc-meal-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .mc-meal-shell {
        padding: 20px 4% 48px;
    }
    .mc-meal-hero-copy {
        padding: 22px;
    }
    .mc-meal-detail {
        padding: 20px;
    }
    .mc-meal-panel {
        padding: 18px;
    }
    .mc-meal-recommendations {
        grid-template-columns: 1fr;
    }
    .mc-meal-detail-header,
    .mc-meal-panel-heading {
        flex-direction: column;
        align-items: flex-start;
    }
    .mc-meal-summary {
        grid-template-columns: 1fr 1fr;
    }
    .mc-meal-search-results {
        left: 16px;
        right: 16px;
    }
    .mc-meal-search-stage {
        min-height: calc(100vh - 250px);
    }
    .mc-meal-shell-search-first.has-searched .mc-meal-search-stage-card {
        padding: 14px;
    }
}
