/* ==========================================================================
   PIANO ALIMENTARE - MODERN DARK BLUE THEME
   High-readability, mobile-first design with smooth horizontal swipe sliders
   ========================================================================== */

:root {
  /* Dark Blue Color Palette */
  --bg-deep: #050b1a;
  --bg-main: #09132e;
  --bg-header: #0d1b40;
  --bg-surface: #122452;
  --bg-surface-hover: #19316d;
  --bg-surface-active: #1e3b82;
  --bg-card: #11224d;
  --bg-card-alt: #162c64;
  
  /* Borders and Glass */
  --border-subtle: rgba(56, 189, 248, 0.16);
  --border-bright: rgba(56, 189, 248, 0.45);
  --border-active: #38bdf8;
  --glass-bg: rgba(13, 27, 64, 0.85);
  
  /* High Contrast Typography */
  --text-white: #ffffff;
  --text-primary: #f8fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  /* Accents */
  --accent-cyan: #38bdf8;
  --accent-sky: #60a5fa;
  --accent-cobalt: #2563eb;
  --accent-emerald: #34d399;
  --accent-gold: #f59e0b;
  --accent-amber-glow: #fbbf24;
  --accent-free-grad: linear-gradient(135deg, #ec4899, #8b5cf6);
  
  /* Shadows & Radius */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.6);
  --shadow-cyan: 0 4px 20px rgba(56, 189, 248, 0.2);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 9999px;
  
  /* Fonts */
  --font-sans: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

/* Base Reset & Mobile Polish */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-family: var(--font-sans);
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(circle at 50% 0%, #10265c 0%, var(--bg-deep) 75%);
  background-attachment: fixed;
  color: var(--text-primary);
  position: relative;
  overflow-x: hidden;
  padding-bottom: 40px;
}

/* Ambient glow subtle background accents */
.ambient-glow {
  position: fixed;
  top: -100px;
  right: -50px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 19, 46, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0;
}

.header-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 12px 16px 8px;
  width: 100%;
}

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

.user-badge {
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent-cobalt), var(--accent-cyan));
  color: var(--text-white);
  font-weight: 800;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(56, 189, 248, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.user-meta {
  display: flex;
  flex-direction: column;
}

.user-label {
  font-size: 0.72rem;
  letter-spacing: 1.2px;
  font-weight: 700;
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.user-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.3px;
}

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

.icon-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:active {
  transform: scale(0.92);
  background: var(--bg-surface-active);
  border-color: var(--accent-cyan);
}

/* ==========================================================================
   NAVIGATION TABS (2 Tabs)
   ========================================================================== */
.main-tabs {
  display: flex;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
  width: 100%;
}

.tab-btn {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 9px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.tab-btn.active {
  background: var(--bg-surface-active);
  border-color: var(--border-active);
  color: var(--text-white);
  box-shadow: 0 2px 14px rgba(56, 189, 248, 0.25);
}

.tab-icon {
  font-size: 1.05rem;
}

/* ==========================================================================
   MAIN CONTENT & SECTIONS
   ========================================================================== */
.app-main {
  padding: 16px 16px 20px;
  max-width: 680px;
  margin: 0 auto;
}

.tab-content {
  display: none;
  animation: fadeIn 0.25s ease;
}

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

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

/* Helper Banner */
.swipe-banner {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  line-height: 1.4;
}

.swipe-banner strong {
  color: var(--accent-cyan);
}

.swipe-banner-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* Feed of Sliders */
.all-sliders-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ==========================================================================
   MEAL & DAY BLOCKS (CAROUSEL SLIDERS)
   ========================================================================== */
.meal-block {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.meal-block:hover {
  border-color: rgba(56, 189, 248, 0.35);
}

.meal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(20, 39, 87, 0.7), transparent);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.meal-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.meal-name {
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-white);
}

.badge-alt-count {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
}

/* Quick Navigation Row for Days (G1 .. G7) */
.slider-quick-nav {
  display: flex;
  gap: 6px;
  padding: 10px 16px 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.slider-quick-nav::-webkit-scrollbar {
  display: none;
}

.day-jump-btn {
  flex: 1;
  min-width: 38px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 6px 0;
  border-radius: var(--radius-pill);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.day-jump-btn.active {
  background: var(--bg-surface-active);
  border-color: var(--accent-cyan);
  color: var(--text-white);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.35);
}

/* Horizontal Track */
.slider-wrapper {
  position: relative;
  padding: 10px 0 8px;
}

.slider-track {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 16px 14px;
  scrollbar-width: none;
}

.slider-track::-webkit-scrollbar {
  display: none;
}

/* Slider Card */
.slider-card {
  flex: 0 0 calc(100% - 24px);
  max-width: 520px;
  scroll-snap-align: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
}

.slider-card.selected-option {
  border-color: var(--accent-emerald);
  background: linear-gradient(135deg, rgba(16, 39, 87, 0.95), rgba(6, 42, 60, 0.95));
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.25);
}

.slider-card.selected-option::after {
  content: '✓ SELEZIONATA';
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

/* Don't show absolute badge on day cards since they have integrated status */
.day-slider-card.selected-option::after {
  display: none;
}

/* Day Slider Card Specific Styles */
.day-slider-card {
  gap: 12px;
}

.day-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.day-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.day-card-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.day-meal-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.day-meal-title {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--accent-sky);
  display: flex;
  align-items: center;
  gap: 6px;
}

.day-meal-title.dinner {
  color: #c084fc;
}

.day-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  margin: 4px 0;
}

/* Top info in option card */
.card-top-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.opt-pill {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

.opt-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-white);
}

/* Ingredients list */
.ingredients-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.ingredient-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.94rem;
  line-height: 1.5;
  color: var(--text-secondary);
}

.ingredient-bullet {
  color: var(--accent-cyan);
  font-size: 1.25rem;
  line-height: 1.2;
  flex-shrink: 0;
  margin-top: 1px;
}

.ingredient-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ingredient-text {
  line-height: 1.5;
  color: var(--text-secondary);
  word-break: break-word;
}

.clarification-text {
  color: #93c5fd;
  font-size: 0.88rem;
  font-style: italic;
  font-weight: 500;
  margin-left: 3px;
}

.ingredient-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-left: 3px solid var(--accent-cyan);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  margin-top: 5px;
  font-size: 0.82rem;
  color: #e2e8f0;
  line-height: 1.4;
  width: 100%;
}

.tip-bulb {
  font-size: 1rem;
  line-height: 1.2;
  flex-shrink: 0;
}

.tip-text {
  flex: 1;
  color: #e2e8f0;
}

/* Meal Components Grid */
.meal-components-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.component-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(9, 19, 46, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.comp-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.comp-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Choices Chips */
.choice-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.choice-chip {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
}

.choice-chip.active {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--accent-cyan);
  color: var(--text-white);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.35);
}

/* Quantities & Badges */
.qty-badge {
  color: var(--accent-amber-glow);
  font-weight: 800;
  background: rgba(251, 191, 36, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid rgba(251, 191, 36, 0.25);
  white-space: nowrap;
  display: inline-block;
}

.brand-badge {
  color: #7dd3fc;
  font-style: italic;
  font-weight: 600;
}

.highlight-food {
  color: var(--text-white);
  font-weight: 700;
}

/* Action button inside card */
.btn-select-alt {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 10px;
}

.btn-select-alt:active {
  transform: scale(0.96);
  background: var(--bg-surface-active);
}

/* Meal EVO Oil Indicator */
.meal-evo-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-md);
  padding: 6px 10px;
  font-size: 0.8rem;
  color: var(--accent-amber-glow);
  margin-top: 4px;
}

/* Pasto Libero Special Design */
.free-meal-card {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(139, 92, 246, 0.25));
  border: 1px solid rgba(236, 72, 153, 0.4);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.free-meal-icon {
  font-size: 2rem;
  animation: bounce 1.5s infinite;
}

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

.free-meal-title {
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--accent-free-grad);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.free-meal-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Slider Footer (Dots + Chevrons) */
.slider-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 16px 12px;
}

.slider-arrow-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--accent-cyan);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.slider-arrow-btn:active {
  transform: scale(0.9);
  background: var(--bg-surface-active);
}

.slider-dots {
  display: flex;
  gap: 6px;
  align-items: center;
}

.slider-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.25s ease;
}

.slider-dot.active {
  width: 20px;
  background: var(--accent-cyan);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.6);
}

/* ==========================================================================
   TAB 2: PLANNING DELLA GIORNATA
   ========================================================================== */
.section-intro {
  margin-bottom: 16px;
}

.intro-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.planning-export-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #7dd3fc;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.btn-export:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--accent-cyan);
  color: var(--text-white);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

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

.section-intro h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-white);
  margin-bottom: 4px;
}

.section-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.daily-planning-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Planning Top Banner: Menù del giorno con Data Modificabile (Centrato, Minimal, No Pill) */
.planning-menu-header {
  background: linear-gradient(135deg, rgba(20, 42, 92, 0.95), rgba(9, 22, 58, 0.95));
  border: 1px solid var(--accent-cyan);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  box-shadow: 0 4px 18px rgba(56, 189, 248, 0.2);
}

.menu-day-heading {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-white);
  letter-spacing: -0.2px;
  margin: 0;
  text-align: center;
}

.menu-date-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
  user-select: none;
  margin: 0;
  padding: 2px 4px;
}

.menu-date-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: #7dd3fc;
  letter-spacing: 0.3px;
  transition: color 0.2s;
}

.menu-date-wrap:hover .menu-date-text {
  color: var(--text-white);
}

.menu-date-hidden-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Planning Meal Card */
.planning-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s;
}

.planning-card:hover {
  border-color: rgba(56, 189, 248, 0.3);
}

.planning-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding-bottom: 8px;
}

.planning-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.planning-emoji {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.planning-meal-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-white);
}

.planning-opt-badge {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.btn-change-meal {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.btn-change-meal:active {
  transform: scale(0.92);
  background: var(--bg-surface-active);
}

.planning-card-body {
  font-size: 0.92rem;
  color: var(--text-secondary);
}

/* ==========================================================================
   DOCTOR & GUIDELINES (MODAL)
   ========================================================================== */
.doctor-profile-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.doctor-banner-img {
  width: 100%;
  max-height: 90px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 4px;
}

.ordine-logo-img {
  max-height: 48px;
  object-fit: contain;
  margin-top: 4px;
}

.doctor-info-text h4 {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text-white);
}

.doctor-badge {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 8px;
}

.doctor-qualifications {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.guidelines-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.guidelines-card h4 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-white);
}

.guide-item {
  display: flex;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
}

.guide-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.guide-content strong {
  display: block;
  font-size: 0.92rem;
  color: var(--text-white);
  margin-bottom: 2px;
}

.guide-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ==========================================================================
   MODAL / SLIDE-UP SHEET
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.modal-backdrop.open {
  display: flex;
  opacity: 1;
}

.modal-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-bright);
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  max-height: 85dvh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 20px 18px 30px;
  transform: translateY(20px);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.open .modal-card {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 12px;
}

.modal-header-titles h3 {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-white);
}

.modal-sub {
  font-size: 0.85rem;
  color: var(--accent-cyan);
}

.modal-close {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-pill);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
}

.modal-close:active {
  background: var(--bg-surface-active);
  color: var(--text-white);
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==========================================================================
   TOAST NOTIFICATION
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-header);
  border: 1px solid var(--accent-cyan);
  color: var(--text-white);
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-cyan);
  z-index: 300;
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
}

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

/* ==========================================================================
   RESPONSIVE ADJUSTMENTS
   ========================================================================== */
@media (min-width: 640px) {
  .slider-card {
    flex: 0 0 460px;
  }
  .app-main {
    padding-top: 24px;
  }
}

/* ==========================================================================
   PRINT STYLES (PDF EXPORT) - White Background & Deep Navy HTML Accents
   ========================================================================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 10mm 12mm;
  }

  body {
    background: #ffffff !important;
    color: #0f172a !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Elimina intestazione del sito, sezione intro, piè di pagina e pulsanti */
  .app-header,
  .section-intro,
  .ambient-glow,
  .swipe-banner,
  #tab-meals,
  .planning-export-bar,
  .btn-change-meal,
  .toast,
  .modal-backdrop,
  .day-quick-jumps,
  .menu-date-hidden-input {
    display: none !important;
  }

  #tab-summary {
    display: block !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
  }

  .app-main {
    padding: 0 !important;
    max-width: 100% !important;
  }

  .daily-planning-container {
    gap: 12px !important;
  }

  /* Top Banner: Menù del giorno con sfondo chiaro e bordo blu pagina HTML */
  .planning-menu-header {
    background: #f1f5f9 !important;
    border: 2px solid #09132e !important;
    border-radius: 8px !important;
    padding: 12px 16px !important;
    box-shadow: none !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    text-align: center !important;
  }

  .menu-day-heading {
    color: #09132e !important;
    font-size: 1.35rem !important;
    font-weight: 800 !important;
  }

  .menu-date-text {
    color: #1e3a8a !important;
    font-size: 0.95rem !important;
    font-weight: 700 !important;
  }

  /* Card dei singoli pasti */
  .planning-card {
    background: #ffffff !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
    padding: 12px 14px !important;
  }

  .planning-card-header {
    border-bottom: 1px solid #e2e8f0 !important;
    padding-bottom: 6px !important;
  }

  .planning-meal-title {
    color: #09132e !important;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
  }

  .planning-opt-badge {
    color: #1e40af !important;
    background: #eff6ff !important;
    border: 1px solid #bfdbfe !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    font-weight: 700 !important;
    font-size: 0.78rem !important;
  }

  /* Righe alimenti e ingredienti */
  .component-row {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    color: #1e293b !important;
    padding: 8px 10px !important;
  }

  .ingredient-text {
    color: #0f172a !important;
  }

  .ingredient-bullet {
    color: #09132e !important;
  }

  .highlight-food {
    color: #09132e !important;
    font-weight: 700 !important;
  }

  .clarification-text {
    color: #475569 !important;
    font-style: italic !important;
  }

  .brand-badge {
    color: #0284c7 !important;
    font-weight: 700 !important;
  }

  /* Badge quantità e scelte */
  .qty-badge {
    background: #f1f5f9 !important;
    color: #09132e !important;
    border: 1px solid #cbd5e1 !important;
    font-weight: 800 !important;
  }

  .qty-badge[style*="background:rgba(56,189,248"] {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border: 1px solid #93c5fd !important;
  }

  /* Consigli / Tips nutrizionali */
  .ingredient-tip {
    background: #f0f9ff !important;
    border: 1px solid #bae6fd !important;
    border-left: 3px solid #0284c7 !important;
    color: #0369a1 !important;
  }

  .tip-text {
    color: #0369a1 !important;
  }

  /* Barra Olio EVO */
  .meal-evo-bar {
    background: #fefce8 !important;
    border: 1px solid #fef08a !important;
    color: #854d0e !important;
  }

  /* Pasto Libero */
  .free-meal-card {
    background: #fdf2f8 !important;
    border: 1px solid #fbcfe8 !important;
    color: #9d174d !important;
  }

  .free-meal-title {
    color: #9d174d !important;
    -webkit-text-fill-color: initial !important;
    background: none !important;
  }

  .free-meal-desc {
    color: #475569 !important;
  }
}
