/* Nutrition Page Styles - Compact */
.nutrition-main {
    min-height: calc(100vh - 140px);
    padding: 100px 0 1rem 0; /* Top padding for fixed header */
    background: var(--background-light);
}

/* Ensure header has no borders while loading */
#site-header {
    border: none !important;
    border-bottom: none !important;
    box-shadow: none !important;
}

/* Only show box-shadow when header content is loaded */
#site-header.loaded {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05) !important;
}

/* Remove any pseudo-elements that might create lines */
#site-header::before,
#site-header::after,
.site-header::before,
.site-header::after,
.nutrition-main::before,
.nutrition-main::after {
    display: none !important;
}

/* Ensure container doesn't have top border */
.nutrition-main .container {
    border-top: none !important;
}

/* Raise dropdown z-index to appear above any mysterious lines */
.dropdown-menu {
    z-index: 10001 !important;
}

/* Ensure dropdown items are above everything */
.dropdown.active .dropdown-menu {
    z-index: 10001 !important;
}

.nutrition-header {
    text-align: center;
    margin-bottom: 1rem;
}

.page-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.page-title i {
    color: var(--primary-color);
}

.premium-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.5rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    border-radius: 20px;
    font-weight: 600;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Date Navigation */
.date-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.date-nav-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: #333; /* Make arrows black */
}

.date-nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.current-date {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.current-date i {
    color: var(--primary-color);
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    gap: 0.75rem;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card.calories .stat-icon {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.stat-card.protein .stat-icon {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-card.carbs .stat-icon {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-card.fat .stat-icon {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0.25rem 0;
}

.stat-progress {
    margin-top: 0.5rem;
}

.progress-bar {
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.stat-card.calories .progress-fill {
    background: #ef4444;
}

.stat-card.protein .progress-fill {
    background: #3b82f6;
}

.stat-card.carbs .progress-fill {
    background: #22c55e;
}

.stat-card.fat .progress-fill {
    background: #f59e0b;
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Macro Chart */
.macro-chart-container {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 3rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

/* Macro and Water Container */
.macro-water-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: stretch;
}

/* Macro Section - Compact */
.macro-section {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    flex: 1.5; /* Macro section takes 60% */
    overflow: visible;
}

.macro-section.compact {
    margin-bottom: 0;
}

.macro-section.compact .macro-content {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.macro-chart-small {
    position: relative;
    width: 250px;
    height: 250px;
    margin: 0 auto;
}

.macro-info {
    flex: 1;
}

.section-subtitle {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.macro-chart-small canvas {
    width: 250px !important;
    height: 250px !important;
}

#macroChart {
    max-width: 250px;
    max-height: 250px;
}

.chart-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.chart-calories {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.chart-label {
    font-size: 0.875rem;
    color: var(--text-light);
}

.macro-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.macro-legend.compact {
    gap: 0.4rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.875rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-item.protein .legend-color {
    background: #ef4444;
}

.legend-item.carbs .legend-color {
    background: #3b82f6;
}

.legend-item.fat .legend-color {
    background: #f59e0b;
}

.legend-label {
    font-size: 0.875rem;
    color: var(--text-dark);
}

.legend-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Quick Edit Button */
.quick-edit-btn {
    padding: 0.4rem 0.8rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.quick-edit-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Meals Section */
.meals-section {
    margin-bottom: 1.5rem;
}

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

.meal-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.customize-meals-btn,
.generate-meals-btn,
.view-plans-btn {
    padding: 0.5rem 1rem;
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.customize-meals-btn {
    background: var(--primary-color);
}

.generate-meals-btn {
    background: #10b981;
}

.view-plans-btn {
    background: #f59e0b;
}

.customize-meals-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.generate-meals-btn:hover {
    background: #059669;
    transform: translateY(-1px);
}

.view-plans-btn:hover {
    background: #d97706;
    transform: translateY(-1px);
}

#dynamic-meals-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.add-meal-btn {
    width: 100%;
    padding: 1rem;
    border: 2px dashed var(--primary-color);
    background: transparent;
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.add-meal-btn:hover {
    background: rgba(93, 95, 239, 0.05);
    border-color: var(--primary-hover);
}

.meal-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
}

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

.meal-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meal-title i {
    color: var(--primary-color);
}

.meal-stats {
    font-size: 0.875rem;
    color: var(--text-light);
}

.meal-calories {
    font-weight: 600;
}

.meal-foods {
    margin-bottom: 0.75rem;
}

.empty-meal {
    color: var(--text-light);
    font-style: italic;
    margin: 0.5rem 0;
    font-size: 0.875rem;
}

.food-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: #f9fafb;
    border-radius: var(--border-radius);
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
}

.food-name {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.125rem;
    font-size: 0.875rem;
}

.food-serving-editor {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0.25rem 0;
}

.serving-input {
    width: 60px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 0.875rem;
    text-align: center;
}

.serving-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(93, 95, 239, 0.1);
}

.serving-label {
    font-size: 0.75rem;
    color: #666;
}

.food-macros {
    font-size: 0.75rem;
    color: var(--text-light);
}

.remove-food-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-food-btn:hover {
    background: #ef4444;
    color: white;
}

.add-food-btn {
    width: 100%;
    padding: 0.5rem;
    border: 2px dashed #e5e7eb;
    background: transparent;
    border-radius: var(--border-radius);
    font-weight: 500;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.add-food-btn:hover {
    border-color: var(--primary-color);
    background: rgba(93, 95, 239, 0.05);
}

/* Water Section */
.water-section {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
    flex: 1; /* Water section takes 40% */
}

.water-section.compact {
    margin-bottom: 0;
}

.water-section.compact .section-title {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
}

.water-tracker {
    text-align: center;
}

.water-glasses {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.water-glass {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.3s ease;
}

.water-glass.filled {
    background: rgba(59, 130, 246, 0.8);
    color: white;
}

.water-glass:hover {
    transform: scale(1.1);
}

.water-stats {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 1rem;
    position: relative;
}

.water-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.water-goal {
    color: var(--text-light);
}

.water-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.water-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.water-btn:hover {
    transform: scale(1.1);
}

.water-increment {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.water-edit-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(93, 95, 239, 0.1);
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    margin-left: 0.5rem;
}

.water-edit-btn:hover {
    background: var(--primary-color);
    color: white;
}

.water-edit-panel {
    background: #f9fafb;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-top: 1rem;
}

.water-edit-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.water-edit-row:last-child {
    margin-bottom: 0;
}

.water-edit-row label {
    font-weight: 500;
    color: var(--text-dark);
    min-width: 150px;
}

.water-edit-row input {
    width: 80px;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
}

.water-edit-row button {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
}

.water-edit-row button:hover {
    background: var(--primary-hover);
}

/* Actions */
.nutrition-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.nutrition-actions.compact {
    margin-bottom: 1rem;
}

.nutrition-actions.top {
    margin-bottom: 1.5rem;
}

.action-btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-btn.compact {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.action-btn.primary {
    background: var(--primary-color);
    color: white;
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(93, 95, 239, 0.3);
}

.action-btn.secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.action-btn.secondary:hover {
    background: var(--primary-color);
    color: white;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

/* Upgrade Modal Specific Styles */
#upgradeModal {
    z-index: 99999 !important;
}

#upgradeModal .modal-content {
    z-index: 100000 !important;
}

/* Ensure all modals are properly centered */
.modal[style*="display: flex"] {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Ensure modal content is centered when modal is displayed as flex */
.modal[style*="display: flex"] .modal-content {
    margin: auto !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
}

.modal-content {
    background: white;
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    position: relative;
    margin: auto;
    z-index: 10000;
}

.modal-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-dark);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #3b82f6;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #2563eb;
    transform: scale(1.05);
}

.modal-body {
    padding: 1rem 1.5rem;
}

/* Food Search */
.food-search {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.food-search-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.search-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
}

.recent-foods,
.search-results {
    margin-bottom: 2rem;
}

.recent-foods h3,
.search-results h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.recent-foods-list,
.search-results-list {
    max-height: 200px;
    overflow-y: auto;
}

.food-result {
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.food-result:hover {
    background: #f3f4f6;
    transform: translateX(4px);
}

.food-info {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Manual Entry */
.manual-entry h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

#quickAddForm input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
    font-size: 1rem;
}

.macro-inputs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
}

.submit-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: var(--primary-hover);
}

/* Goals Form */
#goalsForm .form-group {
    margin-bottom: 1rem;
}

#goalsForm label {
    display: block;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.35rem;
}

#goalsForm input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-size: 0.95rem;
}

/* Macro percentage inputs */
.macro-split-section {
    background: #f9fafb;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.75rem;
}

.macro-row {
    margin-bottom: 0.75rem;
}

.macro-row:last-child {
    margin-bottom: 0;
}

.macro-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.macro-inputs-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.macro-inputs-row input {
    width: 80px;
    padding: 0.5rem;
}

.macro-inputs-row span {
    font-weight: 500;
    color: var(--text-light);
}

#goalsForm h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-top: 1rem;
    margin-bottom: 0.75rem;
}

#goalsForm small {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: #666;
}

/* Upgrade Modal */
.upgrade-modal {
    text-align: center;
}

.upgrade-icon {
    font-size: 4rem;
    color: #fbbf24;
    margin-bottom: 1rem;
}

.upgrade-modal h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.feature-list {
    list-style: none;
    text-align: left;
    margin: 2rem 0;
}

.feature-list li {
    padding: 0.5rem 0;
    color: var(--text-dark);
}

.feature-list i {
    color: #22c55e;
    margin-right: 0.5rem;
}

.upgrade-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.upgrade-btn {
    padding: 0.75rem 2rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

.cancel-btn {
    padding: 0.75rem 2rem;
    background: #f3f4f6;
    color: var(--text-dark);
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
}

/* Weekly Report Modal - Better Design */
.report-modal {
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
}

.report-modal .modal-body {
    padding: 1rem;
}

.report-date-range {
    text-align: center;
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.report-date-range i {
    color: var(--primary-color);
}

.report-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: #f9fafb;
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
}

.summary-card h4 {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
}

.summary-vs-goal {
    font-size: 0.75rem;
    color: var(--text-light);
}

.report-chart {
    margin-bottom: 1.5rem;
}

.report-chart h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

#weeklyChart {
    max-width: 100%;
    height: 250px;
    display: block;
    margin: 0 auto;
}

.report-macros {
    margin-bottom: 1.5rem;
}

.report-macros h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.macro-avg-bars {
    background: #f9fafb;
    padding: 1rem;
    border-radius: var(--border-radius);
}

.macro-avg-item {
    display: grid;
    grid-template-columns: 70px 1fr 50px;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.macro-avg-item:last-child {
    margin-bottom: 0;
}

.macro-avg-label {
    font-weight: 500;
    color: var(--text-dark);
}

.macro-avg-bar {
    height: 20px;
    background: #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.macro-avg-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
}

.macro-avg-fill.protein {
    background: #ef4444;
}

.macro-avg-fill.carbs {
    background: #3b82f6;
}

.macro-avg-fill.fat {
    background: #f59e0b;
}

.macro-avg-value {
    text-align: right;
    font-weight: 600;
    color: var(--text-dark);
}

.report-water {
    margin-bottom: 1.5rem;
}

.report-water h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.water-summary {
    background: rgba(59, 130, 246, 0.1);
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    font-size: 1rem;
    color: var(--text-dark);
}

.water-summary i {
    color: #3b82f6;
    margin-right: 0.5rem;
}

.report-foods {
    margin-bottom: 1.5rem;
}

.report-foods h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.top-foods-list {
    background: #f9fafb;
    padding: 1rem;
    border-radius: var(--border-radius);
    max-height: 200px;
    overflow-y: auto;
}

.top-food-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: white;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
}

.top-food-item:last-child {
    margin-bottom: 0;
}

.top-food-name {
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.875rem;
}

.top-food-count {
    font-size: 0.75rem;
    color: var(--text-light);
}

.report-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Quick Edit Section */
.quick-edit-section {
    margin-bottom: 2rem;
}

.quick-edit-toggle {
    width: 100%;
    padding: 1rem;
    background: white;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    color: var(--primary-color);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.quick-edit-toggle:hover {
    background: var(--primary-color);
    color: white;
}

.quick-edit-panel {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-top: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.calorie-editor {
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.calorie-editor label {
    font-weight: 600;
    color: var(--text-dark);
}

.calorie-editor input {
    width: 120px;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
}

.calorie-editor button {
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 500;
}

.macro-editor h4 {
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.macro-presets {
    margin-bottom: 1.5rem;
}

.macro-presets label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.preset-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.preset-buttons button {
    padding: 0.5rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    color: var(--text-dark);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.preset-buttons button:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.macro-slider-group {
    margin-bottom: 1rem;
}

.macro-slider-group label {
    display: block;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.macro-slider-group input[type="range"] {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.macro-slider-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
}

.macro-slider-group input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.macro-grams-preview {
    background: #f9fafb;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin: 1rem 0;
    display: flex;
    justify-content: space-around;
    font-weight: 500;
}

.save-macros-btn {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-macros-btn:hover {
    background: var(--primary-hover);
}

/* Edit button for stat cards */
.stat-edit-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(93, 95, 239, 0.1);
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.stat-edit-btn:hover {
    background: var(--primary-color);
    color: white;
}

.stat-card {
    position: relative;
}

/* Analytics Modal */
.analytics-modal {
    max-width: 900px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
    margin: auto !important;
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
}

/* Analytics Tabs */
.analytics-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    color: var(--text-light);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

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

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

.tab-content {
    display: none;
    padding: 1rem 0;
}

.tab-content.active {
    display: block;
}

.analytics-controls {
    margin-bottom: 2rem;
    text-align: center;
}

.analytics-controls label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.analytics-controls select {
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-size: 1rem;
}

.analytics-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.analytics-summary.compact {
    margin-bottom: 0;
}

.summary-stat {
    background: #f9fafb;
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid #e5e7eb;
}

.summary-stat h4 {
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    font-size: 1rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.analytics-summary .stat-label {
    font-size: 0.75rem;
    color: var(--text-light);
}

.analytics-summary .stat-value {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.chart-container {
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    border: 1px solid #e5e7eb;
}

.chart-container.compact {
    max-height: 400px;
}

.chart-container h3 {
    font-size: 1rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
    text-align: center;
}

.chart-container canvas {
    max-width: 100%;
    height: 250px !important;
}

/* Loading spinner */
.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.loading-spinner i {
    margin-right: 0.5rem;
}

/* Error message */
.error-message {
    color: #ef4444;
    text-align: center;
    padding: 1rem;
}

/* Nutrition Calculator Styles */
#nutritionCalculatorModal {
    z-index: 10000 !important;
}

.calculator-modal {
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    background: white !important;
    position: relative !important;
    z-index: 10001 !important;
    margin: auto !important;
}

.calculator-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 0 1rem;
}

.calculator-steps .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
}

.calculator-steps .step.active {
    opacity: 1;
}

.step-number {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: #e5e7eb;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.step.active .step-number {
    background: var(--primary-color);
    color: white;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-light);
}

.step.active .step-label {
    color: var(--primary-color);
}

.calculator-step-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.calculator-step-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.step-description {
    color: var(--text-light);
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

/* Form Styles */
.calculator-form {
    background: #f9fafb;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.form-row {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.form-group.half {
    flex: 1;
}

.form-group label {
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    display: block;
    font-weight: 500;
}

.calculator-step-content h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.modern-select {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    background: white;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.modern-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(93, 95, 239, 0.1);
}

/* Radio Group */
.radio-group.modern {
    display: flex;
    gap: 1rem;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    flex: 1;
    font-size: 0.875rem;
}

.radio-option:hover {
    border-color: var(--primary-color);
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    opacity: 1;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    margin-right: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
}

.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Input with Toggle */
.input-with-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-with-toggle input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

/* Height input group specific */
.height-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.height-input-group .input-with-toggle {
    flex: 1;
}

#heightImperial {
    display: flex;
    gap: 0.5rem;
}

#heightImperial input {
    flex: 1;
}

.unit-toggle {
    display: flex;
    background: #e5e7eb;
    border-radius: var(--border-radius);
    padding: 2px;
}

.unit-btn {
    padding: 0.5rem 0.75rem;
    border: none;
    background: transparent;
    border-radius: calc(var(--border-radius) - 2px);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #64748b; /* Medium gray for inactive */
}

.unit-btn:hover {
    color: #334155; /* Darker on hover */
}

.unit-btn.active {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    color: #1e293b; /* Dark text for active state */
    font-weight: 600;
}

/* Goal Options */
.goal-options {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.goal-option {
    display: block;
    cursor: pointer;
}

.goal-option input[type="radio"] {
    display: none;
}

.goal-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.goal-option input[type="radio"]:checked + .goal-card {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(93, 95, 239, 0.1);
}

.goal-icon {
    width: 40px;
    height: 40px;
    background: #f3f4f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.goal-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.goal-info p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.calorie-adjustment {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
}

/* Calculation Results */
.calculation-results {
    background: #f0fdf4;
    border: 1px solid #86efac;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.calculation-results h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: #16a34a;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.result-item {
    text-align: center;
}

.result-item.highlight {
    background: white;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.result-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.result-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.result-unit {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
}

/* Macro Presets */
.macro-presets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.macro-preset {
    display: block;
    cursor: pointer;
}

.macro-preset input[type="radio"] {
    display: none;
}

.preset-card {
    padding: 0.75rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
}

.macro-preset input[type="radio"]:checked + .preset-card {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(93, 95, 239, 0.1);
}

.preset-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.macro-breakdown {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.macro-item {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-weight: 500;
}

.macro-item.carbs {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.macro-item.protein {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.macro-item.fat {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.preset-card p {
    font-size: 0.875rem;
    color: var(--text-light);
    margin: 0;
}

/* Custom Macros */
.custom-macros {
    background: #f9fafb;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.macro-total {
    text-align: center;
    font-weight: 600;
    margin-top: 1rem;
}

.macro-total.invalid {
    color: #ef4444;
}

/* Final Summary */
.final-summary {
    background: #f9fafb;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.final-summary h4 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: white;
    border-radius: var(--border-radius);
}

.summary-icon {
    width: 40px;
    height: 40px;
    background: rgba(93, 95, 239, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
}

.summary-details {
    flex: 1;
}

.summary-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
}

.summary-value {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Step Navigation */
.step-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-primary.success {
    background: #22c55e;
}

.btn-primary.success:hover {
    background: #16a34a;
}

.btn-secondary {
    background: white;
    color: var(--text-dark);
    border: 1px solid #e5e7eb;
}

.btn-secondary:hover {
    background: #f9fafb;
}

/* Water Activity Info */
.water-activity-info {
    text-align: center;
    margin-top: 0.5rem;
}

.activity-explanation {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(93, 95, 239, 0.1);
    border-radius: 20px;
    color: var(--primary-color);
    font-size: 0.875rem;
    font-weight: 500;
}

/* Hide divider outside of dropdown menus */
.divider {
    display: none;
}

.dropdown-menu .divider {
    display: block;
    height: 0;
    margin: 0.5rem 0;
    overflow: hidden;
    border-top: 1px solid #e5e7eb;
}

/* Meal Customizer Modal */
.meal-customizer-modal {
    max-width: 600px;
    width: 95%;
}

.template-section {
    margin-bottom: 2rem;
}

.template-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
}

.template-btn {
    padding: 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.template-btn:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.template-btn i {
    font-size: 1.5rem;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.5rem;
}

.template-btn span {
    display: block;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

.template-btn small {
    display: block;
    font-size: 0.75rem;
    color: #6366f1;
}

.current-meals-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

.meal-count {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: normal;
}

.meals-list {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 1rem;
}

.meal-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    cursor: move;
}

.meal-list-item.dragging {
    opacity: 0.5;
}

.drag-handle {
    color: #999;
    cursor: move;
}

.meal-icon-selector {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.meal-icon-selector:hover {
    border-color: var(--primary-color);
}

.meal-info {
    flex: 1;
}

.meal-name-input {
    width: 100%;
    padding: 0.25rem 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
}

.meal-time-input {
    width: 100px;
    padding: 0.25rem 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 0.75rem;
}

.remove-meal-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.remove-meal-btn:hover {
    background: #ef4444;
    color: white;
}

.add-custom-meal-btn {
    width: 100%;
    padding: 0.75rem;
    border: 2px dashed #e5e7eb;
    background: transparent;
    color: var(--primary-color);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: var(--border-radius);
}

.add-custom-meal-btn:hover {
    border-color: var(--primary-color);
    background: rgba(93, 95, 239, 0.05);
}

.customizer-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

/* Meal Planner Modal */
#mealPlannerModal {
    z-index: 10000 !important;
}

.meal-planner-modal {
    max-width: 700px;
    width: 95%;
    background: white !important;
    position: relative !important;
    z-index: 10001 !important;
}

.planner-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.planner-step.active {
    display: block;
}

.preference-form {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.meal-template-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 0.75rem;
}

.template-option {
    display: block;
    cursor: pointer;
}

.template-option input[type="radio"] {
    display: none;
}

.template-option-card {
    padding: 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    text-align: center;
    transition: all 0.3s ease;
}

.template-option-card i {
    font-size: 1.5rem;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.5rem;
}

.template-option-card span {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
}

.template-option-card small {
    display: block;
    font-size: 0.7rem;
    color: var(--text-light);
    line-height: 1.2;
}

.template-option input[type="radio"]:checked + .template-option-card {
    border-color: var(--primary-color);
    background: rgba(93, 95, 239, 0.05);
    box-shadow: 0 0 0 3px rgba(93, 95, 239, 0.1);
}

.complexity-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 0.75rem;
}

.complexity-option {
    display: block;
    cursor: pointer;
}

.complexity-option input[type="radio"] {
    display: none;
}

.complexity-card {
    padding: 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: var(--border-radius);
    text-align: center;
    transition: all 0.3s ease;
}

.complexity-card i {
    font-size: 1.5rem;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.5rem;
}

.complexity-card span {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.complexity-card small {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
}

.complexity-option input[type="radio"]:checked + .complexity-card {
    border-color: var(--primary-color);
    background: rgba(93, 95, 239, 0.05);
    box-shadow: 0 0 0 3px rgba(93, 95, 239, 0.1);
}

.restriction-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.chip-option {
    display: inline-block;
    cursor: pointer;
}

.chip-option input[type="checkbox"] {
    display: none;
}

.chip-option span {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.chip-option input[type="checkbox"]:checked + span {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(93, 95, 239, 0.1);
}

/* Generating Step */
.generating-meals {
    text-align: center;
    padding: 3rem 1rem;
}

.spinner-large {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.spinner-large i {
    animation: spin 1s linear infinite;
}

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

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.generation-progress {
    max-width: 400px;
    margin: 2rem auto 0;
}

.progress-bar {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Preview Step */
.generated-summary {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.summary-stats {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.summary-stats .stat {
    text-align: center;
}

.summary-stats .stat i {
    font-size: 1.5rem;
    color: var(--primary-color);
    display: block;
    margin-bottom: 0.5rem;
}

.summary-stats .stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.summary-stats .stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
}

.generated-meals {
    margin-bottom: 1.5rem;
}

.generated-meal-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

.generated-meal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.generated-meal-header h4 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.generated-meal-header i {
    color: var(--primary-color);
}

.meal-calories {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 600;
}

.meal-macros {
    display: flex;
    gap: 1rem;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}

.meal-macros .macro-item {
    font-size: 0.75rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.meal-macros .macro-item i {
    font-size: 0.875rem;
    color: var(--primary-color);
}

.generated-foods {
    list-style: none;
    padding: 0;
    margin: 0;
}

.generated-foods li {
    padding: 0.25rem 0;
    font-size: 0.875rem;
    display: flex;
    justify-content: space-between;
}

.food-portion {
    color: var(--text-light);
}

.planner-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* Mobile Styles for Meal Planner */
@media (max-width: 768px) {
    .meal-planner-modal {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }
    
    .meal-template-options {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .complexity-options {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .summary-stats {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .summary-stats .stat {
        flex: 1 1 40%;
    }
    
    .planner-actions {
        flex-direction: column;
    }
    
    .planner-actions button {
        width: 100%;
    }
}

/* My Meal Plans Modal */
#mealPlansModal {
    z-index: 10000 !important;
}

.meal-plans-modal {
    max-width: 700px;
    width: 95%;
    background: white !important;
    position: relative !important;
    z-index: 10001 !important;
}

.plans-header {
    margin-bottom: 1.5rem;
}

.plans-description {
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.current-plan-indicator {
    background: #f0fdf4;
    border: 1px solid #86efac;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    color: #16a34a;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.saved-plans-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
}

.plan-card {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    padding: 1rem;
    transition: all 0.3s ease;
}

.plan-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.plan-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 0.75rem;
}

.plan-info h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.plan-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

.plan-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.plan-stat {
    font-size: 0.875rem;
    color: var(--text-light);
}

.plan-stat strong {
    color: var(--text-dark);
}

.plan-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.plan-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.plan-btn.view {
    background: var(--primary-color);
    color: white;
}

.plan-btn.view:hover {
    background: var(--primary-hover);
}

.plan-btn.delete {
    background: #fef2f2;
    color: #ef4444;
    border: 1px solid #fee2e2;
}

.plan-btn.delete:hover {
    background: #fee2e2;
}

.no-plans-message {
    text-align: center;
    padding: 3rem;
}

.no-plans-message i {
    font-size: 3rem;
    color: #e5e7eb;
    margin-bottom: 1rem;
}

.no-plans-message h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.no-plans-message p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

/* Calculator Prompt Modal */
#calculatorPromptModal {
    z-index: 10000 !important;
}

.calculator-prompt-modal {
    max-width: 500px;
    width: 95%;
    background: white !important;
    position: relative !important;
    z-index: 10001 !important;
}

.prompt-content {
    text-align: center;
    padding: 1rem;
}

.prompt-content h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.prompt-content p {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.target-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    text-align: left;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

.target-list li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-dark);
}

.target-list li i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.prompt-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

/* Print Preview Modal */
.print-preview-modal {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
}

.print-controls {
    background: #f9fafb;
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
}

.meal-source-selector,
.saved-plan-selector,
.date-range-selector {
    margin-bottom: 1rem;
}

.meal-source-selector label,
.saved-plan-selector label,
.date-range-selector label {
    font-weight: 600;
    margin-right: 0.5rem;
}

.meal-source-selector select,
.saved-plan-selector select,
.date-range-selector select {
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    min-width: 200px;
}

.custom-date-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.custom-date-range input {
    padding: 0.5rem;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
}

.print-options {
    display: flex;
    gap: 1.5rem;
    margin-top: 1rem;
}

.checkbox-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.checkbox-option input[type="checkbox"] {
    cursor: pointer;
}

.print-preview-container {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    padding: 2rem;
    max-height: 400px;
    overflow-y: auto;
}

.print-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
}

/* Print Styles */
.meal-plan-header {
    text-align: center;
    margin-bottom: 2rem;
}

.meal-plan-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.meal-plan-header p {
    color: var(--text-light);
}

.plan-meta {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 0.5rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.nutrition-targets {
    background: #f9fafb;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.nutrition-targets h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.targets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.target-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    border: 1px solid #e5e7eb;
}

.target-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.target-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.meal-plan-meals {
    margin-bottom: 2rem;
}

.meal-plan-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-radius: var(--border-radius);
}

.meal-plan-item h3 {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.meal-totals {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
    font-size: 0.875rem;
    color: var(--text-light);
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.meal-plan-day {
    margin-bottom: 2rem;
    page-break-inside: avoid;
}

.meal-plan-day h2 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.meal-plan-table {
    width: 100%;
    border-collapse: collapse;
}

.meal-plan-table th,
.meal-plan-table td {
    padding: 0.5rem;
    text-align: left;
    border: 1px solid #e5e7eb;
}

.meal-plan-table th {
    background: #f9fafb;
    font-weight: 600;
}

.meal-plan-table .meal-name {
    font-weight: 600;
    color: var(--primary-color);
}

.food-list {
    margin: 0;
    padding-left: 1.25rem;
}

.food-list li {
    margin-bottom: 0.25rem;
}

.shopping-list {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e5e7eb;
}

.shopping-list h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.shopping-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.shopping-category h3 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.shopping-category ul {
    list-style: none;
    padding-left: 0;
}

.shopping-category li {
    padding: 0.25rem 0;
    padding-left: 1.25rem;
    position: relative;
}

.shopping-category li::before {
    content: "□";
    position: absolute;
    left: 0;
}

@media print {
    body * {
        visibility: hidden;
    }
    
    .print-preview-container,
    .print-preview-container * {
        visibility: visible;
    }
    
    .print-preview-container {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        border: none;
        box-shadow: none;
        max-height: none;
    }
    
    .meal-plan-header {
        page-break-after: avoid;
    }
    
    .meal-plan-day {
        page-break-inside: avoid;
    }
    
    .shopping-list {
        page-break-before: always;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nutrition-main {
        padding: 0.5rem 0;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    /* Nutrition Calculator Modal Mobile Styles */
    .calculator-modal {
        width: 100%;
        max-width: 100%;
        height: 100vh;
        max-height: 100vh;
        margin: 0 !important;
        border-radius: 0;
    }
    
    .calculator-steps {
        padding: 0 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .step-label {
        font-size: 0.7rem;
    }
    
    .calculator-form {
        padding: 0.75rem;
    }
    
    /* Stack form rows on mobile */
    .form-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .form-group.half {
        width: 100%;
    }
    
    /* Larger input fields for better number visibility */
    .calculator-form input[type="number"],
    .calculator-form input[type="text"] {
        font-size: 1rem;
        padding: 0.75rem;
        height: 3rem;
        border: 2px solid #e5e7eb;
        border-radius: var(--border-radius);
        width: 100%;
        -webkit-appearance: none;
        -moz-appearance: textfield;
    }
    
    /* Fix age input specifically */
    #calcAge {
        font-size: 1.1rem;
        font-weight: 500;
        text-align: center;
    }
    
    /* Fix weight input specifically */
    #calcWeight {
        font-size: 1.1rem;
        font-weight: 500;
        text-align: center;
    }
    
    /* Better input focus states */
    .calculator-form input:focus {
        outline: none;
        border-color: var(--primary-color);
        box-shadow: 0 0 0 3px rgba(93, 95, 239, 0.1);
    }
    
    /* Improve gender selection clarity */
    .radio-group.modern {
        gap: 0.5rem;
    }
    
    .radio-option {
        padding: 0.75rem 1rem;
        border-width: 2px;
        position: relative;
        justify-content: center;
    }
    
    .radio-option input[type="radio"]:checked ~ .radio-label {
        color: var(--primary-color);
        font-weight: 600;
    }
    
    .radio-option input[type="radio"]:checked + .radio-custom {
        background: var(--primary-color);
        border-color: var(--primary-color);
    }
    
    /* Add background highlight to selected gender */
    .radio-option:has(input[type="radio"]:checked) {
        background: rgba(93, 95, 239, 0.05);
        border-color: var(--primary-color);
        box-shadow: 0 0 0 2px rgba(93, 95, 239, 0.2);
    }
    
    /* Fallback for browsers without :has support */
    .radio-option input[type="radio"]:checked ~ * {
        color: var(--primary-color);
    }
    
    /* Larger touch targets for unit toggles */
    .unit-toggle {
        padding: 3px;
    }
    
    .unit-btn {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        min-width: 50px;
        touch-action: manipulation;
    }
    
    /* Ensure inputs stay within container */
    .input-with-toggle {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .input-with-toggle input {
        width: 100%;
    }
    
    .unit-toggle {
        width: 100%;
        justify-content: center;
    }
    
    /* Height inputs on mobile */
    #heightImperial {
        width: 100%;
    }
    
    #heightImperial input {
        font-size: 1rem;
        padding: 0.75rem;
        height: 3rem;
    }
    
    /* Stack goal cards vertically */
    .goal-options {
        gap: 0.75rem;
    }
    
    .goal-card {
        padding: 1rem;
    }
    
    /* Step navigation buttons */
    .step-navigation {
        position: sticky;
        bottom: 0;
        background: white;
        padding: 1rem;
        margin: 0 -1rem -1rem;
        border-top: 1px solid #e5e7eb;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
    
    .quick-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.5rem;
    }
    
    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }
    
    .stat-value {
        font-size: 1.125rem;
    }
    
    .macro-section.compact .macro-content {
        flex-direction: column;
        text-align: center;
    }
    
    .macro-chart-small {
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }
    
    #macroChart {
        max-width: 150px;
        max-height: 150px;
    }
    
    .water-glasses {
        flex-wrap: wrap;
        gap: 0.3rem;
    }
    
    .water-glass {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .nutrition-actions {
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .action-btn.compact {
        flex: 1;
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .analytics-modal {
        width: 100%;
    }
    
    .analytics-charts {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        min-width: auto;
    }
    
    .summary-stat {
        padding: 0.75rem;
    }
    
    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .meal-card {
        padding: 0.75rem;
    }
    
    .water-section {
        padding: 0.75rem;
    }
    
    .macro-water-container {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .macro-section,
    .water-section {
        flex: 1;
    }
    
    /* Additional mobile styles for nutrition calculator */
    .calculator-modal .modal-header {
        padding: 1rem;
    }
    
    .calculator-modal .modal-body {
        padding: 1rem;
        padding-bottom: 0;
    }
    
    /* Ensure modal is scrollable on mobile */
    .calculator-modal {
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Fix for small screens */
    .calculator-form .modern-select {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem;
        height: 3rem;
    }
    
    /* Macro presets on mobile */
    .macro-presets {
        grid-template-columns: 1fr;
    }
    
    /* Results grid on mobile */
    .results-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    /* Summary grid on mobile */
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    /* Meal actions on mobile */
    .meal-actions {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    .meal-actions button {
        width: 100%;
        justify-content: center;
    }
}

/* Light Mode Text Visibility Fixes */
body:not([data-theme="dark"]) {
    /* Define CSS variables for light mode */
    --text-dark: #1f2937;
    --text-light: #4b5563;
    --text-muted: #6b7280;
    --background-light: #f9fafb;
    --background-white: #ffffff;
    --border-color: #e5e7eb;
}

/* Ensure proper text contrast in light mode */
body:not([data-theme="dark"]) .page-title,
body:not([data-theme="dark"]) .section-title,
body:not([data-theme="dark"]) h1,
body:not([data-theme="dark"]) h2,
body:not([data-theme="dark"]) h3,
body:not([data-theme="dark"]) h4 {
    color: #1f2937 !important;
}

body:not([data-theme="dark"]) .page-subtitle,
body:not([data-theme="dark"]) .stat-label,
body:not([data-theme="dark"]) .progress-text,
body:not([data-theme="dark"]) .legend-label,
body:not([data-theme="dark"]) .meal-stats,
body:not([data-theme="dark"]) .water-goal,
body:not([data-theme="dark"]) .water-increment,
body:not([data-theme="dark"]) label {
    color: #4b5563 !important;
}

body:not([data-theme="dark"]) .stat-value,
body:not([data-theme="dark"]) .water-amount,
body:not([data-theme="dark"]) .legend-value,
body:not([data-theme="dark"]) .meal-calories {
    color: #1f2937 !important;
}

/* Fix analytics modal text */
body:not([data-theme="dark"]) .analytics-modal .stat-label,
body:not([data-theme="dark"]) .analytics-modal .summary-label,
body:not([data-theme="dark"]) .tab-btn {
    color: #6b7280 !important;
}

body:not([data-theme="dark"]) .analytics-modal .stat-value,
body:not([data-theme="dark"]) .analytics-modal .summary-value,
body:not([data-theme="dark"]) .tab-btn.active {
    color: #1f2937 !important;
}

/* Fix chart text colors */
body:not([data-theme="dark"]) .chart-container h3 {
    color: #1f2937 !important;
}

/* Fix meal card text */
body:not([data-theme="dark"]) .meal-title,
body:not([data-theme="dark"]) .food-name {
    color: #1f2937 !important;
}

body:not([data-theme="dark"]) .food-macros,
body:not([data-theme="dark"]) .empty-meal,
body:not([data-theme="dark"]) .food-info {
    color: #6b7280 !important;
}

/* Fix button text contrast */
body:not([data-theme="dark"]) .date-nav-btn {
    color: #1f2937 !important;
    background: #ffffff !important;
}

body:not([data-theme="dark"]) .current-date {
    color: #1f2937 !important;
}

/* Fix modal backgrounds and text */
body:not([data-theme="dark"]) .modal-content {
    background: #ffffff !important;
}

body:not([data-theme="dark"]) .modal-title {
    color: #1f2937 !important;
}

/* Fix input and form text */
body:not([data-theme="dark"]) input,
body:not([data-theme="dark"]) select,
body:not([data-theme="dark"]) textarea {
    color: #1f2937 !important;
    background: #ffffff !important;
    border-color: #e5e7eb !important;
}

body:not([data-theme="dark"]) input::placeholder,
body:not([data-theme="dark"]) textarea::placeholder {
    color: #9ca3af !important;
}

/* Fix activity analytics section if present */
body:not([data-theme="dark"]) .activity-analytics-section h3,
body:not([data-theme="dark"]) .activity-title {
    color: #1f2937 !important;
}

body:not([data-theme="dark"]) .activity-label,
body:not([data-theme="dark"]) .distribution-text {
    color: #4b5563 !important;
}

/* Fix macro legend colors */
body:not([data-theme="dark"]) .macro-legend .legend-item {
    color: #1f2937 !important;
}

/* Fix quick edit and calculator modal text */
body:not([data-theme="dark"]) .quick-edit-modal label,
body:not([data-theme="dark"]) .calculator-modal label,
body:not([data-theme="dark"]) .step-label,
body:not([data-theme="dark"]) .step-description {
    color: #4b5563 !important;
}

body:not([data-theme="dark"]) .step-number {
    color: #6b7280 !important;
}

body:not([data-theme="dark"]) .step.active .step-number {
    color: #ffffff !important;
}

body:not([data-theme="dark"]) .step.active .step-label {
    color: #5d5fef !important;
}

/* Fix nutrition calculator text */
body:not([data-theme="dark"]) .goal-card h3,
body:not([data-theme="dark"]) .preset-card h4,
body:not([data-theme="dark"]) .summary-label {
    color: #1f2937 !important;
}

body:not([data-theme="dark"]) .goal-card p,
body:not([data-theme="dark"]) .preset-card p {
    color: #6b7280 !important;
}

/* Fix water section text */
body:not([data-theme="dark"]) .water-section h2 {
    color: #1f2937 !important;
}

body:not([data-theme="dark"]) .activity-explanation {
    color: #6b7280 !important;
}

/* Ensure all headings in light mode are dark */
body:not([data-theme="dark"]) .nutrition-main h1,
body:not([data-theme="dark"]) .nutrition-main h2,
body:not([data-theme="dark"]) .nutrition-main h3,
body:not([data-theme="dark"]) .nutrition-main h4,
body:not([data-theme="dark"]) .nutrition-main h5,
body:not([data-theme="dark"]) .nutrition-main h6 {
    color: #1f2937 !important;
}

/* Fix any "Today's Activity" text */
body:not([data-theme="dark"]) .todays-activity-title,
body:not([data-theme="dark"]) .activity-section-title {
    color: #1f2937 !important;
}

/* Fix muscle group distribution text */
body:not([data-theme="dark"]) .muscle-group-label,
body:not([data-theme="dark"]) .distribution-label,
body:not([data-theme="dark"]) .muscle-distribution-text {
    color: #4b5563 !important;
}

/* Ensure stat card backgrounds remain light in light mode */
body:not([data-theme="dark"]) .stat-card {
    background: #ffffff !important;
    border: 1px solid #e5e7eb;
}

/* Fix summary card text in analytics */
body:not([data-theme="dark"]) .summary-card {
    background: #f9fafb !important;
    color: #1f2937 !important;
}

body:not([data-theme="dark"]) .summary-card h4 {
    color: #4b5563 !important;
}

/* Fix meal customizer text */
body:not([data-theme="dark"]) .template-btn span,
body:not([data-theme="dark"]) .meal-count {
    color: #1f2937 !important;
}

body:not([data-theme="dark"]) .template-btn small {
    color: #6b7280 !important;
}