:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.35);
    --accent: #8b5cf6;
    --background: #030712;
    --surface: rgba(255, 255, 255, 0.04);
    --surface-hover: rgba(255, 255, 255, 0.07);
    --surface-border: rgba(255, 255, 255, 0.1);
    --text: #f9fafb;
    --text-muted: #9ca3af;
    --error: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ========================================
   BACKGROUND
   ======================================== */
.mesh-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.mesh-gradient {
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background:
        radial-gradient(circle at 20% 30%, rgba(99, 102, 241, 0.13) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(139, 92, 246, 0.13) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.04) 0%, transparent 60%);
    filter: blur(80px);
    animation: mesh-rotate 25s linear infinite;
}

@keyframes mesh-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   LAYOUT
   ======================================== */
main {
    max-width: 1020px;
    margin: 0 auto;
    padding: 2rem;
}

header {
    margin-bottom: 3rem;
}

.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -1px;
    background: linear-gradient(to right, var(--text), var(--primary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo i {
    -webkit-text-fill-color: initial;
    color: var(--primary);
}

/* ========================================
   HERO
   ======================================== */
.hero {
    text-align: center;
    margin-bottom: 4rem;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.1;
    letter-spacing: -2px;
}

.accent {
    color: var(--primary);
}

.subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* ========================================
/* ========================================
   PROFILE SELECTOR
   ======================================== */
.profile-selector-wrapper {
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.profile-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 16px;
}

.profile-tab {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
    padding: 8px 16px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.profile-tab:hover {
    color: var(--text);
}

.profile-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.profile-panes {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    padding: 20px;
}

.profile-pane {
    display: none;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.profile-pane.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.diet-chip {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--surface-border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.diet-chip:hover {
    border-color: var(--primary);
    color: var(--text);
    background: rgba(99, 102, 241, 0.1);
}

.diet-chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 20px var(--primary-glow);
    transform: translateY(-2px);
}

/* ========================================
   SEARCH BOX
   ======================================== */
.search-container {
    max-width: 680px;
    margin: 0 auto;
}

.search-box {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    backdrop-filter: blur(20px);
    border-radius: 100px;
    padding: 8px 8px 8px 52px;
    display: flex;
    align-items: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box:focus-within {
    box-shadow: 0 0 30px var(--primary-glow), 0 0 0 2px var(--primary);
    transform: translateY(-2px);
}

.search-icon {
    position: absolute;
    left: 20px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

#dishInput {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 1.05rem;
    width: 100%;
    padding: 10px 0;
}

#dishInput::placeholder {
    color: var(--text-muted);
}

#searchBtn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px 26px;
    border-radius: 100px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

#searchBtn:hover {
    background: var(--accent);
    box-shadow: 0 0 20px var(--primary-glow);
}

.search-tags-wrapper {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.search-categories {
    display: flex;
    align-items: center;
    gap: 12px;
    justify-content: center;
}

.category-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    min-width: 80px;
    text-align: right;
}

.tags-scroll {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.tag {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    color: var(--text);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tag:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* ========================================
   LOADER
   ======================================== */
.loader {
    padding: 5rem;
    text-align: center;
    color: var(--text-muted);
}

.spinner {
    width: 56px;
    height: 56px;
    margin: 0 auto 1.5rem;
    border: 4px solid rgba(255, 255, 255, 0.08);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.not-found {
    padding: 2rem;
    color: var(--text-muted);
}

.not-found i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary);
    display: block;
}

/* ========================================
   RESULTS SECTION
   ======================================== */
.results {
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--surface-border);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 2.5rem;
    margin-top: 2rem;
    animation: slideUp 0.5s ease-out;
}

.hidden {
    display: none !important;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   RESULTS HEADER
   ======================================== */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 1.5rem;
    gap: 2rem;
    flex-wrap: wrap;
}

h2 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.data-source-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.data-source-label i {
    color: var(--success);
}

.meta-badges {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 10px;
}

.serving-size {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    padding: 4px 10px;
    border-radius: 20px;
}

.header-actions {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
}

/* ========================================
   PORTION CONTROL
   ======================================== */
.portion-control {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 180px;
}

.portion-control label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 600;
}

.portion-advice {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
    max-width: 220px;
}

.diet-portion-note {
    display: block;
    margin-top: 6px;
    color: var(--primary);
    font-size: 0.78rem;
}

input[type=range] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

input[type=range]::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--primary);
    -webkit-appearance: none;
    margin-top: -6px;
    box-shadow: 0 0 10px var(--primary-glow);
    cursor: grab;
}

/* ========================================
   AI INSIGHTS ROW
   ======================================== */
.insights-row {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

.health-score-container {
    width: 120px;
    flex-shrink: 0;
}

.circular-chart {
    display: block;
    margin: 0 auto;
    max-width: 100%;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 3.8;
}

.circle {
    fill: none;
    stroke-width: 2.8;
    stroke-linecap: round;
    stroke: var(--primary);
    transition: stroke-dasharray 1.2s ease, stroke 0.5s ease;
}

.percentage {
    fill: var(--text);
    font-size: 0.5rem;
    text-anchor: middle;
    font-weight: 800;
}

.score-label {
    display: block;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.coach-verdict {
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.18);
    border-radius: 20px;
    padding: 1.5rem;
    flex: 1;
}

.coach-verdict h3 {
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

.diet-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.diet-tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--surface-border);
}

/* ========================================
   DIET VERDICT
   ======================================== */
.diet-verdict-section {
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.diet-verdict-section h3 {
    color: var(--accent);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
}

#dietVerdictText {
    color: var(--text);
    line-height: 1.6;
    font-size: 0.95rem;
}

.diet-name-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    margin-right: 10px;
}

.profile-verdict-item {
    padding: 10px 0;
    border-bottom: 1px dashed rgba(139, 92, 246, 0.2);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.profile-verdict-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.mt-2 {
    margin-top: 8px;
}

/* ========================================
   STATS GRID
   ======================================== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--surface-border);
    border-radius: 20px;
    padding: 1.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 0 15px var(--primary-glow);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
    color: var(--text-muted);
}

.stat-label {
    font-weight: 700;
    font-size: 0.9rem;
}

.stat-value {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
}

.stat-value small {
    font-size: 1.2rem;
    font-weight: 400;
    color: var(--text-muted);
}

.stat-progress {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    margin-top: 1.2rem;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(to right, var(--primary), var(--accent));
    transition: width 1s ease-in-out;
}

.stat-reference {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* MACROS */
.macros-grid {
    display: grid;
    gap: 12px;
}

.macro-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--surface-border);
    padding: 14px 18px;
    border-radius: 16px;
    transition: all 0.3s ease;
}

.macro-card:hover {
    transform: translateX(4px);
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.2);
}

.macro-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    align-items: baseline;
}

.macro-info .label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.macro-info .amount {
    font-weight: 800;
    font-size: 1.1rem;
}

.macro-bar {
    height: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.fill {
    height: 100%;
    width: 0;
    transition: width 1s ease-in-out;
    border-radius: 4px;
}

.protein .fill {
    background: linear-gradient(to right, #3b82f6, #6366f1);
}

.carbs .fill {
    background: linear-gradient(to right, #f59e0b, #eab308);
}

.fats .fill {
    background: linear-gradient(to right, #ef4444, #f97316);
}

.macro-ref {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ========================================
   MICRONUTRIENTS
   ======================================== */
.details-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 2.5rem;
}

.detail-item {
    text-align: center;
    padding: 16px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.detail-icon {
    color: var(--primary);
    font-size: 1rem;
    margin-bottom: 4px;
}

.detail-item .label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.detail-item .value {
    font-weight: 800;
    font-size: 1.2rem;
}

.detail-ref {
    font-size: 0.7rem;
    color: rgba(156, 163, 175, 0.6);
}

/* ========================================
   SECTION HEADERS (shared)
   ======================================== */
.section-header {
    margin-bottom: 1.5rem;
}

.section-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.4;
}

.ai-badge {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: white;
    vertical-align: middle;
}

/* ========================================
   INGREDIENTS
   ======================================== */
.ingredients-section {
    background: rgba(255, 255, 255, 0.018);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.ingredients-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.ingredient-item {
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 14px;
    padding: 14px 16px;
    transition: all 0.25s ease;
}

.ingredient-item:hover {
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.3);
}

.ingredient-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.ingredient-name {
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ingredient-name i {
    color: var(--primary);
    font-size: 0.65rem;
}

.ingredient-amount {
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.ingredient-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ingredient-role {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
}

.ingredient-kcal {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
}

/* ========================================
   PREPARATION
   ======================================== */
.preparation-section {
    background: rgba(255, 255, 255, 0.018);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.prep-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 2rem;
}

.prep-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 14px;
    border: 1px solid var(--surface-border);
    transition: background 0.2s;
}

.prep-step:hover {
    background: rgba(255, 255, 255, 0.04);
}

.step-number {
    min-width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
    box-shadow: 0 0 12px var(--primary-glow);
}

.prep-step p {
    font-size: 0.9rem;
    color: var(--text);
    line-height: 1.6;
    padding-top: 4px;
}

.prep-advice-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 1.5rem;
}

.prep-do,
.prep-dont {
    padding: 1.2rem;
    border-radius: 16px;
}

.prep-do {
    background: rgba(16, 185, 129, 0.05);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.prep-dont {
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.prep-do h4 {
    color: var(--success);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.prep-dont h4 {
    color: var(--error);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
}

.prep-do ul,
.prep-dont ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.prep-do li,
.prep-dont li {
    font-size: 0.85rem;
    line-height: 1.5;
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.prep-do li i {
    color: var(--success);
    margin-top: 3px;
    flex-shrink: 0;
}

.prep-dont li i {
    color: var(--error);
    margin-top: 3px;
    flex-shrink: 0;
}

/* ========================================
   SWAPS
   ======================================== */
.swaps-section {
    background: rgba(255, 255, 255, 0.018);
    border: 1px solid var(--surface-border);
    border-radius: 24px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.swaps-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

.swap-item {
    background: rgba(16, 185, 129, 0.04);
    border: 1px solid rgba(16, 185, 129, 0.12);
    padding: 18px 20px;
    border-radius: 18px;
    transition: all 0.3s ease;
}

.swap-item:hover {
    background: rgba(16, 185, 129, 0.08);
    transform: translateX(4px);
    border-color: rgba(16, 185, 129, 0.25);
}

.swap-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.swap-label {
    color: var(--success);
    font-weight: 800;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.swap-saving {
    background: rgba(16, 185, 129, 0.12);
    color: var(--success);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}

.swap-comparison {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.swap-old {
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: line-through;
    text-decoration-color: rgba(239, 68, 68, 0.5);
}

.swap-new {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--success);
}

.swap-arrow {
    color: var(--primary);
    font-size: 0.85rem;
}

.swap-benefit {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ========================================
   NUTRISCORE BADGES
   ======================================== */
.nutri-score-badge {
    padding: 5px 12px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.score-a {
    background: #008b4c;
    color: white;
}

.score-b {
    background: #85bb2f;
    color: white;
}

.score-c {
    background: #fecb02;
    color: black;
}

.score-d {
    background: #ee8100;
    color: white;
}

.score-e {
    background: #e63e11;
    color: white;
}

/* ========================================
   BUTTONS
   ======================================== */
.nav-btn {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--text);
    padding: 10px 22px;
    border-radius: 100px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
}

.nav-btn:hover {
    background: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
    transform: translateY(-2px);
}

.action-btn {
    padding: 14px 28px;
    border-radius: 100px;
    border: none;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s;
    white-space: nowrap;
}

.action-btn.primary {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

.action-btn.primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--surface-border);
    color: var(--text-muted);
    padding: 14px;
    border-radius: 100px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 2rem;
    width: 100%;
    transition: all 0.3s;
}

.secondary-btn:hover {
    border-color: var(--error);
    color: var(--error);
    background: rgba(239, 68, 68, 0.05);
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
    position: fixed;
    top: 0;
    right: -420px;
    width: 420px;
    height: 100%;
    background: rgba(3, 7, 18, 0.9);
    backdrop-filter: blur(30px);
    border-left: 1px solid var(--surface-border);
    z-index: 1000;
    transition: right 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -30px 0 60px rgba(0, 0, 0, 0.4);
}

.sidebar.open {
    right: 0;
}

.sidebar-content {
    padding: 2.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

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

#closeSidebar {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s;
}

#closeSidebar:hover {
    color: var(--text);
}

.daily-stats {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

.daily-stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.daily-stat-item #totalKcal {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
}

.daily-kcal-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.daily-progress-container {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.daily-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(to right, var(--primary), var(--accent));
    transition: width 0.5s ease;
}

.daily-list {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}

.logged-meal {
    background: rgba(255, 255, 255, 0.03);
    padding: 14px 16px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--surface-border);
    transition: all 0.2s;
}

.logged-meal:hover {
    transform: translateX(-4px);
    background: rgba(255, 255, 255, 0.05);
}

.meal-name {
    font-weight: 700;
    font-size: 0.95rem;
}

.meal-kcal {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 3px 10px;
    border-radius: 100px;
}

/* ========================================
   COACH SUMMARY
   ======================================== */
.coach-summary {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 1.5rem;
    border-radius: 16px;
    margin: 1.5rem 0;
}

.coach-summary h4 {
    color: var(--accent);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.coach-summary p {
    color: var(--text);
    font-size: 0.88rem;
    line-height: 1.5;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    max-width: 1020px;
    margin: 0 auto;
    padding: 4rem 2rem;
    border-top: 1px solid var(--surface-border);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--text);
}

.empty-msg {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 900px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .results-header {
        flex-direction: column;
    }

    .header-actions {
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    main {
        padding: 1rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    .details-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .prep-advice-grid {
        grid-template-columns: 1fr;
    }

    .insights-row {
        flex-direction: column;
    }

    .health-score-container {
        width: 100%;
        max-width: 140px;
        margin: 0 auto;
    }

    .sidebar {
        width: 100%;
        right: -100%;
    }

    .ingredients-list {
        grid-template-columns: 1fr;
    }

    .diet-selector {
        gap: 8px;
    }

    .diet-chip {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .details-grid {
        grid-template-columns: 1fr 1fr;
    }

    .swap-comparison {
        flex-direction: column;
        gap: 6px;
    }
}