@media print {
    body > *:not(.report-overlay) {
        display: none !important;
    }
    .report-overlay {
        display: block !important;
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        background: none !important;
    }
}
/* style.css */
:root {
    /* Light theme variables */
    --bg-color: #f9fafb;
    --text-color: #1f2937;
    --card-bg: rgba(255, 255, 255, 0.55);
    --card-border: rgba(255, 255, 255, 0.7);
    --primary-color: #4CAF50;
    --accent-color: #FFC107;
    --secondary-blue: #2196F3;
    --shadow: 0 8px 24px rgba(16, 24, 40, 0.08);
    --navbar-bg: rgba(249, 250, 251, 0.9);
    --input-bg: rgba(255, 255, 255, 0.8);
    --hover-bg: rgba(0, 0, 0, 0.03);
}

[data-theme="dark"] {
    --bg-color: #111827;
    --text-color: #f3f4f6;
    --card-bg: rgba(31, 41, 55, 0.7);
    --card-border: rgba(31, 41, 55, 0.8);
    --navbar-bg: rgba(17, 24, 39, 0.9);
    --input-bg: rgba(31, 41, 55, 0.6);
    --hover-bg: rgba(255, 255, 255, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 2.5rem;
    line-height: 1.2;
}

h2 {
    font-size: 1.8rem;
}

h3 {
    font-size: 1.4rem;
}

p {
    margin-bottom: 1rem;
}

/* Navigation */
.navbar {
    position: sticky;
    top: 0;
    background: var(--navbar-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 1rem 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: 700;
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Segmented Control */
.segmented-control {
    display: flex;
    background: var(--input-bg);
    border-radius: 8px;
    padding: 4px;
}

.segmented-option {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-color);
    cursor: pointer;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.segmented-option.active {
    background: var(--primary-color);
    color: white;
}

.segmented-option:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Theme Toggle */
.theme-toggle {
    background: var(--input-bg);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-toggle:hover {
    background: var(--hover-bg);
}

.theme-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

/* Hero Section */
.hero {
    padding: 4rem 1.5rem;
    text-align: center;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(33, 150, 243, 0.1) 100%);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.cta-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1.5rem;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.cta-button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.section-title {
    margin-bottom: 1.5rem;
    text-align: center;
}

/* Meal Panels */
.meal-panels {
            display: flex;
            flex-direction: column;
            gap: 1.5rem;
            justify-content: flex-start;
            align-items: stretch;
}


.meal-panel {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.meal-panel.collapsed .panel-content {
    display: none;
}

.meal-panel.collapsed .collapse-toggle::before {
    content: "+";
}

.panel-header {
    padding: 1rem 1.5rem;
    background: rgba(76, 175, 80, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.collapse-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.collapse-toggle:hover {
    background: var(--hover-bg);
}

.collapse-toggle:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.panel-content {
    padding: 1.5rem;
}

.panel-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.category-filter {
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--input-bg);
    color: var(--text-color);
    font-family: inherit;
}

.category-filter:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.search-container {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: var(--input-bg);
    color: var(--text-color);
    font-family: inherit;
}

.search-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6b7280;
}

/* Selected Items */
.selected-items-container {
    margin-bottom: 1.5rem;
}

.selected-items-container h4 {
    margin-bottom: 0.75rem;
}

.selected-items-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.selected-item-chip {
    background: rgba(76, 175, 80, 0.1);
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.quantity-btn {
    background: rgba(76, 175, 80, 0.2);
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.8rem;
}

.quantity-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.remove-item-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-item-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Food Grid */
.food-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.food-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.2, 1);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.food-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.food-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.food-icon {
    width: 40px;
    height: 40px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.food-name {
    font-weight: 600;
    font-size: 1rem;
}

.food-serving {
    font-size: 0.8rem;
    color: #6b7280;
}

.food-macros {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem;
    font-size: 0.8rem;
}

.food-tag {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.veg-tag {
    background: rgba(76, 175, 80, 0.1);
    color: var(--primary-color);
}

.nonveg-tag {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.add-btn {
    margin-top: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    align-self: flex-end;
    transition: all 0.2s ease;
}

.add-btn:hover {
    transform: scale(1.1);
}

.add-btn:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Meal Tray */
.meal-tray {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 100%;
    max-width: 400px;
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.meal-tray.open {
    transform: translateX(0);
}

.tray-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-tray {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-tray:hover {
    background: var(--hover-bg);
}

.close-tray:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.tray-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.meal-summary {
    margin-bottom: 1.5rem;
}

.meal-summary h3 {
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.meal-items-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.meal-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--input-bg);
    border-radius: 8px;
}

.meal-item-info {
    flex: 1;
}

.meal-item-name {
    font-weight: 500;
}

.meal-item-serving {
    font-size: 0.8rem;
    color: #6b7280;
}

.meal-item-macros {
    font-size: 0.8rem;
    display: flex;
    gap: 0.5rem;
}

.meal-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nutrition-totals {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.total-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}

.total-stat {
    background: var(--input-bg);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.stat-value {
    display: block;
    font-weight: 600;
    font-size: 1.2rem;
}

.daily-targets {
    text-align: center;
    font-size: 0.9rem;
    color: #6b7280;
}

.tray-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.generate-report-btn {
    width: 100%;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.generate-report-btn:hover {
    background: #3d8b40;
}

.generate-report-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Floating Tracker */
.floating-tracker {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 1rem;
    z-index: 90;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.floating-tracker:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.tracker-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.tracker-stat {
    text-align: center;
}

.tracker-label {
    display: block;
    font-size: 0.7rem;
    color: #6b7280;
    margin-bottom: 0.25rem;
}

.tracker-value {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
}

/* Report Overlay */
.report-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.report-overlay.open {
    opacity: 1;
    visibility: visible;
}

.report-container {
    background: var(--card-bg);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 16px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.report-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-report {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-report:hover {
    background: var(--hover-bg);
}

.close-report:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.report-content {
    padding: 1.5rem;
}

.summary-row {
    text-align: center;
    margin-bottom: 2rem;
}

.calories-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.calories-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.calories-unit {
    font-size: 1.5rem;
    color: #6b7280;
}

.calories-comparison {
    font-size: 1.1rem;
}

.charts-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.macro-chart-container {
    text-align: center;
}

.macro-legend {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.micronutrient-bars-container h3 {
    margin-bottom: 1rem;
}

.micronutrient-bar {
    margin-bottom: 1rem;
}

.micronutrient-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.micronutrient-bar-track {
    height: 8px;
    background: var(--input-bg);
    border-radius: 4px;
    overflow: hidden;
}

.micronutrient-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.meal-balance {
    margin-bottom: 2rem;
}

.meal-balance-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.balance-card {
    background: var(--input-bg);
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.balance-card h4 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.balance-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.balance-item {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.deficiency-report {
    margin-bottom: 2rem;
}

.deficiency-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.deficiency-item {
    background: rgba(239, 68, 68, 0.1);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.deficiency-info {
    flex: 1;
}

.deficiency-name {
    font-weight: 500;
    color: #ef4444;
}

.deficiency-details {
    font-size: 0.9rem;
    color: #6b7280;
}

.suggestions-panel {
    margin-bottom: 2rem;
}

.suggestions-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.suggestion-card {
    background: var(--input-bg);
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.suggestion-reason {
    font-size: 0.9rem;
    color: var(--primary-color);
    font-weight: 500;
}

.export-options {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.copy-summary-btn, .print-report-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-summary-btn {
    background: var(--secondary-blue);
    color: white;
}

.print-report-btn {
    background: var(--accent-color);
    color: #1f2937;
}

.copy-summary-btn:hover {
    background: #1e88e5;
}

.print-report-btn:hover {
    background: #ffb300;
}

.copy-summary-btn:focus, .print-report-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

.slide-in {
    animation: slideIn 0.3s ease forwards;
}

/* Responsive Design */
@media (max-width: 640px) {
    h1 {
        font-size: 2rem;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .meal-panels {
        grid-template-columns: 1fr;
    }
    
    .panel-controls {
        grid-template-columns: 1fr;
    }
    
    .food-grid {
        grid-template-columns: 1fr;
    }
    
    .meal-tray {
        width: 100%;
        max-width: none;
    }
    
    .meal-balance-cards {
        grid-template-columns: 1fr;
    }
    
    .floating-tracker {
        left: 1.5rem;
        right: 1.5rem;
        bottom: 1rem;
    }
    
    .export-options {
        flex-direction: column;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .meal-panels {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .food-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1100px) {
    .meal-panels {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .food-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .main-content {
        grid-template-columns: 1fr 400px;
    }
    
    .meal-tray {
        position: sticky;
        top: 6rem;
        height: calc(100vh - 8rem);
        transform: none;
        border-radius: 16px;
        margin-top: 2rem;
    }
    
    .meal-tray.open {
        transform: none;
    }
    
    .close-tray {
        display: none;
    }
    
    .charts-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .meal-tray,
    .floating-tracker,
    .close-report,
    .export-options {
        display: none !important;
    }
    
    .report-overlay {
        position: static;
        opacity: 1;
        visibility: visible;
        background: none;
    }
    
    .report-container {
        width: 100%;
        max-width: none;
        max-height: none;
        box-shadow: none;
    }
    
    body, .report-container {
        background: white;
        color: black;
    }
}