/**
 * Gezondheidstracker - Modern Mobile-First Stylesheet
 * Optimized for iPhone 16 Pro Max (430px × 932px) and desktop
 */

/* ===== CSS Variables ===== */
:root {
    --primary-color: #10B981;
    --primary-hover: #059669;
    --secondary-color: #3B82F6;
    --background: #F9FAFB;
    --card-bg: #FFFFFF;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --border-color: #E5E7EB;
    --error-color: #EF4444;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    
    --safe-area-top: env(safe-area-inset-top);
    --safe-area-bottom: env(safe-area-inset-bottom);
}

/* ===== Reset & Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.5;
    overflow-x: hidden;
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 8px;
}



.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== Forms ===== */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: all 0.2s;
    background: var(--card-bg);
    color: var(--text-primary);
}

.form-group select {
    cursor: pointer;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group textarea {
    resize: vertical;
    font-family: inherit;
}

.form-group textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    min-height: 44px; /* Touch-friendly */
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-primary:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--background);
    border-color: var(--primary-color);
}

.btn-small {
    padding: 8px 16px;
    font-size: 14px;
    min-height: 36px;
}

.btn-block {
    width: 100%;
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 20px;
    text-decoration: none;
    transition: background 0.2s;
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.back-btn {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
}

/* ===== Messages ===== */
.error-message,
.success-message {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-top: 12px;
}

.error-message {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.success-message {
    background: #D1FAE5;
    color: #065F46;
    border: 1px solid #6EE7B7;
}

/* ===== App Container ===== */
.app-container {
    min-height: 100vh;
    padding-bottom: calc(20px + var(--safe-area-bottom));
}

/* ===== Unified Modern Header ===== */
.unified-header {
    background: linear-gradient(135deg, #10B981 0%, #0D9488 50%, #0891B2 100%);
    padding: 16px 20px;
    padding-top: calc(16px + var(--safe-area-top));
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}

.unified-header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
}

/* Brand Section */
.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.header-brand h1 {
    font-size: 22px;
    font-weight: 700;
    color: white;
    letter-spacing: -0.5px;
    margin: 0;
}

/* Date Navigation Section */
.header-date-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.nav-arrow-glass {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
}

.nav-arrow-glass:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-arrow-glass:active:not(:disabled) {
    transform: scale(0.95);
}

.date-display-unified {
    text-align: center;
    color: white;
    min-width: 280px;
}

.today-badge-unified {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.back-to-today-unified {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 4px;
}

.back-to-today-unified:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.current-date-unified {
    font-size: 16px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    letter-spacing: 0.3px;
}

/* Actions Section */
.header-actions {
    display: flex;
    gap: 8px;
}

.icon-btn-glass {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s;
    text-decoration: none;
}

.icon-btn-glass:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.icon-btn-glass:active {
    transform: translateY(0);
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .unified-header {
        padding: 8px 12px;
        padding-top: calc(8px + var(--safe-area-top));
    }
    
    .unified-header-content {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        gap: 8px;
        align-items: center;
    }
    
    /* Show compact brand/logo on mobile - spans full width */
    .header-brand {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }
    
    .brand-icon {
        font-size: 16px;
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    }
    
    .header-brand h1 {
        font-size: 13px;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.95);
        letter-spacing: 0.5px;
        text-transform: uppercase;
    }
    
    /* Login page mobile styles */
    .login-title {
        gap: 4px;
    }
    
    
    
    .login-header h1 {
        font-size: 24px;
    }
    
    /* Date nav takes left space */
    .header-date-nav {
        grid-column: 1;
        grid-row: 2;
        display: flex;
        align-items: center;
        gap: 6px;
    }
    
    /* Actions on the right */
    .header-actions {
        grid-column: 2;
        grid-row: 2;
        display: flex;
        gap: 6px;
        flex-shrink: 0;
    }
    
    .nav-btn-unified {
        width: 40px;
        height: 40px;
        padding: 0;
        flex-shrink: 0;
    }
    
    .date-display-unified {
        flex: 1;
        min-width: 0;
        padding: 6px 10px;
    }
    
    .current-date-unified {
        font-size: 12px;
        line-height: 1.3;
    }
    
    .today-label-unified {
        font-size: 10px;
        padding: 2px 8px;
    }
    
    .icon-btn-glass {
        width: 40px;
        height: 40px;
        padding: 0;
    }
    
    .icon-btn-glass svg {
        width: 18px;
        height: 18px;
    }
}

/* ===== Metrics Bar ===== */
.metrics-bar {
    display: flex;
    gap: 12px;
    padding: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--background);
}

.metrics-bar::-webkit-scrollbar {
    display: none;
}

/* Hide vitamins card on mobile */
@media (max-width: 430px) {
    #vitaminsCard {
        display: none;
    }
}

.metric-card {
    min-width: 140px;
    background: white;
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    animation: slideInCard 0.5s ease-out backwards;
}

/* Stagger animation for metric cards */
.metric-card:nth-child(1) { animation-delay: 0.05s; }
.metric-card:nth-child(2) { animation-delay: 0.1s; }
.metric-card:nth-child(3) { animation-delay: 0.15s; }
.metric-card:nth-child(4) { animation-delay: 0.2s; }
.metric-card:nth-child(5) { animation-delay: 0.25s; }
.metric-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes slideInCard {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.metric-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}

.metric-card-clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card-clickable:active {
    transform: scale(0.98);
}

.metric-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.metric-percentage {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
}

.metric-value {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 8px;
}

.metric-value .current {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.metric-value .divider {
    font-size: 14px;
    color: var(--text-light);
}

.metric-value .goal {
    font-size: 14px;
    color: var(--text-secondary);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: #E5E7EB;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease, background 0.3s ease;
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmerSubtle 3s infinite;
}

@keyframes shimmerSubtle {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(200%); }
}

.progress-fill.progress-danger {
    background: linear-gradient(135deg, #F87171 0%, #EF4444 100%);
}

.progress-fill.progress-warning {
    background: linear-gradient(135deg, #FBBF24 0%, #F59E0B 100%);
}

.progress-fill.progress-good {
    background: linear-gradient(135deg, #10B981 0%, #0891B2 100%);
}

.metric-icon {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.status-indicator {
    font-size: 20px;
}

.micronutrients-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    gap: 4px;
}

.micronutrients-icon {
    font-size: 32px;
    line-height: 1;
}

.micronutrients-hint {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.status-good { color: var(--success-color); }
.status-warning { color: var(--warning-color); }
.status-bad { color: var(--error-color); }

.tap-hint {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 400;
}

/* ===== Sections ===== */
.chat-section,
.meals-section,
.settings-container {
    padding: 20px;
}

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

.section-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.date-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--background);
    padding: 4px 12px;
    border-radius: 20px;
}

/* ===== Modern Meal Input Card ===== */
.modern-meal-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s;
}

.modern-meal-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}

.meal-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.meal-header-icon {
    font-size: 32px;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10B981 0%, #0891B2 100%);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.meal-header-text h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.meal-header-text p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
}

.modern-meal-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modern-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.modern-textarea {
    width: 100%;
    min-height: 100px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: 14px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.6;
    resize: vertical;
    transition: all 0.3s;
    background: white;
    color: var(--text-primary);
}

.modern-textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.modern-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
    background: white;
}

.input-actions-modern {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-modern-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: white;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-modern-icon:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(16, 185, 129, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-modern-icon:active {
    transform: translateY(0);
}

.btn-modern-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    padding: 14px 24px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    min-height: 50px;
}

.btn-modern-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.btn-modern-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-modern-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.modern-message {
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    margin-top: 12px;
    animation: slideIn 0.3s ease;
}

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

/* ===== Loading & Success Animations ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.loading-card {
    background: white;
    border-radius: 20px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 280px;
    animation: scaleIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    position: relative;
}

.spinner-circle {
    width: 100%;
    height: 100%;
    border: 4px solid #E5E7EB;
    border-top-color: #10B981;
    border-radius: 50%;
    animation: spin 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

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

.loading-progress {
    width: 100%;
    height: 8px;
    background: #E5E7EB;
    border-radius: 10px;
    overflow: hidden;
    margin: 20px 0;
}

.loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #0891B2);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
    overflow: hidden;
}

.loading-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.loading-text {
    font-size: 16px;
    font-weight: 600;
    color: #1F2937;
    margin-bottom: 8px;
}

.loading-subtext {
    font-size: 14px;
    color: #6B7280;
}

/* Success Animation */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(16, 185, 129, 0.95);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.success-card {
    background: white;
    border-radius: 24px;
    padding: 48px 32px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3);
    text-align: center;
    min-width: 300px;
    animation: successBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successBounce {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(-10deg);
    }
    50% {
        transform: scale(1.05) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.success-checkmark {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #10B981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: checkmarkPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
}

@keyframes checkmarkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-checkmark svg {
    width: 48px;
    height: 48px;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: drawCheck 0.6s ease 0.4s forwards;
}

@keyframes drawCheck {
    to { stroke-dashoffset: 0; }
}

.success-title {
    font-size: 24px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 12px;
}

.success-message {
    font-size: 16px;
    color: #6B7280;
    margin-bottom: 8px;
}

.success-details {
    font-size: 14px;
    color: #10B981;
    font-weight: 600;
}

/* Confetti Animation */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background: #10B981;
    position: absolute;
    animation: confettiFall 3s ease-out forwards;
}

@keyframes confettiFall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Meal Card Entrance Animation */
.meal-card-new {
    animation: mealSlideIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes mealSlideIn {
    0% {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.error-modern {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    color: #991B1B;
    border: 1px solid #FCA5A5;
}

.success-modern {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    color: #065F46;
    border: 1px solid #6EE7B7;
}

/* Responsive */
@media (max-width: 768px) {
    .modern-meal-card {
        padding: 16px;
    }
    
    .meal-header-icon {
        font-size: 28px;
        width: 48px;
        height: 48px;
    }
    
    .meal-header-text h2 {
        font-size: 20px;
    }
    
    .input-actions-modern {
        display: grid;
        grid-template-columns: auto 1fr;
        gap: 10px;
    }
    
    .btn-modern-icon {
        padding: 0;
        font-size: 0;
        min-width: 52px;
        width: 52px;
        height: 52px;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
    }
    
    .btn-modern-icon svg {
        width: 24px;
        height: 24px;
        display: block;
        margin: 0 auto;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
    
    .btn-modern-primary {
        width: 100%;
        padding: 12px 20px;
        font-size: 15px;
        min-height: 48px;
    }
}

/* ===== Meals List ===== */
.meals-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    text-align: center;
    padding: 48px 20px;
    background: white;
    border-radius: var(--radius-md);
    border: 2px dashed var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.empty-state p {
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 15px;
}

.empty-hint {
    font-size: 14px;
    color: var(--text-light);
    line-height: 1.6;
}

.meal-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid var(--border-color);
}

.meal-card.clickable {
    cursor: pointer;
}

.meal-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border-color: rgba(16, 185, 129, 0.2);
}

.meal-card.clickable:active {
    transform: translateY(0);
}

.meal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.meal-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.meal-time {
    font-size: 13px;
    color: var(--text-secondary);
    margin-right: 8px;
}

.meal-type-badge {
    display: inline-block;
    padding: 2px 8px;
    background: var(--primary-color);
    color: white;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

.meal-actions {
    display: flex;
    gap: 8px;
}

.edit-meal-btn,
.delete-meal-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.edit-meal-btn:hover,
.delete-meal-btn:hover {
    transform: scale(1.1);
}

.edit-meal-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3B82F6;
}

.delete-meal-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.meal-ingredients {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.ingredient-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
}

.ingredient-name {
    color: var(--text-primary);
}

.ingredient-amount {
    color: var(--text-secondary);
    font-weight: 500;
}

.estimated-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 2px 6px;
    background: var(--warning-color);
    color: white;
    font-size: 10px;
    font-weight: 700;
    border-radius: 3px;
    vertical-align: middle;
}

/* ===== Hierarchical Dishes Display ===== */
.meal-dishes {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.dish-item {
    background: rgba(16, 185, 129, 0.03);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    border-left: 3px solid var(--primary-color);
}

.dish-item.collapsible {
    cursor: pointer;
}

.dish-header {
    cursor: pointer;
    user-select: none;
    padding: 8px 12px;
    margin: -8px -12px 0 -12px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.dish-header:hover {
    background-color: rgba(76, 175, 80, 0.05);
}

.dish-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--primary-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dish-toggle {
    font-size: 14px;
    transition: transform 0.2s ease;
    display: inline-block;
    width: 20px;
    margin-right: 8px;
}

.dish-count {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-light);
    margin-left: 4px;
}

.dish-ingredients {
    padding-left: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.3s ease;
}

.dish-ingredients.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    margin-bottom: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.dish-ingredients.expanded {
    max-height: 1000px;
    opacity: 1;
    margin-top: 8px;
}

.dish-ingredients .ingredient-item {
    font-size: 13px;
}

.dish-ingredients .ingredient-name {
    color: var(--text-secondary);
}

.meal-totals {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ===== Modal ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-content.modal-large {
    max-width: 700px;
}

@media (max-width: 768px) {
    .modal-content {
        max-height: 95vh;
        margin: 10px;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-light);
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

@media (max-width: 768px) {
    .modal-body {
        padding: 16px;
    }
}

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

.nutrient-item {
    background: var(--background);
    padding: 12px;
    border-radius: var(--radius-sm);
}

.nutrient-item-name {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.nutrient-item-value {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.nutrient-item-goal {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.nutrient-item-bar {
    width: 100%;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}

.nutrient-item-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.nutrient-item-bar-fill.progress-danger {
    background: var(--error-color) !important;
}

.nutrient-item-bar-fill.progress-warning {
    background: var(--warning-color) !important;
}

.nutrient-item-bar-fill.progress-good {
    background: var(--primary-color) !important;
}

/* Meal Details Specific */
.meal-details-section {
    margin-bottom: 24px;
}

.meal-details-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.meal-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.meal-detail-item {
    background: var(--background);
    padding: 12px;
    border-radius: var(--radius-sm);
    text-align: center;
}

.meal-detail-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.meal-detail-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.ingredient-detail-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ingredient-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--background);
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.ingredient-detail-item.clickable {
    cursor: pointer;
}

.ingredient-detail-item.clickable:hover {
    background: var(--border-color);
}

.expand-icon {
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.2s;
}

.ingredient-nutrients {
    margin-top: 8px;
    margin-bottom: 8px;
    border-left: 3px solid var(--primary-color);
    animation: slideDown 0.2s ease;
}

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

.ingredient-nutrients-content {
    padding: 12px;
    background: #FAFBFC;
    border-radius: var(--radius-sm);
    margin-left: 12px;
}

.nutrient-section {
    margin-bottom: 12px;
}

.nutrient-section:last-child {
    margin-bottom: 0;
}

.nutrient-section strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-size: 13px;
}

.nutrient-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ===== Edit Meal Modal ===== */
.edit-meal-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 16px;
    transition: all 0.2s;
    background: var(--card-bg);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.edit-ingredients-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 300px;
    overflow-y: auto;
}

/* Legacy compatibility - redirect to new classes */
.edit-ingredient-item-compact {
    /* Replaced by .edit-ingredient-card */
}

.ing-name-row {
    /* Replaced by .edit-ingredient-header */
}

.remove-btn-compact {
    /* Replaced by .remove-ingredient-btn */
}

.unit-controls,
.gram-controls {
    /* Replaced by .edit-control-group */
}

.unit-label,
.gram-label {
    /* Replaced by .edit-control-label */
    display: block;
    margin-bottom: 8px;
}

/* Removed old quick-select and mini-btn styles - replaced by modern edit-stepper */

.stepper-btn-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stepper-btn-small:hover {
    background: var(--background);
    border-color: var(--primary-color);
}

.remove-ingredient-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--error-color);
    background: var(--card-bg);
    color: var(--error-color);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.remove-ingredient-btn:hover {
    background: var(--error-color);
    color: white;
}

.add-ingredient-controls {
    position: relative;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    margin-top: 4px;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    z-index: 100;
}

.search-result-item {
    padding: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background: var(--background);
}

.search-result-item strong {
    font-size: 14px;
    color: var(--text-primary);
}

.search-result-item span {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===== Settings ===== */
.settings-section {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.settings-section h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-description {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 20px;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.input-with-stepper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-with-stepper input {
    flex: 1;
    text-align: center;
}

.stepper-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.stepper-btn:active {
    transform: scale(0.95);
}

/* ===== Nutrients Management ===== */
.nutrients-management {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.nutrient-category h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.toggle-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toggle-item {
    display: flex;
    align-items: center;
}

.toggle-item label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    flex: 1;
    padding: 8px 0;
}

.toggle-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.toggle-item span {
    font-size: 14px;
    color: var(--text-primary);
}

.settings-note {
    margin-top: 16px;
    padding: 12px;
    background: var(--background);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-secondary);
}

.info-banner {
    background: #DBEAFE;
    color: #1E40AF;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    border: 1px solid #93C5FD;
    font-size: 14px;
}

.profile-preview {
    background: var(--background);
    padding: 20px;
    border-radius: var(--radius-sm);
}

.profile-preview h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.profile-preview ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.profile-preview li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.profile-preview li:last-child {
    border-bottom: none;
}

.profile-preview li:before {
    content: "⏳ ";
    margin-right: 8px;
}

/* ===== Loaders ===== */
.btn-loader {
    display: none;
    animation: spin 1s linear infinite;
}

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

/* ===== Responsive - Desktop ===== */
@media (min-width: 768px) {
    .app-container {
        max-width: 1200px;
        margin: 0 auto;
    }
    
    .metrics-bar {
        flex-wrap: wrap;
        overflow-x: visible;
    }
    
    .metric-card {
        flex: 1;
        min-width: 180px;
    }
    
    .meals-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 16px;
    }
    
    .settings-container {
        max-width: 800px;
        margin: 0 auto;
    }
}

@media (min-width: 1024px) {
    .login-card {
        padding: 48px;
    }
    
    .app-header h1 {
        font-size: 24px;
    }
}

/* ===== Modern Settings Page ===== */
.header-back-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s;
    font-weight: 600;
}

.header-back-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-4px);
}

.header-center {
    text-align: center;
}

.header-center h1 {
    font-size: 22px;
    font-weight: 700;
    color: white;
    margin: 0;
}

.settings-tabs-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

/* Tab Navigation */
.tabs-navigation {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: white;
    padding: 6px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.tab-btn svg {
    transition: all 0.3s;
}

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

.tab-btn.active {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.tab-btn.active svg {
    stroke: white;
}

/* Tab Content */
.tabs-content {
    position: relative;
}

.tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* Settings Card */
.settings-card {
    background: white;
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-color);
}

.card-header-modern {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--background);
}

.card-header-icon {
    font-size: 40px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #10B981 0%, #0891B2 100%);
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.card-header-modern h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px 0;
}

.card-header-modern p {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

/* Modern Form */
.modern-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-group-modern {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group-modern.full-width {
    grid-column: 1 / -1;
}

.form-group-modern label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.input-modern {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    background: white;
    transition: all 0.3s;
}

.input-modern:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.input-modern::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.input-with-stepper-modern {
    display: flex;
    align-items: center;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
}

.input-with-stepper-modern:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.input-with-stepper-modern input {
    flex: 1;
    border: none;
    padding: 12px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    outline: none;
    color: var(--text-primary);
    background: transparent;
}

.input-unit {
    padding: 0 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

.stepper-btn-modern {
    background: var(--background);
    border: none;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary-color);
    transition: all 0.2s;
    min-width: 48px;
}

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

.stepper-btn-modern:active {
    transform: scale(0.95);
}

.modern-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.modern-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* ===== Edit Ingredients Modern ===== */
.edit-ingredients-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding: 4px;
}

/* Add Ingredients Collapsible Section */
.add-ingredients-wrapper {
    margin-top: 20px;
}

.add-ingredients-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s;
}

.add-ingredients-toggle:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(8, 145, 178, 0.05) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.add-ingredients-toggle .toggle-icon {
    color: var(--primary-color);
    flex-shrink: 0;
}

.add-ingredients-toggle .chevron-icon {
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: transform 0.3s;
}

.add-ingredients-toggle.active .chevron-icon {
    transform: rotate(180deg);
}

.add-ingredients-content {
    margin-top: 12px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.03) 0%, rgba(8, 145, 178, 0.03) 100%);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    animation: slideDown 0.3s ease;
}

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

.add-ingredients-content .modern-textarea {
    margin-bottom: 12px;
}

.btn-add-confirm {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-add-confirm:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.btn-add-confirm:active {
    transform: translateY(0);
}

.btn-icon {
    font-size: 20px;
    font-weight: 700;
}

.add-ingredient-status {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    animation: slideIn 0.3s ease;
}

.add-ingredient-status:empty {
    display: none;
}

.add-ingredient-status.success {
    background: linear-gradient(135deg, #D1FAE5 0%, #A7F3D0 100%);
    color: #065F46;
    border: 2px solid #6EE7B7;
}

.add-ingredient-status.error {
    background: linear-gradient(135deg, #FEE2E2 0%, #FECACA 100%);
    color: #991B1B;
    border: 2px solid #FCA5A5;
}

.add-ingredient-status.loading {
    background: linear-gradient(135deg, #E0F2FE 0%, #BAE6FD 100%);
    color: #075985;
    border: 2px solid #7DD3FC;
}

/* Modal Actions Modern */
.modal-actions-modern {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 2px solid var(--border-color);
    background: var(--card-bg);
    flex-shrink: 0;
}

.btn-modal-secondary,
.btn-modal-primary {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
}

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

.btn-modal-secondary:hover {
    border-color: var(--error-color);
    color: var(--error-color);
    background: rgba(239, 68, 68, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.15);
}

.btn-modal-secondary svg {
    width: 18px;
    height: 18px;
}

.btn-modal-primary {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

.btn-modal-primary:hover {
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    transform: translateY(-2px);
}

.btn-modal-primary:active,
.btn-modal-secondary:active {
    transform: translateY(0);
}

.btn-modal-primary svg {
    width: 18px;
    height: 18px;
}

.btn-modal-primary .btn-loader {
    display: none;
}

.btn-modal-primary.loading .btn-text {
    display: none;
}

.btn-modal-primary.loading .btn-loader {
    display: inline;
}

/* Responsive Modal Actions */
@media (max-width: 768px) {
    .modal-actions-modern {
        gap: 10px;
        padding: 16px;
    }
    
    .btn-modal-secondary,
    .btn-modal-primary {
        padding: 12px 20px;
        font-size: 15px;
    }
}

.edit-ingredient-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s;
}

.edit-ingredient-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.edit-ingredient-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.remove-ingredient-btn {
    background: rgba(239, 68, 68, 0.1);
    border: none;
    border-radius: 8px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #EF4444;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.2s;
}

.remove-ingredient-btn:hover {
    background: #EF4444;
    color: white;
    transform: scale(1.1);
}

.edit-ingredient-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

@media (max-width: 768px) {
    .edit-ingredient-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .edit-ingredient-card {
        padding: 12px;
    }
    
    .edit-control-group {
        width: 100%;
    }
}

.edit-control-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.edit-control-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edit-stepper {
    display: flex;
    align-items: center;
    background: var(--background);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
}

.edit-stepper-btn {
    background: transparent;
    border: none;
    padding: 10px 12px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    color: var(--primary-color);
    transition: all 0.2s;
    min-width: 40px;
}

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

.edit-stepper-btn:active {
    transform: scale(0.95);
}

.edit-stepper-input {
    flex: 1;
    border: none;
    padding: 10px 8px;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    outline: none;
    color: var(--text-primary);
    background: transparent;
    width: 60px;
    max-width: 80px;
}

.edit-stepper-unit {
    padding: 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Button Group Modern */
.button-group-modern {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-modern-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    background: white;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-block-modern {
    width: 100%;
}

/* Info Banner Modern */
.info-banner-modern {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(147, 197, 253, 0.05) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 12px;
    color: #1E40AF;
    font-size: 14px;
    line-height: 1.6;
}

.info-banner-modern svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Nutrients Grid Modern */
.nutrients-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.nutrient-category-modern h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.toggle-list-modern {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toggle-item-modern {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-primary);
}

.toggle-item-modern:hover {
    background: var(--background);
}

.modern-checkbox {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.modern-checkbox:checked + .checkbox-custom {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%);
    border-color: var(--primary-color);
}

.modern-checkbox:checked + .checkbox-custom::after {
    content: '✓';
    color: white;
    font-weight: 700;
    font-size: 14px;
}

/* Toast Notification */
.toast-notification {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    color: white;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    z-index: 10000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-notification.show {
    transform: translateX(-50%) translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .settings-tabs-container {
        padding: 12px;
    }
    
    .tabs-navigation {
        flex-direction: column;
        gap: 6px;
    }
    
    .tab-btn {
        padding: 14px;
        justify-content: flex-start;
    }
    
    .tab-btn span {
        display: inline;
    }
    
    .settings-card {
        padding: 16px;
    }
    
    .card-header-modern {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .card-header-icon {
        width: 56px;
        height: 56px;
        font-size: 32px;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .button-group-modern {
        flex-direction: column;
    }
    
    .button-group-modern button {
        width: 100%;
    }
    
    .nutrients-grid-modern {
        grid-template-columns: 1fr;
    }
}

/* ===== App Transitions ===== */
.page-transition {
    animation: fadeInUp 0.4s ease-out;
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Period Switcher ===== */
.period-switcher {
    display: flex;
    gap: 8px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.period-tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.period-tab::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.period-tab:active::before {
    width: 300px;
    height: 300px;
}

.period-tab:hover {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.period-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    animation: tabActivate 0.3s ease-out;
}

@keyframes tabActivate {
    0% {
        transform: scale(0.95);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

.period-tab.active:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

/* ===== Analytics Section Compact ===== */
.analytics-section-compact {
    margin: 12px auto 0;
    max-width: 1400px;
    padding: 0 16px;
}

.analytics-toggle-compact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.analytics-toggle-compact:hover {
    background: var(--background);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.analytics-toggle-compact svg {
    flex-shrink: 0;
    stroke: currentColor;
}

.analytics-toggle-compact .chevron-icon {
    transition: transform 0.2s ease;
}

.analytics-toggle-compact.active {
    background: var(--background);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.analytics-toggle-compact.active .chevron-icon {
    transform: rotate(180deg);
}

.analytics-content {
    margin-top: 12px;
    padding: 16px;
    background: white;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    animation: slideDown 0.2s ease;
}

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

/* ===== Statistics Grid ===== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    padding: 12px;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
    transition: all 0.2s ease;
}

.stat-card:hover {
    border-color: var(--primary-color);
}

.stat-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.stat-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card-micro {
    border: 2px solid var(--primary-color);
    background: rgba(16, 185, 129, 0.05);
}

/* ===== Charts Section ===== */
.charts-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.chart-wrapper {
    background: var(--background);
    border-radius: 8px;
    padding: 16px;
    border: 1px solid var(--border-color);
}

.chart-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.chart-container {
    position: relative;
    height: 250px;
}

.chart-container canvas {
    max-height: 100%;
}

/* ===== Day Summary Cards ===== */
.day-summaries-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.day-summary-card {
    padding: 20px;
    background: white;
    border-radius: var(--radius-lg);
    border: 2px solid var(--border-color);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideInCard 0.4s ease-out backwards;
}

/* Stagger animation for day cards */
.day-summary-card:nth-child(1) { animation-delay: 0.05s; }
.day-summary-card:nth-child(2) { animation-delay: 0.1s; }
.day-summary-card:nth-child(3) { animation-delay: 0.15s; }
.day-summary-card:nth-child(4) { animation-delay: 0.2s; }
.day-summary-card:nth-child(5) { animation-delay: 0.25s; }
.day-summary-card:nth-child(6) { animation-delay: 0.3s; }
.day-summary-card:nth-child(7) { animation-delay: 0.35s; }
.day-summary-card:nth-child(8) { animation-delay: 0.4s; }
.day-summary-card:nth-child(9) { animation-delay: 0.45s; }
.day-summary-card:nth-child(10) { animation-delay: 0.5s; }

.day-summary-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    border-color: var(--primary-color);
}

.day-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.day-summary-date {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.day-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: capitalize;
}

.day-number {
    font-size: 12px;
    color: var(--text-secondary);
}

.day-summary-percentage {
    font-size: 20px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 8px;
}

.day-summary-percentage.progress-good {
    color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.day-summary-percentage.progress-warning {
    color: var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
}

.day-summary-percentage.progress-danger {
    color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
}

.day-summary-metrics {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px 12px;
    margin-bottom: 12px;
}

.day-metric {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.day-metric-calories {
    grid-column: 1 / -1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.metric-label-short {
    font-weight: 600;
    color: var(--text-primary);
}

.day-summary-progress {
    margin-top: 12px;
}

.progress-bar-mini {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar-mini .progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ===== Floating Action Button (FAB) ===== */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
    cursor: pointer;
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 8px 24px rgba(16, 185, 129, 0.6);
}

.fab:active {
    transform: scale(0.95);
}

.fab svg {
    width: 28px;
    height: 28px;
    stroke: white;
    stroke-width: 3;
    transition: transform 0.3s ease;
}

.fab.hidden {
    transform: translateY(100px) scale(0);
    opacity: 0;
}

/* ===== Pull to Refresh ===== */
.pull-to-refresh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    z-index: 998;
}

.pull-to-refresh.visible {
    transform: translateY(0);
}

.pull-to-refresh-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* ===== Streak Counter (Compact Badge) ===== */
.streak-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 107, 107, 0.15);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.streak-badge:hover {
    background: rgba(255, 107, 107, 0.25);
    transform: scale(1.05);
}

.streak-badge-flame {
    font-size: 16px;
    filter: drop-shadow(0 0 4px rgba(255, 107, 107, 0.5));
}

.streak-badge-count {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: linear-gradient(135deg, #FF6B6B, #FF8E53);
    border-radius: 9px;
    color: white;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.4);
    animation: bounceIn 0.5s ease-out;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ===== Sparklines (Only for Week/Month) ===== */
.metric-sparkline {
    width: 100%;
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sparkline-label {
    font-size: 9px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.sparkline-canvas {
    width: 100%;
    height: 28px;
}

/* ===== Toast Notifications ===== */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast.info {
    border-left: 4px solid var(--secondary-color);
}

.toast-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== Ripple Effect ===== */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s, opacity 0.6s;
    opacity: 0;
}

.ripple:active::after {
    width: 300px;
    height: 300px;
    opacity: 1;
    transition: 0s;
}

/* ===== Skeleton Loaders ===== */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-metrics {
    height: 120px;
    border-radius: var(--radius-lg);
}

.skeleton-chart {
    height: 300px;
    border-radius: var(--radius-md);
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .stat-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .stat-card-micro {
        grid-column: 2 / 3;
    }
}

@media (max-width: 768px) {
    .period-switcher {
        width: 100%;
        justify-content: center;
    }
    
    .period-tab {
        flex: 1;
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .stat-card {
        padding: 10px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .analytics-content {
        padding: 12px;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .day-summaries-list {
        grid-template-columns: 1fr;
    }
    
    .analytics-toggle-compact {
        font-size: 12px;
        padding: 5px 10px;
    }
    
    /* Mobile adjustments for new features */
    .fab {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
    
    .streak-badge {
        width: 28px;
        height: 28px;
    }
    
    .streak-badge-flame {
        font-size: 14px;
    }
    
    .streak-badge-count {
        min-width: 16px;
        height: 16px;
        font-size: 9px;
    }
    
    .toast {
        bottom: 80px;
        min-width: 280px;
        margin: 0 16px;
    }
}

@media (max-width: 480px) {
    .period-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .analytics-toggle-compact {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .stat-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .chart-title {
        font-size: 13px;
    }
    
    .chart-container {
        height: 180px;
    }
}

/* ===== Unified Header Updates ===== */
.unified-header {
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 16px;
}

.unified-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    width: 100%;
}

@media (max-width: 768px) {
    .unified-header {
        padding: 16px 12px 12px;
    }
    
    .unified-header-content {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    /* Row 1: Brand + Actions */
    .header-brand {
        order: 1;
        width: 100%;
        justify-content: flex-start;
        position: relative;
        padding-right: 120px; /* Space for action buttons */
    }
    
    .header-brand h1 {
        font-size: 18px;
    }
    
    .brand-icon {
        font-size: 20px;
    }
    
    .header-actions {
        order: 2;
        position: absolute;
        top: 0;
        right: 0;
        gap: 6px;
    }
    
    .header-actions .icon-btn-glass {
        width: 34px;
        height: 34px;
        padding: 7px;
    }
    
    .header-actions .icon-btn-glass svg {
        width: 16px;
        height: 16px;
    }
    
    /* Row 2: Period Switcher */
    .period-switcher {
        order: 3;
        width: 100%;
    }
    
    /* Row 3: Date Navigation */
    .header-date-nav {
        order: 4;
        width: 100%;
    }
    
    .nav-arrow-glass {
        width: 40px;
        height: 40px;
        padding: 10px;
    }
    
    .date-display-unified {
        flex: 1;
        min-width: 0;
    }
    
    .current-date-unified {
        font-size: 14px;
    }
    
    .today-badge-unified {
        font-size: 10px;
        padding: 4px 8px;
    }
    
    .back-to-today-unified {
        font-size: 12px;
        padding: 4px 8px;
    }
}

@media (max-width: 1024px) and (min-width: 769px) {
    .unified-header-content {
        flex-direction: column;
        gap: 14px;
    }
    
    .header-brand {
        width: 100%;
        justify-content: center;
    }
    
    .period-switcher {
        order: 2;
        width: 100%;
    }
    
    .header-date-nav {
        order: 3;
        width: 100%;
    }
    
    .header-actions {
        order: 1;
        position: absolute;
        top: 20px;
        right: 16px;
    }
}

.ingredient-select-group .selection .select2-selection__clear{
    margin-right: 10px;
    padding-right: 0px;
    padding-left: 10px;
}