/* ============================
   THEME VARIABLES (Premium Health App Style)
   Calm / Notion / Linear Inspired
   ============================ */
:root {
  /* Фон та картки (Light Mode) - ТЕПЛІ, пов'язані з їжею */
  --bg-app: #FFF8F5; /* Теплий кремовий, як свіжий хліб */
  --card-bg: #FFFFFF;
  --card-warm-bg: #FFFBF8; /* Для акцентних карток */
  --card-border: rgba(0, 0, 0, 0.06);
  
  /* Акценти, пов'язані з їжею (емоційні, теплі) */
  --accent-orange: #FF6B35; /* Помаранчевий (апельсини, морква) */
  --accent-orange-soft: #FFF4F0;
  --accent-orange-hover: #E55A2B;
  
  --accent-tomato: #FF5722; /* Томатний (помидори) */
  --accent-tomato-soft: #FFEBE5;
  
  --accent-coral: #FF7F50; /* Кораловий (свіжість) */
  --accent-coral-soft: #FFF5F2;
  
  --accent-gold: #FFB347; /* Золотий (мед, лимони) */
  --accent-gold-soft: #FFFBF0;
  
  --accent-avocado: #87A96B; /* Авокадо (свіжість, здоров'я) */
  --accent-avocado-soft: #F5F8F2;
  
  --accent-berry: #E91E63; /* Ягідний (малина, полуниця) */
  --accent-berry-soft: #FCE4EC;
  
  /* Кольори для нутрієнтів (пов'язані з їжею) */
  /* Вуглеводи — теплі відтінки (хліб, крупи, фрукти) */
  --nutrient-carbs: #FF7F50; /* Кораловий (теплий, як апельсини) */
  --nutrient-carbs-light: #FF9F70;
  --nutrient-carbs-dark: #E55A2B;
  --nutrient-carbs-soft: #FFF5F2;
  
  /* Білки — свіжі відтінки (яйця, курятина, риба) */
  --nutrient-protein: #4ECDC4; /* Свіжий бірюзовий (як океан, риба) */
  --nutrient-protein-light: #6EDDD6;
  --nutrient-protein-dark: #3AB5AE;
  --nutrient-protein-soft: #E6F7F6;
  
  /* Жири — насичені, але м'які (авокадо, оливкова олія) */
  --nutrient-fat: #FFB347; /* Золотий (м'який, як авокадо) */
  --nutrient-fat-light: #FFC470;
  --nutrient-fat-dark: #E59A2B;
  --nutrient-fat-soft: #FFFBF0;
  
  /* Калорії — теплий зелений (енергія, свіжість) */
  --nutrient-calories: #22C55E; /* Свіжий зелений (енергія) */
  --nutrient-calories-light: #4ADE80;
  --nutrient-calories-dark: #16A34A;
  --nutrient-calories-soft: #F0FDF4;
  
  /* Зелені (свіжіший, для здоров'я) */
  --accent-green: #22C55E; /* Свіжіший зелений (салат) */
  --accent-green-soft: #F0FDF4;
  --accent-green-hover: #16A34A;
  
  /* Блакитний (для води) */
  --accent-blue: #3B82F6;
  --accent-blue-soft: #DBEAFE;
  --accent-blue-hover: #2563EB;
  
  /* Фіолетовий (для функціональних елементів) */
  --accent-lavender: #A78BFA;
  --accent-lavender-soft: #EDE9FE;
  --accent-lavender-hover: #8B5CF6;
  
  --accent-purple: #8B5CF6;
  --accent-purple-soft: #EDE9FE;
  
  /* Градієнти для карток */
  --gradient-day: linear-gradient(135deg, #FFF4E6 0%, #FFE5CC 50%, #FFD9B3 100%);
  --gradient-success: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 50%, #BBF7D0 100%);
  --gradient-energy: linear-gradient(135deg, #FFF5F2 0%, #FFE5E0 50%, #FFD6CC 100%);
  
  /* Статуси (м'які відтінки) */
  --success: #10B981;
  --success-soft: #D1FAE5;
  --warning: #F59E0B;
  --warning-soft: #FEF3C7;
  --error: #EF4444;
  --error-soft: #FEE2E2;
  
  /* Текст (темно-сірий, не чорний) */
  --text-main: #1F2937;
  --text-secondary: #4B5563;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  --text-placeholder: #D1D5DB;
  
  /* Тіні (теплі, з кольоровими відтінками) */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.08);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  
  /* Теплі тіні з кольоровими відтінками */
  --shadow-warm: 0 4px 16px rgba(255, 107, 53, 0.1), 0 2px 8px rgba(255, 179, 71, 0.08);
  --shadow-warm-lg: 0 8px 24px rgba(255, 107, 53, 0.15), 0 4px 12px rgba(255, 179, 71, 0.1);
  --shadow-orange: 0 4px 16px rgba(255, 107, 53, 0.3);
  --shadow-gold: 0 4px 16px rgba(255, 179, 71, 0.3);
  
  /* Радіуси (більш заокруглені) */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --radius-full: 9999px;
  
  /* Переходи (плавні, природні) */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 250ms cubic-bezier(0.16, 1, 0.3, 1);
  
  /* Spacing (більше повітря) */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
}

/* ============================
   DARK MODE
   ============================ */
[data-theme="dark"] {
  /* Фон та картки (Dark Mode) */
  --bg-app: #121212;
  --card-bg: #1E2026;
  --card-border: rgba(255, 255, 255, 0.08);
  
  /* Акценти (приглушені для dark mode) */
  --accent-green: #34D399;
  --accent-green-soft: rgba(52, 211, 153, 0.15);
  --accent-green-hover: #10B981;
  
  --accent-lavender: #C4B5FD;
  --accent-lavender-soft: rgba(196, 181, 253, 0.15);
  --accent-lavender-hover: #A78BFA;
  
  --accent-blue: #60A5FA;
  --accent-blue-soft: rgba(96, 165, 250, 0.15);
  --accent-blue-hover: #3B82F6;
  
  --accent-purple: #A78BFA;
  --accent-purple-soft: rgba(167, 139, 250, 0.15);
  
  /* Статуси (приглушені) */
  --success: #34D399;
  --success-soft: rgba(52, 211, 153, 0.15);
  --warning: #FBBF24;
  --warning-soft: rgba(251, 191, 36, 0.15);
  --error: #F87171;
  --error-soft: rgba(248, 113, 113, 0.15);
  
  /* Текст (світлий) */
  --text-main: #EDEDED;
  --text-secondary: #D1D5DB;
  --text-muted: #A0A0A0;
  --text-light: #6B7280;
  --text-placeholder: #4B5563;
  
  /* Тіні (темніші, м'які) */
  --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4), 0 1px 2px -1px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6), 0 4px 6px -4px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.7), 0 8px 10px -6px rgba(0, 0, 0, 0.7);
}

/* ============================
   GLOBAL / APP FEEL (Premium Minimal)
   ============================ */
body {
  background: var(--bg-app);
  background-image: url('image/background.png');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", 
               "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
  font-feature-settings: "kern" 1, "liga" 1, "tnum" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;

  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.6;
  letter-spacing: -0.011em;
  
  /* Плавний перехід при зміні теми */
  transition: background-color 0.2s ease, color 0.2s ease;
  position: relative;
}

/* Overlay для читабельності контенту */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 248, 245, 0.94);
  z-index: -1;
  pointer-events: none;
}

[data-theme="dark"] body::before {
  background: rgba(18, 18, 18, 0.92);
}

/* Покращена читабельність цифр */
.numbers,
[id*="energy"],
[id*="glucose"],
[id*="calories"],
[id*="protein"],
[id*="fat"],
[id*="carbs"],
[id*="water"] {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  letter-spacing: -0.02em;
}

/* ============================
   MAIN CONTAINER (PHONE APP)
   ============================ */
.max-w-md {
  max-width: 100%;
  padding-bottom: 120px;
  position: relative;
}

/* ============================
   HEADER (Clean & Friendly)
   ============================ */
header {
  padding-top: env(safe-area-inset-top);
  padding-bottom: 16px;
  padding-left: 20px;
  padding-right: 20px;
}

header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 4px;
}

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

/* ============================
   CARDS (SECTIONS) - Soft UI
   ============================ */
section[data-section] {
  background: transparent;
  padding: 0;
  margin-bottom: 0;
}

/* Картки всередині секцій (Premium Cards) */
section[data-section] > div,
.bg-white.rounded-xl,
.bg-white.rounded-2xl {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.08),
    0 2px 8px rgba(255, 107, 53, 0.12),
    0 1px 4px rgba(255, 179, 71, 0.08);
  border: 1px solid var(--card-border);
  transition: all var(--transition-smooth);
  backdrop-filter: blur(10px);
}

section[data-section] > div:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* ============================
   СТАТУС ДНЯ - ТЕПЛИЙ ГРАДІЄНТ
   ============================ */
.status-day-card {
  background: var(--gradient-day);
  border: 1px solid rgba(255, 107, 53, 0.2);
  box-shadow: 
    0 6px 24px rgba(0, 0, 0, 0.08),
    0 3px 12px rgba(255, 107, 53, 0.15),
    0 1px 4px rgba(255, 179, 71, 0.1);
  transition: all var(--transition-smooth);
  backdrop-filter: blur(12px);
}

.status-day-card:hover {
  box-shadow: var(--shadow-warm-lg);
  transform: translateY(-1px);
}

/* Спеціальні картки з градієнтами */
.bg-gradient-to-br {
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.5) 0%, rgba(237, 233, 254, 0.5) 100%);
  border: 1px solid rgba(139, 92, 246, 0.1);
}

[data-theme="dark"] .bg-gradient-to-br {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.15) 0%, rgba(167, 139, 250, 0.15) 100%);
  border: 1px solid rgba(167, 139, 250, 0.2);
}

/* Адаптація Tailwind класів для dark mode */
[data-theme="dark"] .bg-white {
  background: var(--card-bg) !important;
}

[data-theme="dark"] .bg-gray-50 {
  background: rgba(255, 255, 255, 0.03) !important;
}

[data-theme="dark"] .bg-blue-50,
[data-theme="dark"] .from-blue-50,
[data-theme="dark"] .via-indigo-50,
[data-theme="dark"] .to-purple-50 {
  background: rgba(96, 165, 250, 0.1) !important;
}

[data-theme="dark"] .bg-green-50 {
  background: rgba(52, 211, 153, 0.1) !important;
}

[data-theme="dark"] .bg-gray-100 {
  background: rgba(255, 255, 255, 0.05) !important;
}

[data-theme="dark"] .text-gray-700,
[data-theme="dark"] .text-gray-800 {
  color: var(--text-main) !important;
}

[data-theme="dark"] .text-gray-600 {
  color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-gray-500 {
  color: var(--text-muted) !important;
}

/* ============================
   ПОКАЗНИКИ СТАНУ ОРГАНІЗМУ - ТЕПЛІ КОЛЬОРИ
   ============================ */

/* Загальні стилі для всіх індикаторів - вирівняна сітка */
.energy-indicator,
.glucose-indicator,
.enzymes-indicator,
.water-indicator {
  display: flex !important;
  flex-direction: column !important;
  justify-content: space-between !important;
  min-height: 100px !important;
  height: 100% !important;
  width: 100% !important;
  padding: 16px !important;
  margin: 0 !important;
  border-radius: 12px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box !important;
  position: relative;
}

/* Структура контенту всередині карток - заголовки */
.energy-indicator > div:first-child,
.glucose-indicator > div:first-child,
.enzymes-indicator > div:first-child,
.water-indicator > div:first-child {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #6B7280 !important;
  margin: 0 0 12px 0 !important;
  padding: 0 !important;
  line-height: 1.2 !important;
  height: 14.4px !important;
  min-height: 14.4px !important;
  max-height: 14.4px !important;
  flex-shrink: 0 !important;
  flex-grow: 0 !important;
  display: flex;
  align-items: center;
}

/* Структура контенту всередині карток - числові значення */
.energy-indicator > div:last-child,
.glucose-indicator > div:last-child,
.enzymes-indicator > div:last-child,
.water-indicator > div:last-child {
  font-size: 24px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: baseline !important;
  gap: 4px !important;
  flex: 1 1 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  min-height: 24px !important;
  vertical-align: baseline !important;
}

/* Базове число в усіх картках - однакова базова лінія */
#energy,
#glucose,
#enzymes,
#water {
  display: inline-block !important;
  vertical-align: baseline !important;
  line-height: 1 !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  height: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
}

/* Специфічні кольори та фони */
.energy-indicator {
  background: var(--gradient-energy) !important;
  border: 1px solid rgba(255, 107, 53, 0.2) !important;
}

.energy-indicator > div:last-child,
#energy {
  color: var(--accent-orange) !important;
}

.glucose-indicator {
  background: linear-gradient(135deg, #FFFBF0 0%, #FFF5E0 100%) !important;
  border: 1px solid rgba(255, 179, 71, 0.2) !important;
}

.glucose-indicator > div:last-child,
#glucose {
  color: var(--accent-gold) !important;
}

.enzymes-indicator {
  background: linear-gradient(135deg, #F5F8F2 0%, #E8F0E0 100%) !important;
  border: 1px solid rgba(135, 169, 107, 0.2) !important;
}

.enzymes-indicator > div:last-child,
#enzymes {
  color: var(--accent-avocado) !important;
}

.water-indicator {
  background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%) !important;
  border: 1px solid rgba(59, 130, 246, 0.2) !important;
}

.water-indicator > div:last-child,
#water {
  color: var(--accent-blue) !important;
}

/* Вирівнювання додаткових елементів у значеннях - спільне для всіх */
.energy-indicator span,
.glucose-indicator span,
.enzymes-indicator span {
  font-size: 14px !important;
  font-weight: 400 !important;
  opacity: 0.8;
  line-height: 1 !important;
  white-space: nowrap;
  vertical-align: baseline !important;
  display: inline-block;
}

/* Спеціальне вирівнювання для води - число на тій самій базовій лінії */
.water-indicator > div:last-child {
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 0 !important;
  justify-content: flex-end !important;
  min-height: 24px !important;
}

/* Основне число "0" в картці води - на тій самій базовій лінії */
#water {
  display: inline-block !important;
  vertical-align: baseline !important;
  line-height: 1 !important;
  font-size: 24px !important;
  font-weight: 700 !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 24px !important;
  min-height: 24px !important;
  max-height: 24px !important;
}

/* Видаляємо span з основного потоку для води */
.water-indicator > div:last-child > span {
  font-size: 11px !important;
  line-height: 1.3 !important;
  margin: 3px 0 0 0 !important;
  padding: 0 !important;
  display: block !important;
  opacity: 0.65;
  font-weight: 400 !important;
  white-space: nowrap;
  width: 100%;
}

/* Забезпечення однакової висоти та вирівнювання для всіх числових контейнерів */
.energy-indicator > div:last-child,
.glucose-indicator > div:last-child,
.enzymes-indicator > div:last-child {
  align-items: baseline !important;
  min-height: 24px !important;
}

/* Допоміжні span в інших картках (%, тощо) */
.energy-indicator > div:last-child > span,
.enzymes-indicator > div:last-child > span {
  line-height: 1 !important;
  vertical-align: baseline !important;
  font-size: 14px !important;
}

/* Grid контейнер для індикаторів - вирівняна сітка 2x2 */
.home-card-standard .grid.grid-cols-2.gap-3 {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  grid-template-rows: repeat(2, 1fr) !important;
  gap: 12px !important;
  align-items: stretch !important;
  width: 100%;
}

.home-card-standard .grid.grid-cols-2.gap-3 > .energy-indicator,
.home-card-standard .grid.grid-cols-2.gap-3 > .glucose-indicator,
.home-card-standard .grid.grid-cols-2.gap-3 > .enzymes-indicator,
.home-card-standard .grid.grid-cols-2.gap-3 > .water-indicator {
  min-height: 100px !important;
  height: 100% !important;
  width: 100% !important;
  max-width: 100% !important;
}

/* Додаткова перевірка для рівних розмірів - всі картки однакової висоти */
.home-card-standard .grid.grid-cols-2.gap-3 > div {
  min-height: 100px !important;
  height: 100% !important;
}

/* Адаптивність для менших екранів */
@media (max-width: 360px) {
  .home-card-standard .grid.grid-cols-2.gap-3 {
    gap: 8px !important;
  }
  
  .energy-indicator,
  .glucose-indicator,
  .enzymes-indicator,
  .water-indicator {
    padding: 12px !important;
    min-height: 90px !important;
  }
}

/* Перевизначення Tailwind класів для показників */
.bg-blue-50\/50.energy-indicator,
.bg-blue-50\/50[id="energy"],
.bg-blue-50\/50:has(#energy) {
  background: var(--gradient-energy) !important;
  border: 1px solid rgba(255, 107, 53, 0.2) !important;
  width: 100% !important;
  min-height: 100px !important;
  height: 100% !important;
}

.bg-blue-50\/50.energy-indicator .text-blue-600,
.bg-blue-50\/50[id="energy"] .text-blue-600,
.bg-blue-50\/50:has(#energy) .text-blue-600 {
  color: var(--accent-orange) !important;
}

.bg-purple-50\/50.glucose-indicator,
.bg-purple-50\/50[id="glucose"],
.bg-purple-50\/50:has(#glucose) {
  background: linear-gradient(135deg, #FFFBF0 0%, #FFF5E0 100%) !important;
  border: 1px solid rgba(255, 179, 71, 0.2) !important;
  width: 100% !important;
  min-height: 100px !important;
  height: 100% !important;
}

.bg-purple-50\/50.glucose-indicator .text-purple-600,
.bg-purple-50\/50[id="glucose"] .text-purple-600,
.bg-purple-50\/50:has(#glucose) .text-purple-600 {
  color: var(--accent-gold) !important;
}

.bg-green-50\/50.enzymes-indicator,
.bg-green-50\/50[id="enzymes"],
.bg-green-50\/50:has(#enzymes) {
  background: linear-gradient(135deg, #F5F8F2 0%, #E8F0E0 100%) !important;
  border: 1px solid rgba(135, 169, 107, 0.2) !important;
  width: 100% !important;
  min-height: 100px !important;
  height: 100% !important;
}

.bg-green-50\/50.enzymes-indicator .text-green-600,
.bg-green-50\/50[id="enzymes"] .text-green-600,
.bg-green-50\/50:has(#enzymes) .text-green-600 {
  color: var(--accent-avocado) !important;
}

.bg-cyan-50\/50.water-indicator {
  width: 100% !important;
  min-height: 100px !important;
  height: 100% !important;
}

/* ============================
   КНОПКА "З'ЇСТИ" - ПОМАРАНЧЕВИЙ ГРАДІЄНТ
   ============================ */
#eatBtn {
  background: linear-gradient(135deg, var(--accent-orange) 0%, #FF8C42 100%) !important;
  color: white !important;
  box-shadow: var(--shadow-orange) !important;
  border: none !important;
  transition: all 0.3s ease !important;
}

#eatBtn:hover {
  background: linear-gradient(135deg, #FF8C42 0%, var(--accent-orange) 100%) !important;
  box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4) !important;
  transform: translateY(-2px) !important;
}

#eatBtn:active {
  transform: translateY(0) scale(0.98) !important;
}

/* Анімація успіху при натисканні */
#eatBtn.eat-button-success {
  animation: celebrate 0.6s ease;
}

@keyframes celebrate {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.1) rotate(-2deg); }
  75% { transform: scale(1.1) rotate(2deg); }
}

/* ============================
   ВІЗУАЛЬНИЙ ПРОГРЕС ТА СТАТУС ДНЯ
   ============================ */

/* Візуальний індикатор статусу дня */
.day-status-visual {
  position: relative;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.status-icon {
  font-size: 32px;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: all 0.3s ease;
}

.status-ring {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 4px solid #E5E7EB;
  border-top-color: var(--nutrient-calories);
  animation: statusRingRotate 2s linear infinite;
  opacity: 0.3;
}

.status-ring.complete {
  border-color: var(--nutrient-calories);
  opacity: 1;
  animation: statusRingPulse 2s ease-in-out infinite;
}

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

@keyframes statusRingPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

/* Статуси дня */
.day-status-text {
  transition: all 0.3s ease;
}

.day-status-text.excellent {
  color: #22C55E;
}

.day-status-text.good {
  color: #FFB347;
}

.day-status-text.needs-improvement {
  color: #FF6B35;
}

/* Загальна шкала прогресу */
.overall-progress-bar {
  background: linear-gradient(90deg, var(--nutrient-calories) 0%, var(--nutrient-calories-dark) 100%);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
  position: relative;
  overflow: hidden;
}

.overall-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: progressShine 2s infinite;
}

@keyframes progressShine {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* Мілені на шкалі */
.progress-milestones {
  pointer-events: none;
}

.milestone {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.milestone.active {
  opacity: 1;
  animation: milestonePulse 1s ease-in-out infinite;
}

@keyframes milestonePulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.5);
    opacity: 1;
  }
}

/* Прогрес-бари нутрієнтів */
.nutrient-progress-item {
  margin-bottom: 1.25rem;
}

.nutrient-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #D1D5DB;
  transition: all 0.3s ease;
}

.nutrient-status-dot.excellent {
  background: #22C55E;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
  animation: statusDotPulse 2s ease-in-out infinite;
}

.nutrient-status-dot.good {
  background: #FFB347;
  box-shadow: 0 0 8px rgba(255, 179, 71, 0.5);
}

.nutrient-status-dot.needs-improvement {
  background: #FF6B35;
}

@keyframes statusDotPulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.8;
  }
}

/* Світіння прогресу */
.progress-glow {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.progress-glow.active {
  opacity: 1;
  animation: progressGlowMove 1.5s ease-in-out;
}

@keyframes progressGlowMove {
  0% {
    left: -20%;
    width: 20%;
  }
  50% {
    left: 100%;
    width: 30%;
  }
  100% {
    left: 100%;
    width: 0;
  }
}

/* ============================
   ПРОГРЕС-БАРИ - КОЛЬОРОВІ ГРАДІЄНТИ (ЗАМІНЕНО НА НОВУ СИСТЕМУ)
   ============================ */

/* Пульсація при досягненні норми */
.progress-bar-full,
#caloriesBar[style*="100%"],
#proteinBar[style*="100%"],
#fatBar[style*="100%"],
#carbsBar[style*="100%"] {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
  }
  50% {
    box-shadow: 0 2px 16px rgba(255, 107, 53, 0.5);
  }
}

/* ============================
   АНІМАЦІЯ ТАРІЛКИ ПРИ ЗАПОВНЕННІ
   ============================ */
.plate-chart.filled {
  animation: plateFill 0.6s ease;
}

@keyframes plateFill {
  0% {
    transform: scale(0.9);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================
   TOAST ДЛЯ ДОДАВАННЯ ПРОДУКТУ
   ============================ */
.food-added-toast {
  background: linear-gradient(135deg, var(--accent-orange) 0%, #FF8C42 100%);
  color: white;
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: var(--shadow-orange);
  animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  max-width: 90%;
}

@keyframes popIn {
  0% {
    transform: translateX(-50%) scale(0.8) translateY(20px);
    opacity: 0;
  }
  50% {
    transform: translateX(-50%) scale(1.05);
  }
  100% {
    transform: translateX(-50%) scale(1) translateY(0);
    opacity: 1;
  }
}

/* ============================
   ПІДСВІТКА НОВИХ ПРОДУКТІВ
   ============================ */
.new-food-item,
#todayMealsList li:first-child {
  animation: slideIn 0.5s ease;
  border-left: 4px solid var(--accent-orange);
  background: linear-gradient(90deg, var(--accent-orange-soft) 0%, #FFFFFF 100%);
}

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

/* ============================
   АДАПТАЦІЯ ДЛЯ DARK MODE
   ============================ */
[data-theme="dark"] {
  --bg-app: #1A1A1A; /* Трохи тепліший, ніж чистий чорний */
  --gradient-day: linear-gradient(135deg, #2A1F1A 0%, #3D2A1F 50%, #4A3326 100%);
  --gradient-energy: linear-gradient(135deg, #3D2A1F 0%, #4A3326 50%, #5A3F2F 100%);
}

[data-theme="dark"] .status-day-card {
  background: var(--gradient-day);
  border: 1px solid rgba(255, 107, 53, 0.3);
}

[data-theme="dark"] .border-gray-200,
[data-theme="dark"] .border-gray-100 {
  border-color: var(--card-border) !important;
}

[data-theme="dark"] .border-blue-100,
[data-theme="dark"] .border-blue-200 {
  border-color: rgba(167, 139, 250, 0.2) !important;
}

[data-theme="dark"] .border-green-200 {
  border-color: rgba(52, 211, 153, 0.2) !important;
}

/* Toggle Switch Styles для Dark Mode */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.cursor-pointer {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.cursor-pointer input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cursor-pointer .peer {
  display: inline-block;
  width: 44px;
  height: 24px;
  background: #D1D5DB;
  border-radius: 9999px;
  transition: background-color 0.2s ease;
  cursor: pointer;
  position: relative;
}

.cursor-pointer .peer:after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cursor-pointer input[type="checkbox"]:checked + .peer {
  background: var(--accent-purple);
}

.cursor-pointer input[type="checkbox"]:checked + .peer:after {
  transform: translateX(20px);
}

[data-theme="dark"] .cursor-pointer .peer {
  background: #4B5563;
}

[data-theme="dark"] .cursor-pointer input[type="checkbox"]:checked + .peer {
  background: var(--accent-purple);
}

/* Заголовки секцій (Чітка ієрархія) */
h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1.2;
}

h2.font-semibold,
h2 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: var(--spacing-lg);
  letter-spacing: -0.3px;
  line-height: 1.3;
}

h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.2px;
  line-height: 1.4;
}

h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: -0.1px;
}

/* UX-полірування: покращені відступи та ієрархія */
section[data-section] {
  padding-bottom: 24px;
}

/* Покращені інпути та селекти (Premium Style) */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="date"],
select {
  background: var(--card-bg);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-main);
  transition: all var(--transition-smooth);
  width: 100%;
  font-family: inherit;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.08);
  background: var(--card-bg);
}

input[type="text"]::placeholder,
input[type="number"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder {
  color: var(--text-placeholder);
  font-weight: 400;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-position: right 12px center;
  background-repeat: no-repeat;
  background-size: 16px;
  padding-right: 40px;
}

/* Покращені кнопки (Premium Style) */
button:not(.nav-btn):not(.delete-meal-btn) {
  border: none;
  border-radius: var(--radius-md);
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-xs);
}

button:not(.nav-btn):not(.delete-meal-btn):hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

button:not(.nav-btn):not(.delete-meal-btn):active:not(:disabled) {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

/* Кольорові кнопки */
button.bg-green-600,
button.bg-green-500 {
  background: var(--accent-green);
  color: white;
}

button.bg-green-600:hover,
button.bg-green-500:hover {
  background: var(--accent-green-hover);
}

button.bg-blue-600,
button.bg-blue-500 {
  background: var(--accent-blue);
  color: white;
}

button.bg-blue-600:hover,
button.bg-blue-500:hover {
  background: var(--accent-blue-hover);
}

button.bg-indigo-600 {
  background: var(--accent-purple);
  color: white;
}

button.bg-indigo-600:hover {
  background: var(--accent-lavender-hover);
}

button.bg-red-600,
button.bg-red-500 {
  background: var(--error);
  color: white;
}

button.bg-red-600:hover,
button.bg-red-500:hover {
  background: #DC2626;
}

button.bg-yellow-500 {
  background: var(--warning);
  color: white;
}

button.bg-yellow-500:hover {
  background: #D97706;
}

button.bg-gray-100,
button.bg-gray-200 {
  background: #F3F4F6;
  color: var(--text-main);
}

button.bg-gray-100:hover,
button.bg-gray-200:hover {
  background: #E5E7EB;
}

/* Покращені прогрес-бари */
.w-full.bg-gray-100.rounded-full {
  overflow: hidden;
  position: relative;
}

.w-full.bg-gray-100.rounded-full > div {
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Покращені списки продуктів */
ul.space-y-3 li,
ul.space-y-2 li {
  padding: 12px;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all var(--transition-fast);
}

ul.space-y-3 li:hover,
ul.space-y-2 li:hover {
  background: #FAFAFA;
  border-color: rgba(0, 0, 0, 0.1);
  transform: translateX(2px);
}

/* Покращені бейджі та статуси (Premium Badges) */
.text-xs.px-2\.5,
.text-xs.px-3,
.rounded-full {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  letter-spacing: -0.01em;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  line-height: 1.4;
}

/* Кольорові бейджі */
.bg-blue-100 { background: var(--accent-blue-soft); color: var(--accent-blue); }
.bg-green-100 { background: var(--accent-green-soft); color: var(--accent-green); }
.bg-purple-100 { background: var(--accent-purple-soft); color: var(--accent-purple); }
.bg-gray-100 { background: #F3F4F6; color: var(--text-secondary); }

/* Покращені градієнти для статусів */
.bg-gradient-to-br {
  background-size: 200% 200%;
  animation: gradientShift 10s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Плавна анімація появи */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* Застосування анімацій */
section[data-section].active > div {
  animation: fadeInUp 0.4s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

section[data-section].active > div:nth-child(1) { animation-delay: 0.05s; }
section[data-section].active > div:nth-child(2) { animation-delay: 0.1s; }
section[data-section].active > div:nth-child(3) { animation-delay: 0.15s; }
section[data-section].active > div:nth-child(4) { animation-delay: 0.2s; }

/* ============================
   SECTION NAVIGATION (з анімацією)
   ============================ */
section[data-section] {
  opacity: 0;
  transform: translateX(15px);
  visibility: hidden;
  transition:
    opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.25s;
  pointer-events: none;
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
}

section[data-section].active {
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
  position: relative;
}

/* ============================
   BUTTONS (TOUCH FRIENDLY)
   ============================ */
button {
  min-height: 52px;
  font-size: 16px;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
}

button:hover {
  opacity: 0.96;
}

button:active {
  transform: scale(0.96);
  opacity: 0.9;
}

/* ============================
   INPUTS / SELECTS (Clean)
   ============================ */
input,
select {
  min-height: 48px;
  font-size: 15px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1.5px solid #E5E7EB;
  background: var(--card-bg);
  color: var(--text-main);
  transition: all var(--transition-fast);
  width: 100%;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

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

/* ============================
   PROGRESS BARS (Smooth & Clean)
   ============================ */
.w-full.bg-gray-200.rounded,
.bg-gray-200.rounded {
  background: #F3F4F6;
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
}

#caloriesBar,
#proteinBar,
#fatBar,
#carbsBar {
  transition: width var(--transition-slow);
  border-radius: var(--radius-full);
  height: 100%;
}

/* Прогрес-бари з кольорами, пов'язаними з їжею */
#caloriesBar {
  background: linear-gradient(90deg, var(--nutrient-calories) 0%, var(--nutrient-calories-dark) 100%);
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

#proteinBar {
  background: linear-gradient(90deg, var(--nutrient-protein) 0%, var(--nutrient-protein-dark) 100%);
  box-shadow: 0 2px 8px rgba(78, 205, 196, 0.25);
}

#fatBar {
  background: linear-gradient(90deg, var(--nutrient-fat) 0%, var(--nutrient-fat-dark) 100%);
  box-shadow: 0 2px 8px rgba(255, 179, 71, 0.25);
}

#carbsBar {
  background: linear-gradient(90deg, var(--nutrient-carbs) 0%, var(--nutrient-carbs-dark) 100%);
  box-shadow: 0 2px 8px rgba(255, 127, 80, 0.25);
}

/* ============================
   PLATE CHART (WOW-елемент - Велика та Жива)
   ============================ */
.plate-container {
  position: relative;
  overflow: visible;
}

.plate-wrapper {
  position: relative;
  width: 380px;
  height: 380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Кільце прогресу дня (зовнішнє) */
.plate-progress-ring {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

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

.plate-progress-bg {
  fill: none;
  stroke: rgba(229, 231, 235, 0.2);
  stroke-width: 8;
  stroke-linecap: round;
}

.plate-progress-bar {
  fill: none;
  stroke: url(#plateProgressGradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 283;
  stroke-dashoffset: 283;
  transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 0 12px rgba(255, 107, 53, 0.5));
  animation: progressGlow 2s ease-in-out infinite;
}

@keyframes progressGlow {
  0%, 100% {
    filter: drop-shadow(0 0 12px rgba(255, 107, 53, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 18px rgba(255, 107, 53, 0.7));
  }
}

.plate-chart {
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: conic-gradient(
    #E5E7EB 0deg 360deg
  );
  transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 10px 30px rgba(255, 107, 53, 0.2),
    0 0 0 12px rgba(255, 255, 255, 0.95),
    0 0 0 16px rgba(255, 107, 53, 0.08),
    inset 0 6px 16px rgba(255, 255, 255, 0.7),
    inset 0 -3px 10px rgba(0, 0, 0, 0.06);
  position: relative;
  margin: 0 auto;
  z-index: 2;
  /* Анімація наповнення */
  animation: plateFill 1.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Стан порожньої тарілки (ранок) - м'яке світіння */
.plate-chart:not(.plate-balanced):not(.plate-unbalanced) {
  animation: plateEmptyGlow 4s ease-in-out infinite;
}

@keyframes plateEmptyGlow {
  0%, 100% {
    box-shadow: 
      0 20px 60px rgba(0, 0, 0, 0.15),
      0 10px 30px rgba(255, 107, 53, 0.2),
      0 0 0 12px rgba(255, 255, 255, 0.95),
      0 0 0 16px rgba(255, 107, 53, 0.08),
      inset 0 6px 16px rgba(255, 255, 255, 0.7),
      inset 0 -3px 10px rgba(0, 0, 0, 0.06);
  }
  50% {
    box-shadow: 
      0 20px 60px rgba(0, 0, 0, 0.15),
      0 10px 30px rgba(255, 107, 53, 0.25),
      0 0 0 12px rgba(255, 255, 255, 0.95),
      0 0 0 18px rgba(255, 107, 53, 0.12),
      inset 0 6px 16px rgba(255, 255, 255, 0.7),
      inset 0 -3px 10px rgba(0, 0, 0, 0.06);
  }
}

/* Анімація наповнення при першому додаванні */
.plate-chart.plate-filling {
  animation: plateFillAnimation 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes plateFillAnimation {
  0% {
    transform: scale(0.8);
    opacity: 0.6;
    box-shadow: 
      0 4px 16px rgba(0, 0, 0, 0.05),
      0 2px 8px rgba(255, 107, 53, 0.05);
  }
  30% {
    transform: scale(1.08);
    opacity: 0.9;
    box-shadow: 
      0 20px 60px rgba(0, 0, 0, 0.15),
      0 12px 36px rgba(255, 107, 53, 0.25),
      0 0 0 12px rgba(255, 255, 255, 0.95),
      0 0 0 16px rgba(255, 107, 53, 0.1),
      inset 0 6px 16px rgba(255, 255, 255, 0.7);
  }
  60% {
    transform: scale(0.98);
    box-shadow: 
      0 16px 48px rgba(0, 0, 0, 0.12),
      0 8px 24px rgba(255, 107, 53, 0.2),
      0 0 0 12px rgba(255, 255, 255, 0.95),
      inset 0 6px 16px rgba(255, 255, 255, 0.7);
  }
  100% {
    transform: scale(1);
    opacity: 1;
    box-shadow: 
      0 20px 60px rgba(0, 0, 0, 0.15),
      0 10px 30px rgba(255, 107, 53, 0.2),
      0 0 0 12px rgba(255, 255, 255, 0.95),
      0 0 0 16px rgba(255, 107, 53, 0.08),
      inset 0 6px 16px rgba(255, 255, 255, 0.7),
      inset 0 -3px 10px rgba(0, 0, 0, 0.06);
  }
}

/* Центральна частина тарілки */
.plate-chart::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFFFFF 0%, #F9FAFB 50%, #FFFFFF 100%);
  box-shadow: 
    inset 0 8px 20px rgba(0, 0, 0, 0.1),
    inset 0 -3px 10px rgba(0, 0, 0, 0.04),
    0 6px 16px rgba(0, 0, 0, 0.06);
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid rgba(255, 255, 255, 0.95);
}

/* Індикатор балансу в центрі */
.plate-balance-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 10;
  opacity: 0;
  transition: all 1s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 250, 251, 0.98) 100%);
  backdrop-filter: blur(12px);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.1),
    0 0 0 2px rgba(255, 255, 255, 0.8);
}

.plate-balance-indicator.visible {
  opacity: 1;
}

.plate-balance-indicator.balanced {
  animation: balancePulse 2.5s ease-in-out infinite;
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.98) 0%, rgba(220, 252, 231, 0.98) 100%);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.1),
    0 0 0 2px rgba(34, 197, 94, 0.3),
    0 0 32px rgba(34, 197, 94, 0.25);
}

.plate-balance-indicator.balanced .balance-icon-inner {
  animation: balanceIconGlow 2s ease-in-out infinite;
}

@keyframes balanceIconGlow {
  0%, 100% {
    transform: scale(1);
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.2));
  }
  50% {
    transform: scale(1.1);
    filter: drop-shadow(0 4px 12px rgba(34, 197, 94, 0.4));
  }
}

.plate-balance-indicator.unbalanced {
  background: linear-gradient(135deg, rgba(255, 247, 237, 0.98) 0%, rgba(255, 237, 213, 0.98) 100%);
  box-shadow: 
    0 6px 20px rgba(0, 0, 0, 0.1),
    0 0 0 2px rgba(245, 158, 11, 0.3),
    0 0 24px rgba(245, 158, 11, 0.2);
  animation: unbalancedIndicator 2s ease-in-out infinite;
}

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

.balance-icon-inner {
  font-size: 48px;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.2));
  line-height: 1;
  transition: transform 0.3s ease;
}

.balance-status-text {
  font-size: 10px;
  font-weight: 600;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* Індикатор історії дня (ранок/день/вечір) */
.plate-day-story {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  z-index: 15;
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.plate-day-story.visible {
  opacity: 1;
}

.day-story-icon {
  font-size: 32px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
  line-height: 1;
  animation: dayStoryFloat 3s ease-in-out infinite;
}

.day-story-text {
  font-size: 11px;
  font-weight: 700;
  color: #1F2937;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 250, 251, 0.95) 100%);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

@keyframes dayStoryFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* Емоційне повідомлення про стан дня */
.plate-story-message {
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  padding: 12px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(249, 250, 251, 0.9) 100%);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(255, 107, 53, 0.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.plate-story-message.visible {
  opacity: 1;
  transform: translateY(0);
}

.story-message-content {
  font-size: 14px;
  font-weight: 600;
  color: #1F2937;
  text-align: center;
  line-height: 1.5;
}

.plate-balance-indicator.balanced .balance-status-text {
  color: #16A34A;
}

.plate-balance-indicator.unbalanced .balance-status-text {
  color: #F59E0B;
}

@keyframes balancePulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.8;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.1);
    opacity: 1;
  }
}

/* Hover ефект для тарілки */
.plate-chart:hover {
  transform: scale(1.04);
  box-shadow: 
    0 24px 72px rgba(0, 0, 0, 0.18),
    0 12px 40px rgba(255, 107, 53, 0.3),
    0 0 0 12px rgba(255, 255, 255, 0.95),
    0 0 0 20px rgba(255, 107, 53, 0.12),
    inset 0 6px 16px rgba(255, 255, 255, 0.7),
    inset 0 -3px 10px rgba(0, 0, 0, 0.06);
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Стан балансу - світіння гармонії */
.plate-chart.plate-balanced {
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 10px 30px rgba(34, 197, 94, 0.3),
    0 0 40px rgba(34, 197, 94, 0.25),
    0 0 0 12px rgba(255, 255, 255, 0.95),
    0 0 0 16px rgba(34, 197, 94, 0.2),
    inset 0 6px 16px rgba(255, 255, 255, 0.7),
    inset 0 -3px 10px rgba(0, 0, 0, 0.06);
  animation: balancedGlow 3s ease-in-out infinite;
  border: 2px solid rgba(34, 197, 94, 0.2);
}

/* Стан дисбалансу - візуальне попередження */
.plate-chart.plate-unbalanced {
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 10px 30px rgba(245, 158, 11, 0.25),
    0 0 32px rgba(245, 158, 11, 0.2),
    0 0 0 12px rgba(255, 255, 255, 0.95),
    0 0 0 16px rgba(245, 158, 11, 0.15),
    inset 0 6px 16px rgba(255, 255, 255, 0.7),
    inset 0 -3px 10px rgba(0, 0, 0, 0.06);
  animation: unbalancedPulse 2s ease-in-out infinite;
  border: 2px solid rgba(245, 158, 11, 0.2);
}

@keyframes balancedGlow {
  0%, 100% {
    box-shadow: 
      0 20px 60px rgba(0, 0, 0, 0.15),
      0 10px 30px rgba(34, 197, 94, 0.3),
      0 0 40px rgba(34, 197, 94, 0.25),
      0 0 0 12px rgba(255, 255, 255, 0.95),
      0 0 0 16px rgba(34, 197, 94, 0.2),
      inset 0 6px 16px rgba(255, 255, 255, 0.7),
      inset 0 -3px 10px rgba(0, 0, 0, 0.06);
    border-color: rgba(34, 197, 94, 0.2);
  }
  50% {
    box-shadow: 
      0 20px 60px rgba(0, 0, 0, 0.15),
      0 10px 30px rgba(34, 197, 94, 0.4),
      0 0 50px rgba(34, 197, 94, 0.35),
      0 0 0 12px rgba(255, 255, 255, 0.95),
      0 0 0 18px rgba(34, 197, 94, 0.25),
      inset 0 6px 16px rgba(255, 255, 255, 0.7),
      inset 0 -3px 10px rgba(0, 0, 0, 0.06);
    border-color: rgba(34, 197, 94, 0.3);
  }
}

@keyframes unbalancedPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 
      0 20px 60px rgba(0, 0, 0, 0.15),
      0 10px 30px rgba(245, 158, 11, 0.25),
      0 0 32px rgba(245, 158, 11, 0.2),
      0 0 0 12px rgba(255, 255, 255, 0.95),
      0 0 0 16px rgba(245, 158, 11, 0.15),
      inset 0 6px 16px rgba(255, 255, 255, 0.7),
      inset 0 -3px 10px rgba(0, 0, 0, 0.06);
    border-color: rgba(245, 158, 11, 0.2);
  }
  50% {
    transform: scale(1.01);
    box-shadow: 
      0 20px 60px rgba(0, 0, 0, 0.15),
      0 10px 30px rgba(245, 158, 11, 0.35),
      0 0 40px rgba(245, 158, 11, 0.3),
      0 0 0 12px rgba(255, 255, 255, 0.95),
      0 0 0 18px rgba(245, 158, 11, 0.2),
      inset 0 6px 16px rgba(255, 255, 255, 0.7),
      inset 0 -3px 10px rgba(0, 0, 0, 0.06);
    border-color: rgba(245, 158, 11, 0.3);
  }
}

/* Плавні кольорові переходи для сегментів */
.plate-chart {
  background-image: conic-gradient(
    #E5E7EB 0deg 360deg
  );
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
}

#plateInfo {
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 8px;
  opacity: 0.6;
}

.plate-info-minimal {
  font-size: 11px;
  color: var(--text-light);
  opacity: 0.5;
}

/* ============================
   PLATE ANIMATIONS (WOW-ефекти)
   ============================ */
.plate-chart.animate-eat {
  animation: plateEatWow 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes plateEatWow {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.08) rotate(2deg);
  }
  60% {
    transform: scale(1.05) rotate(-1deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

/* Анімація при додаванні продукту */
.plate-chart.plate-updating {
  animation: plateUpdate 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes plateUpdate {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

/* Пульсація при збалансованому раціоні */
.plate-chart.plate-pulse {
  animation: platePulse 2.5s ease-in-out infinite;
}

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

/* Стан завершення дня - особливе світіння */
.plate-chart.plate-complete {
  animation: plateComplete 3s ease-in-out infinite;
  box-shadow: 
    0 20px 60px rgba(0, 0, 0, 0.15),
    0 10px 30px rgba(34, 197, 94, 0.4),
    0 0 50px rgba(34, 197, 94, 0.3),
    0 0 0 12px rgba(255, 255, 255, 0.95),
    0 0 0 18px rgba(34, 197, 94, 0.25),
    inset 0 6px 16px rgba(255, 255, 255, 0.7),
    inset 0 -3px 10px rgba(0, 0, 0, 0.06);
  border: 2px solid rgba(34, 197, 94, 0.3);
}

@keyframes plateComplete {
  0%, 100% {
    box-shadow: 
      0 20px 60px rgba(0, 0, 0, 0.15),
      0 10px 30px rgba(34, 197, 94, 0.4),
      0 0 50px rgba(34, 197, 94, 0.3),
      0 0 0 12px rgba(255, 255, 255, 0.95),
      0 0 0 18px rgba(34, 197, 94, 0.25),
      inset 0 6px 16px rgba(255, 255, 255, 0.7),
      inset 0 -3px 10px rgba(0, 0, 0, 0.06);
    transform: scale(1);
  }
  50% {
    box-shadow: 
      0 24px 72px rgba(0, 0, 0, 0.18),
      0 12px 36px rgba(34, 197, 94, 0.5),
      0 0 60px rgba(34, 197, 94, 0.4),
      0 0 0 12px rgba(255, 255, 255, 0.95),
      0 0 0 20px rgba(34, 197, 94, 0.3),
      inset 0 6px 16px rgba(255, 255, 255, 0.7),
      inset 0 -3px 10px rgba(0, 0, 0, 0.06);
    transform: scale(1.01);
  }
}

/* ============================
   NUTRITION STATUS INDICATORS
   ============================ */
.nutrition-status-exceeded {
  animation: redPulse 2s ease-in-out infinite;
  border: 2px solid rgba(220, 38, 38, 0.5) !important;
  box-shadow: 0 0 12px rgba(220, 38, 38, 0.3) !important;
}

@keyframes redPulse {
  0%, 100% {
    box-shadow: 0 0 12px rgba(220, 38, 38, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.5);
  }
}

.nutrition-status-balanced {
  border: 2px solid rgba(34, 197, 94, 0.4) !important;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.2) !important;
}

/* ============================
   ADVICE BLOCK (Soft Cards)
   ============================ */
#adviceList li {
  background: var(--accent-soft-green);
  border-radius: var(--radius-md);
  padding: 16px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  transition: all var(--transition-fast);
}

#adviceList li:hover {
  background: #A7F3D0;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

#adviceList li + li {
  margin-top: 12px;
}

#adviceList .font-medium {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
}

#adviceList .text-xs {
  margin-top: 6px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ============================
   LIST FADE IN ANIMATION
   ============================ */
#adviceList li,
#analysisList li {
  animation: fadeInUp 0.4s ease both;
}

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

/* ============================
   GUT VISUAL (STOMACH)
   ============================ */
#stomach,
#intestine {
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.4);
}

#stomach:hover,
#intestine:hover {
  transform: scale(1.06);
}

/* ============================
   BOTTOM NAVIGATION (Modern)
   ============================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;

  height: 72px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid rgba(0, 0, 0, 0.08);

  display: flex;
  justify-content: space-around;
  align-items: center;

  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 
    0 -4px 16px rgba(0, 0, 0, 0.06),
    0 -2px 8px rgba(255, 107, 53, 0.05);
}

.bottom-nav button {
  background: none;
  border: none;
  padding: 10px 16px;
  min-height: auto;

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;

  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  
  transition: all var(--transition-smooth);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.bottom-nav button span {
  font-size: 22px;
  transition: all var(--transition-smooth);
  line-height: 1;
}

.bottom-nav button.active {
  color: var(--accent-green);
  background: var(--accent-green-soft);
}

.bottom-nav button.active span {
  transform: scale(1.08);
}

.bottom-nav button:active {
  transform: scale(0.96);
}

.bottom-nav button:hover:not(.active) {
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.02);
}

/* ============================
   MOBILE FIRST SCROLL FEEL
   ============================ */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 10px;
}

/* ============================
   ЗАГАЛЬНІ СТИЛІ КАРТОК (ЕТАЛОННИЙ СТИЛЬ)
   ============================ */

/* Стандартні картки для всіх вкладок */
.home-card-standard,
.analysis-card-standard,
.ration-card-standard,
.settings-card-standard {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 251, 248, 0.95) 100%);
  backdrop-filter: blur(12px);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 
    0 6px 24px rgba(0, 0, 0, 0.08),
    0 3px 12px rgba(255, 107, 53, 0.1),
    0 1px 4px rgba(255, 179, 71, 0.06);
}

.home-card-standard::before,
.analysis-card-standard::before,
.ration-card-standard::before,
.settings-card-standard::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-orange) 0%, var(--accent-tomato) 100%);
  border-radius: 0 4px 4px 0;
}

.home-card-standard:hover,
.analysis-card-standard:hover,
.ration-card-standard:hover,
.settings-card-standard:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 10px 36px rgba(0, 0, 0, 0.1),
    0 5px 18px rgba(255, 107, 53, 0.15),
    0 2px 6px rgba(255, 179, 71, 0.1);
}

/* Стилі для елементів всередині карток */
.home-card-standard h2,
.analysis-card-standard h2,
.ration-card-standard h2,
.settings-card-standard h2 {
  color: #1F2937;
  font-weight: 600;
  font-size: 18px;
  margin-bottom: 20px;
  line-height: 1.3;
}

/* Стилі для labels всередині карток */
.home-card-standard label,
.analysis-card-standard label,
.ration-card-standard label,
.settings-card-standard label {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
  display: block;
}

/* Стилі для input та select всередині карток */
.home-card-standard input,
.home-card-standard select,
.settings-card-standard input,
.settings-card-standard select,
.analysis-card-standard input,
.analysis-card-standard select,
.ration-card-standard input,
.ration-card-standard select {
  background: linear-gradient(135deg, #FFFFFF 0%, #FFFBF8 100%);
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-size: 14px;
  padding: 12px;
}

.home-card-standard input:focus,
.home-card-standard select:focus,
.settings-card-standard input:focus,
.settings-card-standard select:focus,
.analysis-card-standard input:focus,
.analysis-card-standard select:focus,
.ration-card-standard input:focus,
.ration-card-standard select:focus {
  background: #FFFFFF;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
  outline: none;
}

/* Стилі для кнопок всередині карток */
.home-card-standard button,
.settings-card-standard button,
.analysis-card-standard button,
.ration-card-standard button {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 12px;
}

.home-card-standard button:hover:not(:disabled),
.settings-card-standard button:hover:not(:disabled),
.analysis-card-standard button:hover:not(:disabled),
.ration-card-standard button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.home-card-standard button:active:not(:disabled),
.settings-card-standard button:active:not(:disabled),
.analysis-card-standard button:active:not(:disabled),
.ration-card-standard button:active:not(:disabled) {
  transform: scale(0.98);
}

/* ============================
   ВКЛАДКА "ЇЖА" - ЕТАЛОННИЙ ДИЗАЙН
   ============================ */

/* Статус дня на вкладці Їжа */
.food-tab-status-card {
  backdrop-filter: blur(12px);
  box-shadow: 
    0 4px 20px rgba(0, 0, 0, 0.06),
    0 2px 8px rgba(255, 107, 53, 0.1),
    0 1px 4px rgba(255, 179, 71, 0.06);
}

/* Форма додавання продукту */
.add-food-form-card {
  backdrop-filter: blur(12px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 251, 248, 0.95) 100%);
  box-shadow: 
    0 6px 24px rgba(0, 0, 0, 0.08),
    0 3px 12px rgba(255, 107, 53, 0.12),
    0 1px 4px rgba(255, 179, 71, 0.08);
}

/* Вибір продукту (великий) */
.food-select-large {
  font-size: 16px;
  font-weight: 500;
  background: linear-gradient(135deg, #FFFFFF 0%, #FFFBF8 100%);
}

.food-select-large:focus {
  background: #FFFFFF;
  border-color: var(--accent-orange);
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
}

/* Прев'ю вибраного продукту */
.selected-food-preview {
  background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
  border-left: 4px solid #22C55E;
  padding: 10px 14px;
  border-radius: 12px;
  animation: slideInFeedback 0.3s ease;
}

.selected-food-preview strong {
  color: #15803D;
  font-weight: 600;
}

/* Швидкі кнопки для типу прийому */
.meal-type-quick-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.meal-type-btn {
  flex: 1;
  min-width: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #FFFFFF 0%, #FFFBF8 100%);
  border: 2px solid #E5E7EB;
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: #6B7280;
}

.meal-type-btn:hover {
  border-color: var(--accent-orange);
  background: linear-gradient(135deg, #FFF4F0 0%, #FFEBE5 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.15);
}

.meal-type-btn.active {
  background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-tomato) 100%);
  border-color: var(--accent-orange);
  color: white;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
  transform: translateY(-2px);
}

.meal-type-icon {
  font-size: 24px;
  line-height: 1;
}

.meal-type-label {
  font-size: 12px;
  font-weight: 600;
}

/* Швидкі кнопки для порції */
.portion-quick-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.portion-btn {
  flex: 1;
  min-width: 70px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #FFFFFF 0%, #FFFBF8 100%);
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  color: #6B7280;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}

.portion-btn:hover {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, #FFFBF0 0%, #FFEDD5 100%);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 179, 71, 0.2);
}

.portion-btn.active {
  background: linear-gradient(135deg, var(--accent-gold) 0%, #FFC966 100%);
  border-color: var(--accent-gold);
  color: white;
  box-shadow: 0 2px 12px rgba(255, 179, 71, 0.3);
}

.portion-custom-input {
  flex: 1;
  min-width: 100px;
  padding: 10px 16px;
  border: 2px solid #E5E7EB;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
}

.portion-custom-input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(255, 179, 71, 0.1);
}

/* Головна кнопка додавання */
.add-food-btn-primary {
  background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-tomato) 100%);
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.3);
  border: none;
}

.add-food-btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--accent-tomato) 0%, var(--accent-orange) 100%);
  box-shadow: 0 6px 24px rgba(255, 107, 53, 0.4);
}

.add-food-btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.add-food-btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

/* Контейнер прийомів їжі */
.meals-by-type-container {
  margin-bottom: 2rem;
}

/* Картка прийому їжі */
.meal-type-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 251, 248, 0.95) 100%);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 
    0 6px 24px rgba(0, 0, 0, 0.08),
    0 3px 12px rgba(255, 107, 53, 0.12),
    0 1px 4px rgba(255, 179, 71, 0.08);
  border: 1px solid rgba(255, 107, 53, 0.12);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.meal-type-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent-orange) 0%, var(--accent-tomato) 100%);
  border-radius: 0 4px 4px 0;
}

.meal-type-card:hover {
  transform: translateY(-4px);
  box-shadow: 
    0 10px 36px rgba(0, 0, 0, 0.1),
    0 5px 18px rgba(255, 107, 53, 0.18),
    0 2px 6px rgba(255, 179, 71, 0.12);
}

/* Заголовок прийому */
.meal-type-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(255, 107, 53, 0.1);
}

.meal-type-header-icon {
  font-size: 32px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.meal-type-header-info {
  flex: 1;
}

.meal-type-header-name {
  font-size: 20px;
  font-weight: 700;
  color: #1F2937;
  margin-bottom: 4px;
}

.meal-type-header-count {
  font-size: 13px;
  color: #6B7280;
  font-weight: 500;
}

.meal-type-header-calories {
  text-align: right;
}

.meal-type-header-calories-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-orange);
  line-height: 1;
}

.meal-type-header-calories-label {
  font-size: 11px;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Список продуктів в прийомі */
.meal-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Картка продукту */
.meal-item-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96) 0%, rgba(255, 251, 248, 0.92) 100%);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 107, 53, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 1px 4px rgba(255, 107, 53, 0.06);
  backdrop-filter: blur(8px);
}

.meal-item-card:hover {
  border-color: rgba(255, 107, 53, 0.25);
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.06),
    0 2px 8px rgba(255, 107, 53, 0.12),
    0 1px 4px rgba(255, 179, 71, 0.08);
  transform: translateX(4px);
}

.meal-item-card.new-item {
  border-left: 4px solid var(--accent-orange);
  background: linear-gradient(90deg, var(--accent-orange-soft) 0%, #FFFFFF 100%);
  animation: slideInFromRight 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.meal-item-name {
  font-size: 16px;
  font-weight: 600;
  color: #1F2937;
  margin-bottom: 6px;
  line-height: 1.3;
}

.meal-item-details {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meal-item-detail {
  font-size: 13px;
  color: #6B7280;
  font-weight: 500;
}

.meal-item-detail-value {
  color: var(--accent-orange);
  font-weight: 600;
}

.meal-item-time {
  font-size: 12px;
  color: #9CA3AF;
  padding: 4px 8px;
  background: rgba(255, 107, 53, 0.05);
  border-radius: 8px;
}

.meal-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meal-item-delete-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  color: #EF4444;
  font-size: 16px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.meal-item-delete-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  transform: scale(1.1);
}

.meal-item-delete-btn:active {
  transform: scale(0.95);
}

/* Empty state для прийому */
.meal-empty-state {
  text-align: center;
  padding: 32px 20px;
  background: linear-gradient(135deg, rgba(255, 248, 245, 0.5) 0%, rgba(255, 240, 230, 0.3) 100%);
  border-radius: 16px;
  border: 2px dashed rgba(255, 107, 53, 0.2);
}

.meal-empty-state-text {
  font-size: 14px;
  color: #9CA3AF;
  margin-bottom: 12px;
}

.add-to-meal-btn {
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--accent-orange-soft) 0%, #FFF4F0 100%);
  border: 2px solid var(--accent-orange);
  border-radius: 12px;
  color: var(--accent-orange);
  font-size: 13px;
  font-weight: 600;
  transition: all 0.3s ease;
  cursor: pointer;
}

.add-to-meal-btn:hover {
  background: linear-gradient(135deg, var(--accent-orange) 0%, var(--accent-tomato) 100%);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

/* Повний empty state */
.food-tab-empty-full {
  backdrop-filter: blur(10px);
}

.empty-icon {
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.empty-title {
  color: #1F2937;
}

.empty-description {
  color: #6B7280;
}

.empty-hint {
  color: #9CA3AF;
}

/* М'які тіні */
.shadow-soft {
  box-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.04),
    0 1px 4px rgba(0, 0, 0, 0.02);
}

.shadow-soft-lg {
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.06),
    0 2px 8px rgba(0, 0, 0, 0.03);
}

/* Кольори для різних прийомів */
.meal-type-card.breakfast::before {
  background: linear-gradient(180deg, #FFB347 0%, #FFD700 100%);
}

.meal-type-card.lunch::before {
  background: linear-gradient(180deg, var(--accent-orange) 0%, var(--accent-tomato) 100%);
}

.meal-type-card.dinner::before {
  background: linear-gradient(180deg, #8B5CF6 0%, #A78BFA 100%);
}

.meal-type-card.snack::before {
  background: linear-gradient(180deg, #4ECDC4 0%, #6EDDD6 100%);
}

/* Назва продукту - головний акцент */
#todayMealsList li .font-medium {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
  display: block;
}

/* Мета-інформація (порція, час) */
#todayMealsList li .text-xs {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Тег прийому їжі (badge) */
#todayMealsList li .bg-blue-100 {
  background: var(--accent-soft-blue);
  color: #1E40AF;
  border: none;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
}

/* Кнопка видалення (мінімалістична) */
.delete-meal-btn {
  background: none !important;
  border: none !important;
  color: var(--text-muted) !important;
  font-size: 18px !important;
  padding: 4px 8px !important;
  min-height: auto !important;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  cursor: pointer;
  opacity: 0.6;
}

.delete-meal-btn:hover {
  background: var(--error-soft) !important;
  color: var(--error) !important;
  opacity: 1;
  transform: scale(1.1);
}

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

/* Порожній стан */
#noTodayMeals {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  padding: 32px 16px;
  background: #FAFAFA;
  border-radius: var(--radius-md);
  border: 1px dashed #E5E7EB;
}

/* ============================
   ПРИЙОМИ ЇЖІ (Clean Sections)
   ============================ */
#rationBreakfast,
#rationLunch,
#rationDinner,
#rationAfternoonSnack,
#rationEveningSnack {
  min-height: 40px;
}

#rationBreakfast li,
#rationLunch li,
#rationDinner li,
#rationAfternoonSnack li,
#rationEveningSnack li {
  background: #FAFAFA;
  border-radius: var(--radius-md);
  padding: 12px;
  border: 1px solid #F3F4F6;
  transition: all var(--transition-fast);
  animation: fadeInUp 0.25s ease both;
}

#rationBreakfast li:hover,
#rationLunch li:hover,
#rationDinner li:hover,
#rationAfternoonSnack li:hover,
#rationEveningSnack li:hover {
  background: var(--card-bg);
  border-color: #E5E7EB;
  box-shadow: var(--shadow-sm);
}

/* Заголовки прийомів їжі */
h3.text-sm.font-medium {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Анімації для форми */
@keyframes formSuccess {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.01);
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.08),
      0 4px 16px rgba(255, 107, 53, 0.2);
  }
}

@keyframes formHighlight {
  0%, 100% {
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.06),
      0 2px 8px rgba(255, 107, 53, 0.08);
  }
  50% {
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.1),
      0 4px 16px rgba(255, 107, 53, 0.3);
  }
}

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

/* Порожній стан прийому їжі */
#rationBreakfast .text-xs.text-gray-500,
#rationLunch .text-xs.text-gray-500,
#rationDinner .text-xs.text-gray-500,
#rationAfternoonSnack .text-xs.text-gray-500,
#rationEveningSnack .text-xs.text-gray-500 {
  color: var(--text-muted);
  font-style: italic;
  padding: 16px;
  text-align: center;
  background: #FAFAFA;
  border-radius: var(--radius-md);
  border: 1px dashed #E5E7EB;
}

/* ============================
   АНІМАЦІЇ (Smooth Transitions)
   ============================ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-out {
  animation: fadeOut 0.25s ease both;
}

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

/* ============================
   СТАТУСИ ТА БЕЙДЖИ
   ============================ */
.text-xs.px-2.py-1.rounded,
.text-xs.px-3.py-1.rounded-full {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

/* UNDO Notification */
#undoNotification {
  background: var(--accent-soft-blue);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  animation: fadeInUp 0.3s ease;
}

#undoBtn {
  background: var(--accent-blue) !important;
  color: white !important;
  padding: 6px 16px !important;
  min-height: auto !important;
  font-size: 13px !important;
  border-radius: var(--radius-sm) !important;
}

#undoBtn:hover {
  background: #2563EB !important;
}

/* ============================
   ДОДАТКОВІ ПОЛІПШЕННЯ
   ============================ */
/* Стан організму - більш читабельний */
#energy, #glucose, #enzymes, #water {
  font-weight: 700;
  /* Колір визначається через батьківські класи */
}

/* Статус дня - м'який градієнт */
.bg-gradient-to-r {
  background: linear-gradient(135deg, var(--accent-soft-blue) 0%, var(--accent-soft-purple) 100%);
  border: 1px solid rgba(139, 92, 246, 0.2);
}

/* ============================
   DESKTOP = PHONE PREVIEW
   ============================ */
@media (min-width: 768px) {
  body {
    background: var(--bg-app);
    background-image: url('image/background.png');
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
  }
  
  body::before {
    background: rgba(255, 248, 245, 0.94);
  }
  
  [data-theme="dark"] body::before {
    background: rgba(18, 18, 18, 0.92);
  }

  .max-w-md {
    max-width: 420px;
    margin: 0 auto;
  }
  
  /* Ховаємо bottom navigation на desktop */
  .bottom-nav {
    display: none;
  }
}

/* ============================
   ONBOARDING (UX Guide)
   ============================ */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  pointer-events: none;
}

.onboarding-overlay:not(.hidden) {
  pointer-events: auto;
}

.onboarding-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.onboarding-overlay:not(.hidden) .onboarding-backdrop {
  opacity: 1;
}

.onboarding-tooltip {
  position: absolute;
  z-index: 10001;
  max-width: 320px;
  min-width: 280px;
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  border: 2px solid var(--accent-purple);
  opacity: 0;
  transform: scale(0.9) translateY(10px);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.onboarding-overlay:not(.hidden) .onboarding-tooltip {
  opacity: 1;
  transform: scale(1) translateY(0);
}

.onboarding-content {
  padding: 24px;
}

.onboarding-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.onboarding-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.onboarding-progress {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--accent-purple-soft);
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-purple);
  margin-bottom: 20px;
}

.onboarding-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.onboarding-btn-primary {
  padding: 10px 20px;
  background: var(--accent-purple);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-smooth);
  box-shadow: var(--shadow-sm);
}

.onboarding-btn-primary:hover {
  background: var(--accent-lavender-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.onboarding-btn-secondary {
  padding: 10px 20px;
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--card-border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-smooth);
}

.onboarding-btn-secondary:hover {
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-main);
}

[data-theme="dark"] .onboarding-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
}

.onboarding-highlight {
  position: relative;
  z-index: 10002 !important;
  outline: 3px solid var(--accent-purple) !important;
  outline-offset: 4px !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6) !important;
  animation: onboardingPulse 2s ease-in-out infinite;
}

@keyframes onboardingPulse {
  0%, 100% {
    outline-color: var(--accent-purple);
    outline-width: 3px;
  }
  50% {
    outline-color: var(--accent-lavender);
    outline-width: 4px;
  }
}

/* ============================
   FIRST LAUNCH ONBOARDING (простий onboarding для першого запуску)
   ============================ */
.first-launch-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.first-launch-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: all;
}

.first-launch-content {
  background: white;
  border-radius: 24px;
  padding: 32px 24px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.first-launch-overlay:not(.hidden) .first-launch-content {
  transform: scale(1);
}

.first-launch-icon {
  font-size: 64px;
  margin-bottom: 16px;
  animation: none; /* Без складних анімацій */
}

.first-launch-title {
  font-size: 24px;
  font-weight: bold;
  color: #1f2937;
  margin-bottom: 12px;
}

.first-launch-text {
  font-size: 15px;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 24px;
}

.first-launch-action-btn {
  width: 100%;
  background: linear-gradient(135deg, #FF6B35 0%, #FF8C42 100%);
  color: white;
  font-size: 16px;
  font-weight: 600;
  padding: 14px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(255, 107, 53, 0.3);
}

.first-launch-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 107, 53, 0.4);
}

.first-launch-action-btn:active {
  transform: translateY(0);
}

.first-launch-overlay.hidden {
  display: none;
}

/* ============================
   ВІЗУАЛЬНІ НАГОРОДИ ЗА ДІЇ (МОТИВАЦІЯ)
   ============================ */

/* Контейнер для нагород */
.reward-container {
  max-width: 90%;
  width: auto;
}

/* Базова стилізація нагороди */
.reward-message {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 16px;
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.12),
    0 4px 12px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  margin-bottom: 12px;
  pointer-events: auto;
  animation: rewardSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  transform: translateY(100px);
  opacity: 0;
}

.reward-message.hidden {
  display: none;
}

.reward-message.show {
  display: flex;
  animation: rewardSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.reward-message.hide {
  animation: rewardSlideOut 0.3s ease-in forwards;
}

/* Нагорода за додавання продукту */
.reward-add {
  background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
  border: 2px solid rgba(34, 197, 94, 0.3);
  border-left: 4px solid #22C55E;
}

.reward-add .reward-icon {
  font-size: 24px;
  animation: rewardBounce 0.6s ease 0.2s;
}

.reward-add .reward-text {
  color: #15803D;
  font-weight: 600;
  font-size: 15px;
}

/* Нагорода за завершення прийому */
.reward-meal {
  background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
  border: 2px solid rgba(255, 107, 53, 0.3);
  border-left: 4px solid var(--accent-orange);
}

.reward-meal .reward-icon {
  font-size: 28px;
  animation: rewardCelebrate 0.8s ease 0.2s;
}

.reward-meal .reward-text {
  color: #C2410C;
  font-weight: 600;
  font-size: 15px;
}

/* Нагорода за покращення балансу */
.reward-balance {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-left: 4px solid #3B82F6;
}

.reward-balance .reward-icon {
  font-size: 24px;
  animation: rewardRotate 0.6s ease 0.2s;
}

.reward-balance .reward-text {
  color: #1E40AF;
  font-weight: 600;
  font-size: 15px;
}

/* Іконка нагороди */
.reward-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
}

/* Текст нагороди */
.reward-text {
  white-space: nowrap;
  line-height: 1.4;
}

/* Анімації */
@keyframes rewardSlideIn {
  from {
    transform: translateY(100px) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes rewardSlideOut {
  from {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateY(-50px) scale(0.9);
    opacity: 0;
  }
}

@keyframes rewardBounce {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  25% {
    transform: scale(1.2) rotate(-10deg);
  }
  50% {
    transform: scale(1.1) rotate(10deg);
  }
  75% {
    transform: scale(1.15) rotate(-5deg);
  }
}

@keyframes rewardCelebrate {
  0%, 100% {
    transform: scale(1) rotate(0deg);
  }
  10%, 30%, 50%, 70%, 90% {
    transform: scale(1.3) rotate(15deg);
  }
  20%, 40%, 60%, 80% {
    transform: scale(1.3) rotate(-15deg);
  }
}

@keyframes rewardRotate {
  0% {
    transform: rotate(0deg) scale(1);
  }
  50% {
    transform: rotate(180deg) scale(1.1);
  }
  100% {
    transform: rotate(360deg) scale(1);
  }
}

/* М'яка підсвітка картки прийому при завершенні */
.meal-type-card.meal-completed {
  animation: mealCompleteGlow 1.2s ease;
}

@keyframes mealCompleteGlow {
  0%, 100% {
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.06),
      0 2px 8px rgba(255, 107, 53, 0.08);
  }
  50% {
    box-shadow: 
      0 8px 32px rgba(0, 0, 0, 0.1),
      0 4px 16px rgba(255, 107, 53, 0.25),
      0 0 0 4px rgba(255, 107, 53, 0.1);
  }
}

/* М'яка підсвітка статусу при покращенні балансу */
.food-tab-status-card.balance-improved {
  animation: balanceImprovedPulse 1s ease;
}

@keyframes balanceImprovedPulse {
  0%, 100% {
    border-color: rgba(255, 107, 53, 0.3);
  }
  50% {
    border-color: rgba(59, 130, 246, 0.5);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  }
}

/* ============================
   ВБУДОВАНІ ПОЗИТИВНІ ПОВІДОМЛЕННЯ (ДОФАМІН)
   ============================ */

/* Повідомлення про додавання продукту */
.positive-feedback-message {
  background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-left: 4px solid #22C55E;
  border-radius: 12px;
  padding: 12px 16px;
  animation: slideInFeedback 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.positive-feedback-message .feedback-icon {
  font-size: 18px;
  animation: bounce 0.6s ease;
}

.positive-feedback-message .feedback-text {
  color: #15803D;
  flex: 1;
}

@keyframes slideInFeedback {
  from {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    padding: 0 16px;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 100px;
    padding: 12px 16px;
  }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Повідомлення про прогрес до норми */
.progress-feedback-message {
  background: linear-gradient(135deg, #FFF7ED 0%, #FFEDD5 100%);
  border: 1px solid rgba(255, 107, 53, 0.3);
  border-left: 4px solid #FF6B35;
  border-radius: 12px;
  padding: 12px 16px;
  animation: slideInFeedback 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-feedback-message .progress-icon {
  font-size: 18px;
  animation: pulse 2s ease-in-out infinite;
}

.progress-feedback-message .progress-text {
  color: #C2410C;
  flex: 1;
}

/* Бейдж досягнення норми */
.norm-achievement-badge {
  background: linear-gradient(135deg, #FFB347 0%, #FFD700 100%);
  color: white;
  border-radius: 20px;
  padding: 6px 12px;
  box-shadow: 0 2px 8px rgba(255, 179, 71, 0.3);
  animation: popIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: flex;
  align-items: center;
  gap: 6px;
}

.norm-achievement-badge .achievement-icon {
  font-size: 16px;
  animation: celebrate 0.6s ease;
}

.norm-achievement-badge .achievement-text {
  font-size: 11px;
  white-space: nowrap;
}

/* Повідомлення про баланс БЖУ */
.balance-feedback-message {
  background: linear-gradient(135deg, #F0F9FF 0%, #E0F2FE 100%);
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-left: 4px solid #3B82F6;
  border-radius: 12px;
  padding: 12px 16px;
  animation: slideInFeedback 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 8px;
}

.balance-feedback-message .balance-icon {
  font-size: 18px;
  animation: rotate 0.6s ease;
}

.balance-feedback-message .balance-text {
  color: #1E40AF;
  flex: 1;
}

@keyframes rotate {
  0% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
  100% { transform: rotate(0deg); }
}

/* Мікро-анімація для прогрес-барів при оновленні */
.progress-bar-updated {
  animation: progressGlow 0.6s ease;
}

@keyframes progressGlow {
  0%, 100% {
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
  }
  50% {
    box-shadow: 0 2px 16px rgba(255, 107, 53, 0.5);
  }
}

/* Анімація для показників стану організму */
.indicator-updated {
  animation: indicatorPulse 0.5s ease;
}

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

/* Плавне зникнення повідомлень */
.positive-feedback-message.fade-out,
.progress-feedback-message.fade-out,
.balance-feedback-message.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
    max-height: 100px;
    padding: 12px 16px;
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    padding: 0 16px;
    margin: 0;
  }
}


