/* ===== CSS Reset & Custom Properties ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.07);
    --bg-glass: rgba(255, 255, 255, 0.06);
    --bg-glass-strong: rgba(255, 255, 255, 0.1);
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.12);
    --text-primary: #f0f0f5;
    --text-secondary: #8b8ba3;
    --text-muted: #5a5a72;
    --accent-indigo: #6366f1;
    --accent-purple: #a855f7;
    --accent-pink: #ec4899;
    --accent-emerald: #10b981;
    --accent-amber: #f59e0b;
    --accent-red: #ef4444;
    --accent-cyan: #06b6d4;
    --gradient-primary: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
    --gradient-emerald: linear-gradient(135deg, #10b981, #06b6d4);
    --gradient-amber: linear-gradient(135deg, #f59e0b, #ef4444);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --fs-xs: 0.75rem;
    --fs-sm: 0.8125rem;
    --fs-base: 0.9375rem;
    --fs-md: 1rem;
    --fs-lg: 1.125rem;
    --fs-xl: 1.5rem;
    --fs-2xl: 2rem;
    --fs-3xl: 2.75rem;

    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ===== Ambient Background ===== */
.ambient-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    animation: blobFloat 20s ease-in-out infinite;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-indigo);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.blob-2 {
    width: 350px;
    height: 350px;
    background: var(--accent-purple);
    bottom: 20%;
    left: -120px;
    animation-delay: -7s;
}

.blob-3 {
    width: 300px;
    height: 300px;
    background: var(--accent-pink);
    bottom: -80px;
    right: 20%;
    animation-delay: -14s;
}

@keyframes blobFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.05); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(15px, 30px) scale(1.02); }
}

/* ===== Header ===== */
#app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-subtle);
}

.header-content {
    max-width: 640px;
    margin: 0 auto;
    padding: var(--space-md) var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.logo-text {
    font-size: var(--fs-lg);
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.header-actions {
    display: flex;
    gap: var(--space-sm);
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.icon-btn:hover {
    background: var(--bg-glass-strong);
    color: var(--text-primary);
    border-color: var(--border-medium);
    transform: translateY(-1px);
}

/* ===== Date Navigation ===== */
.date-nav {
    max-width: 640px;
    margin: var(--space-lg) auto 0;
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xl);
}

.date-arrow {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.date-arrow:hover {
    background: var(--bg-glass-strong);
    color: var(--text-primary);
    transform: scale(1.08);
}

.date-display {
    text-align: center;
    min-width: 160px;
}

.date-label {
    display: block;
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--text-primary);
}

.date-full {
    display: block;
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-top: 2px;
}

/* ===== Progress Ring ===== */
.progress-section {
    max-width: 640px;
    margin: var(--space-xl) auto;
    padding: 0 var(--space-lg);
    display: flex;
    justify-content: center;
}

.progress-ring-container {
    position: relative;
    width: 200px;
    height: 200px;
    animation: fadeInUp 0.6s ease-out;
}

.progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring-bg {
    fill: none;
    stroke: var(--border-subtle);
    stroke-width: 8;
}

.progress-ring-fill {
    fill: none;
    stroke: url(#progressGrad);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 553;
    stroke-dashoffset: 553;
    transition: stroke-dashoffset 1s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.4));
}

.progress-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.progress-consumed {
    font-size: var(--fs-3xl);
    font-weight: 800;
    letter-spacing: -0.03em;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.progress-label {
    font-size: var(--fs-sm);
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== Summary Cards ===== */
.summary-cards {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    transition: all var(--transition-base);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.summary-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.summary-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.remaining-icon {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.protein-icon {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-indigo);
}

.entries-icon {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-amber);
}

.summary-info {
    text-align: center;
}

.summary-value {
    display: block;
    font-size: var(--fs-xl);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.summary-value small {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.summary-label {
    display: block;
    font-size: var(--fs-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
    margin-top: 2px;
}

/* ===== Meal Sections ===== */
.meals-section {
    max-width: 640px;
    margin: var(--space-xl) auto;
    padding: 0 var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.meal-group {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.meal-group:hover {
    border-color: var(--border-medium);
}

.meal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
}

.meal-title {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.meal-emoji {
    font-size: var(--fs-xl);
}

.meal-title h2 {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--text-primary);
}

.meal-meta {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.meal-calories {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.add-food-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    color: var(--accent-indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.add-food-btn:hover {
    background: var(--accent-indigo);
    color: white;
    border-color: var(--accent-indigo);
    transform: rotate(90deg) scale(1.1);
}

.meal-items {
    border-top: 1px solid var(--border-subtle);
}

.meal-items:empty {
    border-top: none;
}

/* Food Items */
.food-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-subtle);
    transition: all var(--transition-base);
    animation: slideIn 0.3s ease-out;
}

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

.food-item:hover {
    background: var(--bg-card-hover);
}

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

.food-item-info {
    flex: 1;
    min-width: 0;
}

.food-item-name {
    font-size: var(--fs-base);
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.food-item-details {
    display: flex;
    gap: var(--space-md);
    margin-top: 3px;
}

.food-item-detail {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    font-weight: 500;
}

.food-item-detail.protein {
    color: var(--accent-indigo);
}

.food-item-detail.carbs {
    color: var(--accent-amber);
}

.food-item-detail.fat {
    color: var(--accent-pink);
}

.food-item-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.food-item-kcal {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.food-item-delete {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
    opacity: 0;
}

.food-item:hover .food-item-delete {
    opacity: 1;
}

.food-item-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

/* ===== Weekly Overview ===== */
.weekly-section {
    max-width: 640px;
    margin: 0 auto var(--space-2xl);
    padding: 0 var(--space-lg) var(--space-2xl);
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

.section-title {
    font-size: var(--fs-lg);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

.weekly-chart {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--space-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

.day-bar-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.day-bar-track {
    width: 100%;
    max-width: 32px;
    height: 100px;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
    position: relative;
    overflow: hidden;
}

.day-bar-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    transition: height 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 4px;
}

.day-bar-fill.over-goal {
    background: var(--gradient-amber);
}

.day-label {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    font-weight: 500;
}

.day-label.is-today {
    color: var(--accent-indigo);
    font-weight: 700;
}

.day-value {
    font-size: 0.625rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ===== Floating Action Button ===== */
.fab {
    position: fixed;
    bottom: var(--space-xl);
    right: var(--space-xl);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    border: none;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    transition: all var(--transition-base);
    z-index: 90;
    animation: fabEntry 0.5s var(--transition-spring) 0.5s both;
}

.fab:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 30px rgba(99, 102, 241, 0.5);
}

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

@keyframes fabEntry {
    from {
        opacity: 0;
        transform: scale(0) rotate(180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

/* ===== Modals ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 200;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    padding: var(--space-xl);
    transform: translateY(100%);
    transition: transform var(--transition-slow);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-wide {
    max-width: 640px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-xl);
}

.modal-header h2 {
    font-size: var(--fs-xl);
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-base);
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    border-color: rgba(239, 68, 68, 0.3);
}

/* ===== Forms ===== */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-group label {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: var(--space-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: var(--fs-base);
    transition: all var(--transition-base);
    outline: none;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: rgba(99, 102, 241, 0.05);
}

.form-group select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.custom-select-wrapper {
    position: relative;
}

.custom-select-wrapper::after {
    content: '';
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--text-muted);
    pointer-events: none;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-family: var(--font-family);
    font-size: var(--fs-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
}

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

.settings-danger {
    margin-top: var(--space-md);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-subtle);
}

.btn-danger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;
    padding: var(--space-md) var(--space-xl);
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-md);
    color: var(--accent-red);
    font-family: var(--font-family);
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

/* ===== History ===== */
.history-content {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    max-height: 60vh;
    overflow-y: auto;
}

.history-day {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: var(--space-lg);
    transition: all var(--transition-base);
}

.history-day:hover {
    background: var(--bg-glass-strong);
}

.history-day-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-sm);
}

.history-day-date {
    font-size: var(--fs-base);
    font-weight: 600;
    color: var(--text-primary);
}

.history-day-total {
    font-size: var(--fs-sm);
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.history-day-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-glass);
    border-radius: var(--radius-full);
    overflow: hidden;
    margin-top: var(--space-sm);
}

.history-day-bar-fill {
    height: 100%;
    border-radius: var(--radius-full);
    background: var(--gradient-primary);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.history-day-bar-fill.over-goal {
    background: var(--gradient-amber);
}

.history-day-meals {
    display: flex;
    gap: var(--space-md);
    margin-top: var(--space-sm);
    flex-wrap: wrap;
}

.history-meal-badge {
    font-size: var(--fs-xs);
    color: var(--text-muted);
    font-weight: 500;
}

.empty-state {
    text-align: center;
    color: var(--text-muted);
    padding: var(--space-2xl) 0;
    font-size: var(--fs-base);
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    top: var(--space-xl);
    right: var(--space-xl);
    z-index: 300;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md) var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease-out;
    min-width: 260px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.toast.exiting {
    animation: toastOut 0.3s ease-in forwards;
}

.toast-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs-md);
}

.toast-icon.success {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-emerald);
}

.toast-icon.error {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.toast-icon.info {
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-indigo);
}

.toast-message {
    font-size: var(--fs-sm);
    color: var(--text-primary);
    font-weight: 500;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(40px);
    }
}

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

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-medium);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ===== Responsive ===== */
@media (max-width: 600px) {
    .header-content {
        padding: var(--space-md);
    }

    .date-nav {
        padding: 0 var(--space-md);
    }

    .progress-section {
        padding: 0 var(--space-md);
    }

    .summary-cards {
        padding: 0 var(--space-md);
        gap: var(--space-sm);
    }

    .summary-card {
        padding: var(--space-md);
    }

    .summary-value {
        font-size: var(--fs-lg);
    }

    .meals-section {
        padding: 0 var(--space-md);
    }

    .weekly-section {
        padding: 0 var(--space-md) var(--space-2xl);
    }

    .weekly-chart {
        padding: var(--space-md);
    }

    .day-bar-track {
        height: 70px;
    }

    .fab {
        bottom: var(--space-lg);
        right: var(--space-lg);
    }

    .modal {
        padding: var(--space-lg);
    }

    .toast-container {
        left: var(--space-md);
        right: var(--space-md);
    }

    .toast {
        min-width: unset;
    }

    .food-item-detail {
        font-size: 0.65rem;
    }

    .food-item-details {
        gap: var(--space-sm);
    }
}

@media (max-width: 380px) {
    .summary-cards {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .weekly-chart {
        grid-template-columns: repeat(7, 1fr);
        gap: 4px;
    }
}

/* ===== Number input spinner removal ===== */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type='number'] {
    -moz-appearance: textfield;
}
