/* ==========================================================================
   FOODMAP - MASTER STYLESHEET
   
   Manual Editing Guide:
   - Colors & Fonts: Tweak the CSS custom properties in :root below.
   - Layout & Components: Clearly separated by section comments.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. CSS VARIABLES (DESIGN TOKENS)
   -------------------------------------------------------------------------- */
:root {
  /* Brand Palette */
  --color-primary: #ff5722;
  --color-primary-hover: #f4511e;
  --color-primary-glow: rgba(255, 87, 34, 0.35);
  
  --color-gold: #ffb300;
  --color-gold-glow: rgba(255, 179, 0, 0.3);
  
  --color-accent: #00e676;
  --color-accent-hover: #00c853;
  --color-danger: #ff3d71;

  /* Dark Theme Surfaces */
  --bg-body: #0d0f15;
  --bg-card: rgba(22, 26, 37, 0.75);
  --bg-card-hover: rgba(30, 35, 50, 0.85);
  --bg-elevated: #1a1e2b;
  --bg-glass: rgba(255, 255, 255, 0.04);
  
  /* Borders & Dividers */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(255, 255, 255, 0.18);
  --border-accent: rgba(255, 87, 34, 0.5);

  /* Typography */
  --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;

  --text-main: #f0f3fa;
  --text-secondary: #9aa1b5;
  --text-muted: #646b80;

  /* Shadows & Glassmorphism */
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 32px var(--color-primary-glow);

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition-fast: 0.18s ease;
  --transition-normal: 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Background Glow Orbs */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
}

.glow-1 {
  width: 520px;
  height: 520px;
  background: radial-gradient(circle, rgba(255, 87, 34, 0.45) 0%, transparent 70%);
  top: -120px;
  left: -80px;
}

.glow-2 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255, 179, 0, 0.3) 0%, transparent 70%);
  bottom: 5%;
  right: -100px;
}

/* --------------------------------------------------------------------------
   3. HEADER & NAVIGATION
   -------------------------------------------------------------------------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 15, 21, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.85rem 1.5rem;
}

.header-container {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #ff5722, #ff9800);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 4px 14px var(--color-primary-glow);
}

.brand-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  line-height: 1.1;
}

.brand-tagline {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-card);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  font-weight: 600;
}

.stat-value {
  color: var(--color-gold);
  font-family: var(--font-display);
}

.stat-badge {
  background: linear-gradient(135deg, rgba(255, 179, 0, 0.15), rgba(255, 87, 34, 0.15));
  border: 1px solid rgba(255, 179, 0, 0.35);
  color: #ffca28;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

/* Language Selector Dropdown */
.lang-selector-wrap {
  position: relative;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.75rem;
  font-weight: 700;
  cursor: pointer;
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #141824;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6);
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 150;
  min-width: 140px;
  animation: fadeIn 0.2s ease-out;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.8rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: all var(--transition-fast);
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.lang-option span {
  font-size: 1.1rem;
  line-height: 1;
}

/* --------------------------------------------------------------------------
   4. BUTTONS & UI CONTROLS
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #ff7043);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--color-primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--color-primary-hover), #f4511e);
  box-shadow: 0 6px 18px var(--color-primary-glow);
  transform: translateY(-1px);
}

.btn-primary-light {
  background: rgba(255, 87, 34, 0.15);
  color: #ff7043;
  border: 1px solid rgba(255, 87, 34, 0.3);
}

.btn-primary-light:hover {
  background: rgba(255, 87, 34, 0.25);
  color: #ff8a65;
}

.btn-outline {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-glow);
  color: #ffffff;
}

.btn-outline-danger {
  background: transparent;
  color: #ff6b8b;
  border: 1px solid rgba(255, 61, 113, 0.3);
}

.btn-outline-danger:hover {
  background: rgba(255, 61, 113, 0.15);
  border-color: var(--color-danger);
  color: #ffffff;
}

.btn-success {
  background: linear-gradient(135deg, #00c853, #69f0ae);
  color: #0b2210;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(0, 200, 83, 0.3);
}

.btn-icon {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  padding: 0.55rem;
  border-radius: var(--radius-md);
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: #ffffff;
  border-color: var(--border-glow);
}

.btn-sm {
  padding: 0.4rem 0.8rem;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 0.85rem 1.8rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
   5. WHEEL SECTION & PEDESTAL
   -------------------------------------------------------------------------- */
.main-content {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
  padding: 2rem 1.5rem 5rem;
}

.wheel-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 1.5rem 0 3rem;
}

.wheel-container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.wheel-header {
  margin-bottom: 2rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  margin-bottom: 0.6rem;
  line-height: 1.2;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 580px;
  margin: 0 auto;
}

.wheel-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.wheel-wrapper {
  position: relative;
  margin: 0 auto 1.5rem;
  padding: 16px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 87, 34, 0.12) 0%, rgba(22, 26, 37, 0.4) 70%, transparent 100%);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
}

#wheel-canvas {
  cursor: pointer;
  display: block;
  max-width: 100%;
  touch-action: manipulation;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.45));
  transition: transform 0.2s ease;
}

#wheel-canvas:hover {
  transform: scale(1.015);
}

.wheel-controls {
  margin-top: 0.5rem;
}

.btn-spin {
  background: linear-gradient(135deg, #ff5722 0%, #ff9800 50%, #ffb300 100%);
  color: #ffffff;
  padding: 1rem 3rem;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 8px 28px rgba(255, 87, 34, 0.4), inset 0 2px 4px rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  transition: all var(--transition-normal);
}

.btn-spin:hover:not(.disabled) {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 12px 34px rgba(255, 87, 34, 0.5), inset 0 2px 6px rgba(255, 255, 255, 0.5);
}

.btn-spin.disabled {
  opacity: 0.65;
  cursor: not-allowed;
  transform: none;
}

.spin-hint {
  font-size: 0.72rem;
  font-weight: 500;
  opacity: 0.85;
  letter-spacing: 0.2px;
}

/* Result Banner */
.spin-result-banner {
  margin-top: 1.8rem;
  background: linear-gradient(135deg, rgba(30, 35, 52, 0.9), rgba(20, 24, 35, 0.9));
  border: 1px solid var(--border-glow);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-lg);
  padding: 1.2rem 2.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: bounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-badge {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--color-gold);
  font-weight: 800;
  margin-bottom: 0.2rem;
}

.result-letter {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
  text-shadow: 0 0 20px rgba(255, 87, 34, 0.5);
}

.result-message {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   6. COUNTRIES SECTION
   -------------------------------------------------------------------------- */
.countries-section {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  animation: fadeIn 0.4s ease-out;
}

.section-container {
  max-width: 1140px;
  margin: 0 auto;
}

.section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.8rem;
}

.badge-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.badge {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-accent {
  background: var(--color-primary);
  color: #ffffff;
}

.badge-outline {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.countries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
}

.country-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
  transition: all var(--transition-normal);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.country-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-gold));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.country-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
  background: var(--bg-card-hover);
}

.country-card:hover::before {
  opacity: 1;
}

.country-flag {
  font-size: 3.2rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.country-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.1rem;
}

.country-region {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.explore-country-btn {
  width: 100%;
  margin-top: 0.4rem;
}

/* --------------------------------------------------------------------------
   7. RECIPES SECTION
   -------------------------------------------------------------------------- */
.recipes-section {
  margin-top: 3.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  animation: fadeIn 0.4s ease-out;
}

.recipe-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.selected-country-header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.selected-country-flag {
  font-size: 2.8rem;
  line-height: 1;
}

.recipe-heading-title {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
}

.country-region-tag {
  font-size: 0.85rem;
  color: var(--color-gold);
  font-weight: 600;
}

/* Dietary Filter Bar */
.dietary-filter-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.8rem;
  flex-wrap: wrap;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  backdrop-filter: blur(8px);
}

.dietary-filter-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.dietary-filter-buttons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.diet-filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.diet-filter-btn:hover {
  border-color: var(--border-glow);
  color: #ffffff;
  background: var(--bg-card-hover);
}

.diet-filter-btn.active {
  background: linear-gradient(135deg, #00c853, #00e676);
  color: #061f0d;
  border-color: transparent;
  font-weight: 800;
  box-shadow: 0 2px 10px rgba(0, 230, 118, 0.3);
}

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.recipe-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--transition-normal);
  backdrop-filter: blur(12px);
}

.recipe-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

.recipe-thumb-wrap {
  position: relative;
  width: 100%;
  padding-top: 65%; /* 16:10 aspect ratio */
  overflow: hidden;
  background: var(--bg-elevated);
}

.recipe-thumb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.recipe-card:hover .recipe-thumb {
  transform: scale(1.06);
}

.recipe-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(13, 15, 21, 0.75);
  backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.recipe-content {
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
  gap: 1rem;
}

.recipe-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Immediate Dietary Badges on Recipe List */
.dietary-tags-row {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.55rem;
  margin-bottom: 0.45rem;
}

.diet-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.2px;
  line-height: 1.2;
}

.diet-vegan {
  background: rgba(0, 230, 118, 0.16);
  border: 1px solid rgba(0, 230, 118, 0.45);
  color: #00e676;
}

.diet-meat {
  background: rgba(255, 82, 82, 0.16);
  border: 1px solid rgba(255, 82, 82, 0.4);
  color: #ff5252;
}

.diet-meatfree {
  background: rgba(38, 166, 154, 0.16);
  border: 1px solid rgba(38, 166, 154, 0.4);
  color: #26a69a;
}

.diet-egg {
  background: rgba(255, 179, 0, 0.16);
  border: 1px solid rgba(255, 179, 0, 0.4);
  color: #ffca28;
}

.diet-cheese {
  background: rgba(255, 214, 0, 0.16);
  border: 1px solid rgba(255, 214, 0, 0.4);
  color: #ffd600;
}

.diet-dairy {
  background: rgba(66, 165, 245, 0.16);
  border: 1px solid rgba(66, 165, 245, 0.4);
  color: #64b5f6;
}

/* Vegan Alternative / Adaptability Hint on Card */
.vegan-alt-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  background: rgba(0, 230, 118, 0.05);
  border: 1px dashed rgba(0, 230, 118, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.65rem;
  margin-top: 0.5rem;
  font-size: 0.77rem;
  color: #a5d6a7;
  line-height: 1.35;
}

.vegan-alt-icon {
  flex-shrink: 0;
  margin-top: 1px;
}

.vegan-alt-text strong {
  color: #00e676;
}

.recipe-card-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
}

/* Skeleton Loaders */
.recipe-card.skeleton {
  pointer-events: none;
}

.skeleton-image {
  width: 100%;
  height: 180px;
  background: linear-gradient(90deg, #181d2a 25%, #22293b 50%, #181d2a 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s infinite;
}

.skeleton-text {
  height: 16px;
  margin: 1rem 1.2rem 0.5rem;
  border-radius: 4px;
  background: linear-gradient(90deg, #181d2a 25%, #22293b 50%, #181d2a 75%);
  background-size: 200% 100%;
  animation: skeletonPulse 1.5s infinite;
}

.skeleton-text.short {
  width: 50%;
  margin-top: 0;
  margin-bottom: 1.2rem;
}

/* --------------------------------------------------------------------------
   8. MODALS (RECIPE DETAIL & CULINARY PASSPORT)
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: #141824;
  border: 1px solid var(--border-glow);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  animation: modalScaleUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 10;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(20, 24, 36, 0.85);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--bg-card-hover);
  color: #ffffff;
  transform: rotate(90deg);
}

.modal-body {
  overflow-y: auto;
  padding: 1.8rem;
}

/* Recipe Detail Layout inside Modal */
.recipe-detail-header {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.8rem;
  margin-bottom: 2rem;
  align-items: center;
}

.modal-hero-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.modal-tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
  flex-wrap: wrap;
}

.badge-vegan {
  background: rgba(0, 230, 118, 0.2);
  border: 1px solid #00e676;
  color: #00e676;
}

.badge-meat {
  background: rgba(255, 82, 82, 0.2);
  border: 1px solid #ff5252;
  color: #ff5252;
}

.badge-meatfree {
  background: rgba(38, 166, 154, 0.2);
  border: 1px solid #26a69a;
  color: #26a69a;
}

.badge-egg {
  background: rgba(255, 179, 0, 0.2);
  border: 1px solid #ffca28;
  color: #ffca28;
}

.badge-cheese {
  background: rgba(255, 214, 0, 0.2);
  border: 1px solid #ffd600;
  color: #ffd600;
}

/* Modal Vegan Adaptations Card */
.vegan-info-card {
  margin-bottom: 1.8rem;
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border: 1px solid transparent;
}

.vegan-certified {
  background: rgba(0, 230, 118, 0.08);
  border-color: rgba(0, 230, 118, 0.3);
}

.vegan-adaptation {
  background: rgba(255, 179, 0, 0.06);
  border-color: rgba(255, 179, 0, 0.25);
}

.vegan-info-icon {
  font-size: 1.8rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.vegan-info-content h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.25rem;
}

.vegan-info-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.vegan-substitutes-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
}

.vegan-substitutes-list li {
  background: rgba(0, 0, 0, 0.25);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--color-gold);
}

.sub-from {
  color: #ff8a80;
  font-weight: 600;
}

.sub-to {
  color: #c8e6c9;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 1.2rem;
}

.modal-hero-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

/* Translated Recipe Banner */
.translated-badge-banner {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(33, 150, 243, 0.12);
  border: 1px solid rgba(33, 150, 243, 0.4);
  color: #64b5f6;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  margin-top: 0.8rem;
  animation: fadeIn 0.3s ease;
}

.translated-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.recipe-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 2rem;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1.8rem;
}

.panel-header-with-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}

.panel-header-with-badge h3 {
  margin-bottom: 0 !important;
}

.ingredients-panel h3,
.instructions-panel h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 0.4rem;
}

.panel-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.ingredients-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.ingredient-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  transition: background var(--transition-fast);
}

.ingredient-checkbox-label:hover {
  background: rgba(255, 255, 255, 0.06);
}

.ingredient-checkbox-label input[type="checkbox"] {
  display: none;
}

.custom-checkbox {
  width: 18px;
  height: 18px;
  border-radius: 4px;
  border: 2px solid var(--border-glow);
  display: inline-block;
  position: relative;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.ingredient-checkbox-label input[type="checkbox"]:checked + .custom-checkbox {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.ingredient-checkbox-label input[type="checkbox"]:checked + .custom-checkbox::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  color: #0d0f15;
  font-size: 11px;
  font-weight: 900;
}

.ingredient-checkbox-label input[type="checkbox"]:checked ~ .ingredient-name,
.ingredient-checkbox-label input[type="checkbox"]:checked ~ .ingredient-measure {
  text-decoration: line-through;
  opacity: 0.5;
}

.ingredient-measure {
  font-weight: 700;
  color: var(--color-gold);
  font-size: 0.88rem;
}

.ingredient-name {
  color: var(--text-main);
  font-size: 0.9rem;
}

.instructions-content {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.instruction-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.step-num {
  width: 28px;
  height: 28px;
  background: var(--color-primary);
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   9. CULINARY PASSPORT MODAL
   -------------------------------------------------------------------------- */
.modal-passport {
  max-width: 820px;
}

.passport-header {
  padding: 1.8rem 1.8rem 1.2rem;
  border-bottom: 1px solid var(--border-subtle);
  background: linear-gradient(180deg, rgba(30, 36, 54, 0.6) 0%, rgba(20, 24, 36, 0.3) 100%);
}

.passport-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.2rem;
}

.passport-icon {
  font-size: 2.5rem;
}

.passport-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.1;
}

.passport-sub {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.passport-stats-bar {
  display: flex;
  gap: 2rem;
  margin-bottom: 1.2rem;
}

.passport-stat {
  display: flex;
  flex-direction: column;
}

.passport-stat-num {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-gold);
}

.passport-stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.progress-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-gold), var(--color-accent));
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.progress-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
  text-align: right;
}

.passport-body {
  overflow-y: auto;
  padding: 1.8rem;
  max-height: 55vh;
}

.passport-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.2rem;
}

.passport-stamp-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 179, 0, 0.4);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  position: relative;
  background-color: rgba(20, 24, 36, 0.6);
}

.stamp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stamp-flag-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.stamp-flag {
  font-size: 2rem;
  line-height: 1;
}

.stamp-country {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
}

.stamp-region {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.stamp-recipes-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.85rem;
}

.stamp-recipe-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
}

.stamp-recipe-thumb {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
}

.stamp-recipe-meta {
  display: flex;
  flex-direction: column;
}

.stamp-recipe-name {
  font-weight: 600;
  color: #ffffff;
  font-size: 0.82rem;
}

.stamp-recipe-date {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.stamp-no-recipe {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-style: italic;
}

/* Discreet Passport Footer: Reset Progress Danger Zone */
.passport-footer {
  padding: 1.2rem 1.8rem;
  background: rgba(10, 12, 18, 0.75);
  border-top: 1px solid var(--border-subtle);
}

.passport-reset-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.passport-reset-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   10. EMPTY & ERROR STATES
   -------------------------------------------------------------------------- */
.empty-state, .error-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-subtle);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.empty-state h3, .error-state h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: #ffffff;
}

.empty-state p, .error-state p {
  color: var(--text-secondary);
  max-width: 480px;
  font-size: 0.95rem;
}

/* Spinner */
.spinner {
  width: 42px;
  height: 42px;
  border: 4px solid var(--border-subtle);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 2rem auto;
}

/* --------------------------------------------------------------------------
   11. TOAST NOTIFICATIONS
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  pointer-events: none;
}

.toast {
  background: #1e2436;
  border: 1px solid var(--border-glow);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
  color: #ffffff;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  max-width: 380px;
}

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

/* --------------------------------------------------------------------------
   12. KEYFRAME ANIMATIONS & UTILITIES
   -------------------------------------------------------------------------- */
.hidden {
  display: none !important;
}

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

@keyframes bounceIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.92) translateY(15px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

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

/* --------------------------------------------------------------------------
   13. RESPONSIVE BREAKPOINTS
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .section-title {
    font-size: 1.9rem;
  }

  .recipe-detail-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .modal-hero-img {
    height: 180px;
    max-width: 320px;
    margin: 0 auto;
  }

  .modal-tags, .modal-hero-actions {
    justify-content: center;
  }

  .recipe-detail-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

@media (max-width: 640px) {
  .app-header {
    padding: 0.75rem 1rem;
  }

  .header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .stat-badge {
    display: none;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .btn-spin {
    padding: 0.85rem 2rem;
    font-size: 1rem;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
  }

  .toast {
    max-width: 100%;
  }

  .recipe-section-header {
    flex-direction: column;
    align-items: flex-start;
  }
}
