/* ==========================================================================
   NUTRIGURU — MODERN PREMIUM MEALS & NUTRITION DESIGN SYSTEM
   Apple Health × Whoop × Dark Futuristic Health-Tech
   ========================================================================== */

:root {
  --ng-bg-primary: #070D14;
  --ng-bg-secondary: #0B151C;
  --ng-surface: rgba(15, 28, 34, 0.72);
  --ng-surface-elevated: rgba(22, 38, 48, 0.85);

  --accent-lime: #B7FF00;
  --accent-orange: #FF9F1A;
  --accent-cyan: #22D3EE;
  --accent-green: #52E6A8;
  --accent-purple: #A970FF;
  --accent-amber: #FBBF24;
  --accent-rose: #FB7185;

  --text-primary: #F4F7F8;
  --text-secondary: #A8B1B8;
  --text-muted: #68757D;

  --ng-border: rgba(255, 255, 255, 0.08);
  --ng-border-subtle: rgba(255, 255, 255, 0.04);
  --ng-radius-sm: 12px;
  --ng-radius-md: 16px;
  --ng-radius-lg: 22px;
  --ng-radius-xl: 26px;
}

/* Base Meals Page Container */
.meals-page {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  padding-bottom: calc(96px + env(safe-area-inset-bottom, 16px)) !important;
  color: var(--text-primary);
}

@media (min-width: 1024px) {
  .meals-page {
    max-width: 900px;
  }
}

/* ==========================================================================
   1. HERO — TODAY NUTRITION CARD (LEVEL 1)
   ========================================================================== */
.nutrition-hero-card {
  position: relative;
  background: linear-gradient(145deg, rgba(14, 26, 32, 0.9) 0%, rgba(9, 18, 23, 0.95) 100%);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--ng-radius-xl);
  padding: 18px 20px;
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow: hidden;
}

.nutrition-hero-card::before {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(183, 255, 0, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.nutrition-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.nutrition-hero-copy {
  flex: 1;
  min-width: 0;
}

.nutrition-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-lime);
  margin-bottom: 4px;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent-lime);
  box-shadow: 0 0 8px var(--accent-lime);
  animation: pulse-subtle 2s infinite ease-in-out;
}

@keyframes pulse-subtle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

.nutrition-hero-numbers {
  display: flex;
  align-items: baseline;
  gap: 6px;
  line-height: 1;
}

.nutrition-hero-big-val {
  font-size: clamp(38px, 9vw, 48px);
  font-weight: 900;
  letter-spacing: -0.03em;
  color: #FFFFFF;
}

.nutrition-hero-unit {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-secondary);
}

.nutrition-hero-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.nutrition-hero-remaining-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 4px 10px;
  background: rgba(183, 255, 0, 0.08);
  border: 1px solid rgba(183, 255, 0, 0.2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-lime);
}

/* Circular SVG Progress Ring */
.nutrition-hero-ring-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.nutrition-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 8;
}

.nutrition-ring-progress {
  fill: none;
  stroke: url(#calRingGrad);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.nutrition-ring-inner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1;
}

.nutrition-ring-pct {
  font-size: 19px;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

.nutrition-ring-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Quick Macros Panel (3-columns inside hero) */
.nutrition-macros-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 12px;
  background: rgba(8, 16, 22, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: var(--ng-radius-md);
  margin-bottom: 12px;
}

.macro-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.macro-cell-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.macro-cell-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.macro-cell-goal {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

.macro-cell-val-row {
  display: flex;
  align-items: baseline;
  gap: 2px;
}

.macro-cell-val {
  font-size: 17px;
  font-weight: 900;
  line-height: 1.1;
}

.macro-cell-unit {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.macro-bar-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 4px;
}

.macro-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Nutrition Score Strip */
.nutrition-score-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.nutrition-score-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nutrition-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid;
  font-size: 11px;
  font-weight: 800;
}

.nutrition-score-info {
  line-height: 1.15;
}

.nutrition-score-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.nutrition-score-sub {
  font-size: 11px;
  font-weight: 700;
}

.nutrition-score-bar-wrap {
  flex: 1;
  max-width: 100px;
}

.nutrition-score-bar-track {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.nutrition-score-bar-fill {
  height: 100%;
  border-radius: 999px;
}

/* ==========================================================================
   2. PRIMARY FOOD CTA (+ ДОБАВИТЬ ЕДУ — ORANGE)
   ========================================================================== */
.meals-add-food-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 20px;
  background: linear-gradient(135deg, #FF9F1A 0%, #FF7A00 100%);
  color: #070D14;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.01em;
  border: none;
  border-radius: var(--ng-radius-md);
  box-shadow: 0 8px 24px -6px rgba(255, 159, 26, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.meals-add-food-cta:hover,
.meals-add-food-cta:focus-visible {
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -4px rgba(255, 159, 26, 0.5);
}

.meals-add-food-cta:active {
  transform: scale(0.98);
}

/* ==========================================================================
   3. PILL TABS
   ========================================================================== */
.pill-tab {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pill-tab.active {
  background: var(--accent-lime);
  color: #070D14;
  border-color: var(--accent-lime);
  font-weight: 800;
  box-shadow: 0 4px 14px -3px rgba(183, 255, 0, 0.35);
}
