/* ============================================
   WeMeal Design System
   Liquid Glass + Colorful Theme
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   CSS Variables
   ============================================ */
:root {
  /* Premium Midnight Theme - iOS Match */

  /* Primary Accents */
  --primary: #6366f1;
  /* Indigo 500 - Matches "Calories" icon logic */
  --primary-glow: rgba(99, 102, 241, 0.2);
  --secondary: #8b5cf6;
  /* Violet 500 */

  /* Backgrounds - Deep solid darks (No more multi-color rainbow) */
  --background: #0f172a;
  /* Slate 900 - Main App Background */
  --background-gradient-start: #0f172a;
  --background-gradient-end: #020617;
  /* Even darker at bottom */

  --surface-color: #1e293b;
  /* Slate 800 - Cards */
  --surface-highlight: #334155;
  /* Slate 700 */

  /* Glass Effect - More solid, less transparent */
  --glass: #1e293b;
  /* Solid color for better readability */
  --glass-bg: rgba(30, 41, 59, 0.95);
  /* Nearly opaque */
  --glass-bg-solid: #1e293b;
  --glass-border: rgba(255, 255, 255, 0.05);
  /* Very subtle border */
  --glass-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);

  /* Text */
  --text-primary: #f8fafc;
  /* Slate 50 */
  --text-secondary: #94a3b8;
  /* Slate 400 */
  --text-muted: #64748b;
  /* Slate 500 */
  --text-dark: #f8fafc;
  /* In dark mode, text dark usually is light */

  /* Status Colors */
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --diabetic: #f43f5e;
  --heart-filled: #ef4444;
  /* Added */

  /* Badge Specifics */
  --badge-vegan-bg: rgba(34, 197, 94, 0.15);
  /* Green tint */
  --badge-vegan-text: #4ade80;
  /* Green text */

  --badge-diabetic-bg: rgba(232, 121, 249, 0.15);
  /* Purple tint */
  --badge-diabetic-text: #e879f9;
  /* Purple text */

  --badge-sugar-bg: rgba(56, 189, 248, 0.15);
  /* Light Blue tint */
  --badge-sugar-text: #38bdf8;
  /* Light Blue text */

  --badge-low-gi-bg: rgba(34, 197, 94, 0.1);
  --badge-low-gi-text: #86efac;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  /* Matches the rounded iOS cards */
  --radius-xl: 32px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Typography */
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ============================================
   Light Theme Overrides
   ============================================ */
body.light-mode {
  /* Vibrant Animated Gradient Background - Softened */
  --background: linear-gradient(-45deg, #ffc4c8, #fae2da, #fae2da, #cac0e8, #f5dcf2);
  background: var(--background);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;

  /* Surface & Glass - Liquid Effect */
  --surface-color: rgba(255, 255, 255, 0.4);
  --glass: rgba(255, 255, 255, 0.3);
  --glass-bg: rgba(255, 255, 255, 0.3);
  /* Much more transparent */
  --glass-bg-solid: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(255, 255, 255, 0.4);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

  /* Text Colors - High Contrast */
  --text-primary: #1e293b;
  /* Slate 800 */
  --text-secondary: #475569;
  /* Slate 600 */
  --text-muted: #64748b;
  /* Slate 500 */
  --text-dark: #1e293b;

  /* Specific overrides for white text elements */
  --heart-empty: #dc2626;
  /* Red outline for heart in light mode instead of white */
}

body.light-mode .favorites-empty svg {
  fill: var(--text-primary) !important;
  opacity: 0.5;
}

body.light-mode .surprise-input-field {
  color: white !important;
}

body.light-mode .logo {
  background: linear-gradient(135deg, #333 0%, #000 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}

body.light-mode .section-title,
body.light-mode .header h1,
body.light-mode .nav-item {
  color: var(--text-primary);
}

body.light-mode .nav-item.active {
  color: var(--primary);
}

@keyframes gradientBG {
  0% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }

  100% {
    background-position: 0% 50%;
  }
}

/* ============================================
   Base Styles
   ============================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

body {
  font-family: var(--font-family);
  min-height: 100vh;
  /* Dark, Subtle Gradient - No more Rainbow */
  background: linear-gradient(180deg, var(--background-gradient-start) 0%, var(--background-gradient-end) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
}

/* Removed outdated multicolor orbs - HIDDEN to fix white shape bug */

body::before,
body::after {
  display: none !important;
}

@keyframes float {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(30px, -30px) scale(1.05);
  }

  66% {
    transform: translate(-20px, 20px) scale(0.95);
  }
}

/* ============================================
   Glass Card Component
   ============================================ */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow:
    0 8px 32px var(--glass-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.glass-solid {
  background: var(--glass-bg-solid);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

/* ============================================
   App Container - Centered Layout
   ============================================ */
.app {
  width: 100%;
  max-width: 1400px;
  /* Tighter for better centering */
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: var(--space-lg) var(--space-sm);
  padding-bottom: 150px;
}

/* ============================================
   Header
   ============================================ */
.header {
  text-align: center;
  padding: var(--space-lg) 0;
}

.logo {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, rgba(255, 255, 255, 0.8) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;

  text-shadow: 0 4px 30px rgba(255, 255, 255, 0.3);
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-icon {
  font-size: 2rem;
  animation: wobble 2s ease-in-out infinite;
}

@keyframes wobble {

  0%,
  100% {
    transform: rotate(-5deg);
  }

  50% {
    transform: rotate(5deg);
  }
}

/* ============================================
   Weather Widget
   ============================================ */
.weather-widget {
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.weather-widget::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
  animation: shimmer 8s linear infinite;
}

@keyframes shimmer {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.weather-icon {
  font-size: 4rem;
  margin-bottom: var(--space-sm);
  animation: bounce-soft 3s ease-in-out infinite;
}

@keyframes bounce-soft {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

.weather-temp {
  font-size: 3rem;
  font-weight: 700;
}

.weather-desc {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-top: var(--space-xs);
}

.weather-location {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* ============================================
   Section Titles
   ============================================ */
.section-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  /* Center the title itself */
  gap: var(--space-sm);
}

.section-title-icon {
  font-size: 1.5rem;
}

/* ============================================
   Recipe Cards Grid - 3x2 Centered
   ============================================ */
.recipes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  padding: var(--space-md) 0;
  margin-bottom: var(--space-xl);
  width: 100%;
  /* max-width removed to let it fill container */
  margin: 0 auto;
  /* Center the grid block */
  justify-content: center;
}

/* Tablet: 2 columns */
@media (min-width: 700px) {
  .recipes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop: STRICTLY 3 columns */
@media (min-width: 1100px) {
  .recipes-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.recipe-card {
  position: relative;
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border: 1px solid var(--glass-border);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--space-md);
  overflow: visible;
  /* Changed from hidden to visible */
  min-height: 120px;
  z-index: 1;
  /* Ensure clickable */
}

.recipe-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, transparent 100%);
  opacity: 0;
  transition: var(--transition-normal);
  border-radius: var(--radius-xl);
}

.recipe-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow:
    0 20px 40px var(--glass-shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

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

.recipe-card:active {
  transform: translateY(-2px) scale(0.99);
}

.recipe-emoji {
  font-size: 3.5rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
}

/* Recipe content wrapper */
.recipe-card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  min-width: 0;
}

.recipe-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
  line-height: 1.3;
  color: var(--text-primary);
}

.recipe-meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

.recipe-favorite {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  padding: 0;
  cursor: pointer;
  transition: var(--transition-bounce);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
  color: var(--heart-empty);
  /* Default white/transparent */
  z-index: 10;
  /* Ensure it's above other elements */
}

.recipe-favorite svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 0;
}

.recipe-favorite:hover {
  transform: scale(1.2);
  color: var(--heart-filled);
  /* Preview red on hover */
}

.recipe-favorite:active {
  transform: scale(0.9);
}

.recipe-favorite.active {
  color: var(--heart-filled);
  /* Red when active */
  animation: heart-pop 0.4s cubic-bezier(0.17, 0.89, 0.32, 1.49);
}

@keyframes heart-pop {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.4);
  }

  100% {
    transform: scale(1);
  }
}

/* Diabetic Badge */
.diabetic-badge {
  background: var(--diabetic);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 4px;
}

.recipe-bottom-badges {
  position: absolute;
  bottom: 8px;
  /* Lower than before (was space-md/16px) */
  right: var(--space-md);
  display: flex;
  flex-direction: column;
  /* Stack them if multiple, or row? User said "next to sugar index". Let's try row first, but might crowd. User said "bottom right next to where sugar index appears". */
  align-items: flex-end;
  gap: 4px;
  z-index: 5;
}

.badges-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.recipe-bottom-badges .diet-badge {
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: var(--radius-full);
  color: white;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.diet-badge.vegetarian-badge {
  background: #4ade80;
  /* Green */
}

.diet-badge.vegan-badge {
  background: #22c55e;
  /* Green */
}

.diet-badge.diabetic-badge {
  background: var(--diabetic);
}

/* Profile Status Indicators */
.profile-avatar.diabetic-border {
  border: 4px solid #ef4444;
  /* Red for diabetic as requested */
}

.profile-avatar.vegan-border {
  border: 4px solid #22c55e;
  /* Green for vegan */
}

/* If both? CSS handling order matters or separate classes.
   The user asked: "red if diabetic, green if vegan".
   If both, maybe we can do a gradient border or split?
   For now, diabetic takes precedence or we handle JS logic to pick one?
   Let's prioritize Diabetic as it's a medical condition.
*/

.profile-avatar-badge {
  position: absolute;
  bottom: -5px;
  right: -5px;
  background: #22c55e;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  border: 2px solid white;
  align-items: center;
  justify-content: center;
  /* Center content vertically if view height allows */
  padding-top: var(--space-xl);
  min-height: 60vh;
}

.surprise-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
}

.surprise-search-container {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 4px;
  /* Space for glow to bleed slightly if needed */
}

/* The Moving Beam Glow Effect */
/* The Moving Ambient Glow Effect (New) */
.surprise-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  z-index: -1;
  /* Behind the bar */
  border-radius: 9999px;
  pointer-events: none;

  /* Multicolor Gradient */
  background: conic-gradient(from 0deg,
      #FF1CF7,
      /* Neon Pink */
      #7928CA,
      /* Deep Purple */
      #00F0FF,
      /* Cyan */
      #00FF94,
      /* Spring Green */
      #FF1CF7
      /* Loop */
    );

  /* The "Blur" Effect requested */
  filter: blur(45px);
  opacity: 0.6;
  /* Adjust for elegance */

  /* Rotation Animation */
  animation: rotate-halo 8s linear infinite;
}

/* Remove old pseudo-elements */
.surprise-glow::before,
.surprise-glow::after {
  content: none;
  display: none;
}

@keyframes rotate-halo {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* The Bar Itself */
.surprise-search-bar {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.5);
  /* Deep Dark Slate */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  /* Full Pill */
  padding: 8px 8px 8px 24px;
  /* Left padding for texts, right for buttons */
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: border-color 0.3s ease;
}

.surprise-search-bar:focus-within {
  border-color: rgba(99, 102, 241, 0.5);
  /* Primary glow on focus */
  background: rgba(15, 23, 42, 0.95);
}

.surprise-input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.search-icon {
  font-size: 1.2rem;
  opacity: 0.5;
}

.surprise-input-field {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.1rem;
  font-weight: 500;
  outline: none;
  font-family: var(--font-family);
}

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

/* Right Actions */
.surprise-bar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.mode-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mode-chip:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

/* Send Button circle */
.btn-search-action {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-search-action:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.6);
}

.send-icon {
  font-size: 1.2rem;
  margin-left: 2px;
  /* Visual center adjustment */
}

/* Hide legacy elements if any */
.surprise-input-container {
  display: none;
}

.ingredients-input:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.1);
}

/* Tags Container */
.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

/* Suggestion Chips Container */
.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.suggestion-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: var(--font-family);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.suggestion-chip:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.suggestion-chip:active {
  transform: scale(0.95);
}

.tag {
  background: var(--glass-bg-solid);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  animation: tag-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes tag-in {
  0% {
    transform: scale(0);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.tag-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  transition: var(--transition-fast);
}

.tag-remove:hover {
  color: var(--danger);
}

.tag-gluten-free {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
  border: 1px solid rgba(249, 115, 22, 0.3);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--radius-lg);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-bounce);
  position: relative;
  overflow: hidden;
}



.btn:hover {
  transform: translateY(-2px);
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

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

/* Primary "Luminous" Button (Like the "Cuisiner!" button) */
.btn-primary {
  /* Lighter glass for primary */
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);

  /* The "Luminous" Glow Effect */
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.3),
    /* Inner glow ring */
    0 8px 20px -6px rgba(99, 102, 241, 0.6);
  /* Outer colored glow */
}

.btn-primary:hover {
  background: rgba(255, 255, 255, 0.15);
  box-shadow:
    0 0 0 1px rgba(99, 102, 241, 0.5),
    0 12px 28px -6px rgba(99, 102, 241, 0.8);
  /* Intensified glow */
  color: #fff;
}

/* Secondary / Outline Button (Like "Assistant" button) */
.btn-secondary {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--primary);
  /* Colored border */
  color: var(--text-primary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
  background: rgba(99, 102, 241, 0.1);
  /* Tinted hover */
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
  /* Subtle glow */
}

.btn-primary:active {
  transform: translateY(-2px) scale(0.98);
}

/* Liquid Glass Button for Cooking Steps */
.cooking-done-btn,
#start-cooking-btn {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  border-left: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 8px 32px 0 rgba(31, 38, 135, 0.2),
    inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  position: relative;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cooking-done-btn::after,
#start-cooking-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
      transparent,
      rgba(255, 255, 255, 0.4),
      transparent);
  transition: 0.5s;
}

.cooking-done-btn:hover,
#start-cooking-btn:hover {
  transform: translateY(-5px);
  box-shadow:
    0 15px 45px 0 rgba(31, 38, 135, 0.3),
    inset 0 0 20px rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.8);
}

.cooking-done-btn:hover::after,
#start-cooking-btn:hover::after {
  left: 100%;
}

.btn-glass {
  background: var(--glass-bg-solid);
  backdrop-filter: blur(10px);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-glass:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.35);
}

.btn-icon {
  width: 48px;
  height: 48px;
}

/* ============================================
   Filter Chips
   ============================================ */
.filter-chip {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 16px;
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.filter-chip.active {
  background: var(--gradient-accent);
  color: white;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.filter-chip:hover {
  background: rgba(255, 255, 255, 0.4);
}

/* ============================================
   Bottom Navigation
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--glass-bg-solid);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border-top: 1px solid var(--glass-border);
  padding: var(--space-sm) var(--space-md);
  padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom));
  z-index: 100;
}

.nav-items {
  display: flex;
  justify-content: space-around;
  max-width: 480px;
  margin: 0 auto;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-sm) var(--space-md);
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-family);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition-bounce);
  border-radius: var(--radius-md);
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  border-radius: var(--radius-full);
  transition: var(--transition-bounce);
}

.nav-item.active {
  color: var(--text-primary);
}

.nav-item.active::before {
  transform: translateX(-50%) scaleX(1);
}

.nav-item:hover {
  color: var(--text-secondary);
  transform: translateY(-2px);
}

.nav-item:active {
  transform: scale(0.95);
}

.nav-icon {
  font-size: 1.5rem;
  transition: var(--transition-bounce);
}

.nav-item.active .nav-icon {
  transform: scale(1.1);
  animation: nav-bounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes nav-bounce {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.3);
  }

  100% {
    transform: scale(1.1);
  }
}

/* ============================================
   Pages/Views
   ============================================ */
.page {
  display: none;
  visibility: hidden;
  position: absolute;
  opacity: 0;
}

.page.active {
  display: block;
  visibility: visible;
  position: relative;
  opacity: 1;
  animation: page-in 0.4s ease;
}

@keyframes page-in {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Loading Overlay
   ============================================ */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(102, 126, 234, 0.95);
  backdrop-filter: blur(20px);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.loading-overlay.active {
  display: flex;
}

.loading-chef {
  font-size: 5rem;
  margin-bottom: var(--space-lg);
  animation: chef-bounce 1s ease-in-out infinite;
}

@keyframes chef-bounce {

  0%,
  100% {
    transform: translateY(0) rotate(-5deg);
  }

  50% {
    transform: translateY(-20px) rotate(5deg);
  }
}

.loading-toque {
  font-size: 6rem;
  margin-bottom: var(--space-md);
  position: relative;
}

.loading-toque::after {
  content: '✨';
  position: absolute;
  font-size: 2rem;
  top: -10px;
  right: -20px;
  animation: sparkle 0.6s ease-in-out infinite alternate;
}

@keyframes sparkle {
  0% {
    opacity: 0.3;
    transform: scale(0.8) rotate(-10deg);
  }

  100% {
    opacity: 1;
    transform: scale(1.2) rotate(10deg);
  }
}

.loading-text {
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: var(--space-lg);
}

.loading-dots {
  display: flex;
  gap: var(--space-sm);
}

.loading-dot {
  width: 12px;
  height: 12px;
  background: var(--text-primary);
  border-radius: 50%;
  animation: dot-bounce 1.4s ease-in-out infinite;
}

.loading-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dot-bounce {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.4;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================
   Emoji Animations
   ============================================ */
.emoji-animate {
  display: inline-block;
  animation: emoji-bounce 2s infinite ease-in-out;
}

@keyframes emoji-bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-5px);
  }
}

/* ============================================
   Profile Section - Complete Redesign
   ============================================ */

/* Profile page layout */
#page-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-xl);
}

#page-profile .header {
  width: 100%;
  max-width: 700px;
}

/* Profile header with avatar and name side by side */
.profile-header {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-xl) 0;
  width: 100%;
  max-width: 600px;
}

.profile-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  background: var(--surface-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  position: relative;
  border: 3px solid var(--surface-highlight);
  transition: border-color 0.3s ease;
}

/* Vegetarian mode - green border */
.profile-avatar.vegetarian-border {
  border: 3px solid #a78bfa !important;
  box-shadow: 0 0 15px rgba(167, 139, 250, 0.5);
}

/* Vegan mode - bright green border */
.profile-avatar.vegan-border {
  border-color: #22c55e;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

/* Diabetic mode - RED border (blood drop) */
.profile-avatar.diabetic-border {
  border-color: #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}


/* Profile avatar badge - small indicator */
.profile-avatar-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 28px;
  height: 28px;
  background: #22c55e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--background);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  font-size: 0.9rem;
  z-index: 20;
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

@media (min-width: 1024px) {
  .profile-view {
    max-width: 1400px !important;
    width: 95% !important;
    margin: 0 auto;
  }

  /* Make the history list container FULL WIDTH like the button */
  .profile-history-list {
    width: 100% !important;
    max-width: none !important;
    display: flex;
    /* Or grid, but flex column makes it like the button rows */
    flex-direction: column;
    gap: var(--space-md);
  }

  .profile-history-list .history-item {
    width: 100%;
    /* Stretch items to full width */
    max-width: none;
  }

  .profile-stats {
    max-width: 100%;
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Profile Stats Grid - Full width with proper spacing */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  width: 100%;
  max-width: 600px;
}

.profile-stat-item,
.stat-card {
  background: var(--surface-color);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  text-align: center;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================
   Settings/Toggle Cards
   ============================================ */
.settings-card {
  background: var(--surface-color);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  width: 100%;
  max-width: 600px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--glass-border);
}

.settings-row:last-child {
  border-bottom: none;
}

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

.settings-label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 500;
  color: var(--text-primary);
}

.settings-icon {
  font-size: 1.3rem;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 56px;
  height: 32px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  transition: var(--transition-normal);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  height: 24px;
  width: 24px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: var(--transition-bounce);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.toggle input:checked+.toggle-slider {
  background: #22c55e;
  border-color: transparent;
}

.toggle input:checked+.toggle-slider::before {
  transform: translateX(24px);
}

/* ============================================
   Diabetic Info Card
   ============================================ */
.diabetic-info-card {
  background: linear-gradient(135deg, rgba(0, 206, 201, 0.2), rgba(116, 185, 255, 0.2));
  padding: var(--space-lg);
  margin-top: var(--space-md);
  animation: slide-in 0.4s ease;
}

@keyframes slide-in {
  0% {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
  }

  100% {
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
  }
}

.diabetic-info-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.diabetic-info-list {
  list-style: none;
}

.diabetic-info-list li {
  padding: var(--space-sm) 0;
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.diabetic-info-list li::before {
  content: '✓';
  color: var(--diabetic);
  font-weight: 700;
}

/* ============================================
   Glycemia Modal
   ============================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: var(--space-lg);
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: linear-gradient(135deg,
      rgba(102, 126, 234, 0.9),
      rgba(240, 147, 251, 0.9));
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  max-width: 400px;
  width: 100%;
  animation: modal-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-in {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }

  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-md);
}

.modal-icon {
  font-size: 4rem;
  text-align: center;
  display: block;
  margin-bottom: var(--space-md);
}

.modal-text {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}

.glycemia-input-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.glycemia-input {
  width: 120px;
  padding: var(--space-md);
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-family: var(--font-family);
}

.glycemia-input:focus {
  outline: none;
  border-color: white;
}

.glycemia-unit {
  font-size: 1rem;
  color: var(--text-secondary);
}

.modal-buttons {
  display: flex;
  gap: var(--space-md);
}

.modal-buttons .btn {
  flex: 1;
}

/* ============================================
   Favorites Page
   ============================================ */
.favorites-empty {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
}

.favorites-empty-icon {
  font-size: 5rem;
  opacity: 0.5;
  margin-bottom: var(--space-md);
}

.favorites-empty-text {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* ============================================
   History List
   ============================================ */
.history-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  width: 100%;
  max-width: 1200px;
  /* Widen for desktop feel */
}

.history-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  cursor: pointer;
  transition: var(--transition-normal);
}

.history-item:hover {
  transform: translateX(8px);
  background: rgba(255, 255, 255, 0.1);
}

.history-emoji {
  font-size: 2.5rem;
}

.history-info {
  flex: 1;
}

.history-name {
  font-weight: 600;
}

.history-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.history-calories {
  font-size: 0.9rem;
  color: var(--gradient-accent);
  font-weight: 600;
}

/* ============================================
   Recipe Detail Modal
   ============================================ */
.recipe-detail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--background);
  /* Solid Dark Background */
  z-index: 250;
  overflow-y: auto;
  display: none;
  padding: var(--space-lg);
  animation: recipe-detail-in 0.4s ease;
}

.recipe-detail.active {
  display: block !important;
  animation: modal-fade-in 0.3s ease-out;
}

/* Profile Section */
.profile-view {
  padding: var(--space-md);
  padding-bottom: 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Ensure global centering of the view content */
}

.profile-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Center vertically and horizontally */
  text-align: center;
  margin-bottom: var(--space-xl);
  width: 100%;
  /* Full width to allow centering */
}

.profile-avatar-container {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto;
  /* Force horizontally center if flex acts up */
  margin-bottom: var(--space-md);
}

.profile-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid transparent;
  /* Default border invisible */
  transition: border-color 0.3s ease;
  padding: 4px;
  /* Space between border and image */
  background-color: var(--surface-color);
  /* Fallback */
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes recipe-detail-in {
  0% {
    opacity: 0;
  }

  100% {
    opacity: 1;
  }
}

.recipe-detail-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.recipe-detail-back {
  background: var(--glass-bg);
  border: none;
  color: white;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.recipe-detail-back:hover {
  transform: scale(1.1);
  background: var(--glass-bg-solid);
}

/* Detail Favorite Button */
#recipe-detail-favorite {
  background: var(--glass-bg);
  border: none;
  color: white;
  /* Default white */
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-bounce);
  display: flex;
  align-items: center;
  justify-content: center;
}

#recipe-detail-favorite.active {
  color: #ef4444;
  /* Red color */
}

#recipe-detail-favorite.active svg {
  fill: #ef4444;
  /* Filled heart */
  animation: heart-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.recipe-detail-emoji {
  font-size: 4rem;
  text-align: center;
  display: block;
  margin: var(--space-xl) 0;
}

.recipe-detail-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: var(--space-md);
}

.recipe-detail-meta {
  display: flex;
  justify-content: center;
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  color: var(--text-secondary);
}

.recipe-detail-section {
  margin-bottom: var(--space-lg);
  padding: var(--space-lg);
}

.recipe-detail-section h3 {
  font-size: 1.2rem;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.recipe-detail-section ul {
  list-style: none;
}

.recipe-detail-section li {
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.recipe-detail-section li:last-child {
  border-bottom: none;
}

.recipe-detail-section li::before {
  content: '•';
  color: var(--gradient-accent);
}

.recipe-steps {
  counter-reset: step;
}

.recipe-steps li {
  counter-increment: step;
}

.recipe-steps li::before {
  content: counter(step);
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
/* Legacy max-width removed */

/* Legacy overrides removed */

/* Surprise Tags Container */
#surprise-tags {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
  width: 100%;
  max-width: 600px;
}

/* Individual Tag Style */
.ingredient-tag {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 0.9rem;
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: fadeIn 0.3s ease-out;
  cursor: default;
}

.ingredient-tag span {
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.ingredient-tag span:hover {
  opacity: 1;
  color: var(--danger);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
  display: none !important;
}

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

.mb-md {
  margin-bottom: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

/* Ripple Effect */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(1);
  animation: ripple-effect 0.6s ease-out;
}

@keyframes ripple-effect {
  0% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(40);
    opacity: 0;
  }
}

/* ============================================
   Custom SVG Icons
   ============================================ */
.icon {
  width: 24px;
  height: 24px;
  display: inline-block;
  fill: currentColor;
  transition: var(--transition-bounce);
}

.icon-lg {
  width: 32px;
  height: 32px;
}

.nav-icon .icon {
  width: 28px;
  height: 28px;
}

/* Custom Heart Icon */
.heart-icon {
  position: relative;
  width: 28px;
  height: 28px;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.heart-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 2;
  transition: var(--transition-bounce);
}

.heart-icon.active svg {
  fill: var(--heart-filled);
  stroke: var(--heart-filled);
}

.heart-icon:hover {
  transform: scale(1.2);
}

.heart-icon:active {
  transform: scale(0.9);
}

.heart-icon.active {
  animation: heart-pop 0.4s cubic-bezier(0.17, 0.89, 0.32, 1.49);
}

/* ============================================
   Onboarding Overlay
   ============================================ */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 15, 30, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.onboarding-overlay.hidden {
  display: none;
}

.onboarding-card {
  background: var(--glass-bg-solid);
  backdrop-filter: blur(30px);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  max-width: 420px;
  width: 100%;
  text-align: center;
  animation: modal-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.onboarding-logo {
  font-size: 4rem;
  margin-bottom: var(--space-md);
}

.onboarding-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: var(--space-xs);
}

.onboarding-subtitle {
  color: var(--text-secondary);
  margin-bottom: var(--space-xl);
}

.onboarding-avatar-picker {
  position: relative;
  width: 120px;
  height: 120px;
  margin: 0 auto var(--space-lg);
  cursor: pointer;
}

.onboarding-avatar-preview {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  border: 4px solid var(--glass-border);
  overflow: hidden;
  transition: var(--transition-bounce);
}

.onboarding-avatar-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.onboarding-avatar-picker:hover .onboarding-avatar-preview {
  transform: scale(1.05);
  border-color: white;
}



.onboarding-input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: var(--space-lg);
  transition: var(--transition-normal);
}

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

.onboarding-input:focus {
  outline: none;
  border-color: white;
}

/* ============================================
   Cooking Mode Fullscreen
   ============================================ */
.cooking-mode {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg,
      var(--gradient-start) 0%,
      var(--gradient-mid) 50%,
      var(--gradient-end) 100%);
  z-index: 400;
  display: none;
  flex-direction: column;
  padding: var(--space-lg);
  overflow: hidden;
}

.cooking-mode.active {
  display: flex;
}

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

.cooking-close {
  width: 48px;
  height: 48px;
  background: var(--glass-bg);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition-bounce);
}

.cooking-close:hover {
  background: var(--glass-bg-solid);
  transform: scale(1.1);
}

.cooking-progress {
  display: flex;
  gap: var(--space-xs);
  flex: 1;
  justify-content: center;
  padding: 0 var(--space-lg);
}

.cooking-progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--glass-border);
  transition: var(--transition-normal);
}

.cooking-progress-dot.active {
  background: white;
  transform: scale(1.2);
}

.cooking-progress-dot.completed {
  background: var(--success);
}

.cooking-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-lg);
}

.cooking-step-number {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.cooking-step-text {
  font-size: 1.8rem;
  font-weight: 600;
  line-height: 1.4;
  max-width: 500px;
  animation: step-in 0.5s ease;
}

@keyframes step-in {
  0% {
    opacity: 0;
    transform: translateX(50px);
  }

  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

.cooking-emoji {
  font-size: 6rem;
  margin-bottom: var(--space-lg);
  animation: cooking-bounce 2s ease-in-out infinite;
}

@keyframes cooking-bounce {

  0%,
  100% {
    transform: translateY(0) rotate(-3deg);
  }

  50% {
    transform: translateY(-15px) rotate(3deg);
  }
}

.cooking-done-btn {
  margin-top: var(--space-xl);
  padding: var(--space-lg) var(--space-2xl);
  font-size: 1.2rem;
}

/* Cooking Complete State */
.cooking-complete {
  animation: complete-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes complete-in {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }

  100% {
    opacity: 1;
    transform: scale(1);
  }
}

.cooking-complete-emoji {
  font-size: 8rem;
  margin-bottom: var(--space-lg);
}

.cooking-complete-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: var(--space-md);
}

.cooking-complete-text {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ============================================
   Sugar Level Display
   ============================================ */
.sugar-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(217, 70, 239, 0.3), rgba(249, 115, 22, 0.3));
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  margin-top: var(--space-xs);
}

.sugar-badge svg {
  width: 14px;
  height: 14px;
}

/* Daily Sugar Tracker */
.sugar-tracker {
  padding: var(--space-lg);
  margin-top: var(--space-md);
  text-align: center;
}

.sugar-tracker-title {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.sugar-tracker-value {
  font-size: 2.5rem;
  font-weight: 700;
}

.sugar-tracker-value.warning {
  color: var(--warning);
}

.sugar-tracker-value.danger {
  color: var(--danger);
}

.sugar-tracker-bar {
  height: 8px;
  background: var(--glass-bg);
  border-radius: var(--radius-full);
  margin-top: var(--space-md);
  overflow: hidden;
}

.sugar-tracker-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--warning), var(--danger));
  border-radius: var(--radius-full);
  transition: width 0.5s ease;
}

.sugar-tracker-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* ============================================
   Profile Avatar with Image
   ============================================ */
.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ============================================
   Location Permission Card
   ============================================ */
.location-card {
  padding: var(--space-lg);
  text-align: center;
  margin-bottom: var(--space-lg);
}

.location-card-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
}

.location-card-text {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
}

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

/* ============================================
   Loading Overlay Update
   ============================================ */
.loading-overlay {
  background: linear-gradient(135deg,
      rgba(8, 145, 178, 0.95) 0%,
      rgba(217, 70, 239, 0.95) 50%,
      rgba(249, 115, 22, 0.95) 100%);
}

/* ============================================
   Shopping List
   ============================================ */
.shopping-list {
  list-style: none;
}

.shopping-item {
  display: flex;
  align-items: center;
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-bounce);
}

.shopping-item:hover {
  transform: translateX(4px);
  background: var(--glass-bg-solid);
}

.shopping-item.checked {
  opacity: 0.6;
  text-decoration: line-through;
  background: rgba(0, 0, 0, 0.1);
}

.shopping-checkbox {
  width: 24px;
  height: 24px;
  border: 2px solid var(--text-primary);
  border-radius: 6px;
  margin-right: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.shopping-item.checked .shopping-checkbox {
  background: var(--success);
  border-color: var(--success);
}

.shopping-item.checked .shopping-checkbox::after {
  content: '✓';
  color: white;
  font-size: 14px;
  font-weight: bold;
}

/* Loading Animation */
.loading-animation {
  position: relative;
  width: 100px;
  height: 100px;
  margin: 0 auto 20px;
}

.chef-hat {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  color: var(--primary);
  animation: hat-float 2s ease-in-out infinite;
}

.ai-star {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 40px;
  height: 40px;
  color: #fbbf24;
  /* Gold/Yellow */
  animation: star-pulse 1.5s ease-in-out infinite;
}

@keyframes hat-float {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes star-pulse {

  0%,
  100% {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }

  50% {
    transform: scale(1.2) rotate(15deg);
    opacity: 0.8;
  }
}

.loading-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Diet Mode Badges */
.badge-container {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 80%;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Vegan - Bright Green */
.badge-vegan {
  background: #22c55e;
  color: white;
  box-shadow: 0 2px 8px rgba(34, 197, 94, 0.4);
}

/* Vegetarian - Lime Green */
.badge-vegetarian {
  background: #84cc16;
  color: white;
  box-shadow: 0 2px 8px rgba(132, 204, 22, 0.4);
}

/* Adapté (Adapted to health) - Orange */
.badge-adapted {
  background: #f97316;
  color: white;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.4);
}

/* Diabetic - RED (blood drop) */
.badge-diabetic {
  background: #ef4444;
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}


/* IG Bas (Low Glycemic Index) - Blue */
.badge-ig-bas,
.badge-sugar {
  background: #3b82f6;
  color: white;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* GI Badge Pill Style */
.badge-gi {
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-gi::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: currentColor;
}

.badge-gi.text-green-500 {
  color: #4ade80;
}

.badge-gi.text-yellow-500 {
  color: #facc15;
}

.badge-gi.text-red-500 {
  color: #f87171;
}

.badge-calories {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
}

/* Ingredient Quantity Styling */
.ingredient-qty {
  color: var(--primary);
  font-weight: 600;
  margin-right: 4px;
}

/* Delete Account Button */
.delete-account-btn {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(255, 107, 107, 0.3);
  width: 100%;
  margin-top: var(--space-lg);
}

.delete-account-btn:hover {
  background: rgba(255, 107, 107, 0.1);
}

/* Fix avatar image sizing */
#avatar-img,
.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.onboarding-avatar-preview {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  border: 2px solid var(--primary);
  position: relative;
  z-index: 5;
}

.onboarding-card .btn-primary {
  position: relative;
  z-index: 100;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white !important;
  font-weight: 600;
  padding: 16px 32px;
  border: none;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.3s ease;
  pointer-events: auto !important;
}

.onboarding-card .btn-primary:hover {
  transform: scale(1.02);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* Ensure avatar image doesn't block button clicks */
.onboarding-avatar-preview img {
  pointer-events: none;
}



/* Profile Mode Badges */
.profile-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.profile-mode-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-mode-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

.profile-mode-badge svg {
  width: 14px;
  height: 14px;
}

.profile-mode-badge.diabetic {
  background: rgba(251, 146, 60, 0.2);
  color: #fb923c;
}

.profile-mode-badge.vegetarian {
  background: rgba(74, 222, 128, 0.2);
  color: #4ade80;
}

.profile-mode-badge.vegan {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
}

/* Profile Edit Styles */
.profile-edit-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  width: 100%;
}

.profile-edit-wrapper.hidden {
  display: none;
}

.profile-name-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  color: white;
  font-family: var(--font-family);
  font-size: 1rem;
}

.btn-save-profile {
  background: var(--success);
  border: none;
  color: white;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
}

.profile-avatar {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--glass-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: var(--space-md);
  cursor: default;
}

.profile-avatar.editable {
  cursor: pointer;
  border: 2px dashed rgba(255, 255, 255, 0.5);
}

.onboarding-avatar-edit {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
  z-index: 10;
}

.onboarding-avatar-edit:hover {
  transform: scale(1.1);
}

.onboarding-avatar-edit svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.avatar-edit-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.profile-avatar.editable:hover .avatar-edit-overlay {
  opacity: 1;
}

.avatar-edit-overlay.hidden {
  display: none;
}

/* No Recipes Found Card */
.no-recipes-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.no-recipes-icon {
  font-size: 4rem;
  margin-bottom: var(--space-md);
  animation: gentle-bounce 2s ease-in-out infinite;
}

@keyframes gentle-bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* Cleaner Loading Animation */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 30, 0.95);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: var(--space-lg);
}

.loading-overlay.active {
  display: flex;
}

.loading-animation {
  position: relative;
  width: 100px;
  height: 100px;
}

.loading-chef {
  font-size: 4rem;
  animation: chef-cook 1.5s ease-in-out infinite;
}

.loading-sparkles {
  position: absolute;
  top: -10px;
  right: -10px;
  font-size: 1.5rem;
  animation: sparkle 1s ease-in-out infinite;
}

@keyframes chef-cook {

  0%,
  100% {
    transform: rotate(-5deg) scale(1);
  }

  50% {
    transform: rotate(5deg) scale(1.05);
  }
}

@keyframes sparkle {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
}

.loading-text {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.loading-dots {
  display: inline-flex;
  gap: 4px;
}

.loading-dots span {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  animation: dot-pulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) {
  animation-delay: 0.2s;
}

.loading-dots span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes dot-pulse {

  0%,
  80%,
  100% {
    transform: scale(0.6);
    opacity: 0.5;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================
   Chef Thinking / Cooking Animation
   ============================================ */
.chef-thinking-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(102, 126, 234, 0.95);
  backdrop-filter: blur(20px);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

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

.cooking-container {
  position: relative;
  width: 200px;
  height: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.pan-container {
  position: relative;
  animation: pan-toss 1s ease-in-out infinite;
  transform-origin: 100% 50%;
}

.pan {
  width: 120px;
  height: 60px;
  background: #374151;
  border-radius: 0 0 60px 60px;
  position: relative;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.2);
  z-index: 5;
}

.pan::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 10px;
  right: 10px;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}

.handle {
  position: absolute;
  right: -70px;
  top: 10px;
  width: 80px;
  height: 20px;
  background: #1f2937;
  border-radius: 0 10px 10px 0;
  transform: rotate(-5deg);
}

.food-item {
  position: absolute;
  top: 0;
  width: 40px;
  height: 40px;
  background: #fbbf24;
  border-radius: 50%;
  animation: food-flip 1s ease-in-out infinite;
  z-index: -1;
}

@keyframes pan-toss {

  0%,
  100% {
    transform: rotate(0deg);
  }

  25% {
    transform: rotate(-10deg);
  }

  50% {
    transform: rotate(0deg);
  }

  75% {
    transform: rotate(5deg);
  }
}

@keyframes food-flip {
  0% {
    transform: translateY(0) rotate(0deg);
  }

  25% {
    transform: translateY(-120px) rotate(-180deg) scale(1.2);
  }

  50% {
    transform: translateY(-140px) rotate(-360deg) scale(1.2);
  }

  75% {
    transform: translateY(0) rotate(-540deg) scale(1);
  }

  100% {
    transform: translateY(0) rotate(-720deg);
  }
}

.cooking-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-top: var(--space-md);
  text-align: center;
  animation: pulse-text 1.5s ease-in-out infinite;
}

@keyframes pulse-text {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.8;
    transform: scale(0.98);
  }
}

/* Step Timer UI */
#step-timer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  transition: opacity 0.3s ease;
}

#step-timer-container.hidden {
  display: none;
}

.timer-display {
  font-family: 'Monaco', monospace;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Correct Badge Styles */
.badge-diabetic {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.badge-sugar {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.badge-glutenfree {
  background: rgba(249, 115, 22, 0.2);
  color: #f97316;
  box-shadow: 0 0 15px rgba(249, 115, 22, 0.4);
}

.badge-vegan {
  background: rgba(34, 197, 94, 0.2);
  color: #22c55e;
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

.badge-vegetarian {
  background: rgba(167, 139, 250, 0.2);
  color: #a78bfa;
  box-shadow: 0 0 15px rgba(167, 139, 250, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

/* =========================================
   TUTORIAL OVERLAY 
   ========================================= */
.tutorial-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.tutorial-overlay:not(.hidden) {
  opacity: 1;
  visibility: visible;
}

.tutorial-card {
  width: 100%;
  max-width: 400px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tutorial-overlay:not(.hidden) .tutorial-card {
  transform: translateY(0);
}

.tutorial-slides {
  width: 100%;
  position: relative;
  min-height: 250px;
  /* Adjust based on content */
  overflow: hidden;
}

.tutorial-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateX(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

.tutorial-slide.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  position: relative;
  /* Make it take up space */
}

.tutorial-icon {
  font-size: 4rem;
  margin-bottom: var(--space-md);
  animation: float 3s ease-in-out infinite;
}

.tutorial-slide h2 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
  color: var(--text);
}

.tutorial-slide p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 1rem;
}

.tutorial-dots {
  display: flex;
  gap: 8px;
  margin: var(--space-lg) 0;
}

.tutorial-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.tutorial-dot.active {
  background: var(--primary);
  width: 20px;
  border-radius: 4px;
}

.tutorial-actions {
  width: 100%;
  display: flex;
  justify-content: space-between;
  gap: var(--space-md);
}

/* =========================================
   PROFILE BADGES & BORDERS
   ========================================= */
.profile-avatar {
  border: 4px solid transparent;
  /* Default border invisible */
  transition: border-color 0.3s ease;
  padding: 4px;
  /* Space between border and image */
}

/* Green border for Vegan */
.profile-avatar.vegan-border {
  border-color: #22c55e;
}

/* Light Green for Vegetarian */
.profile-avatar.vegetarian-border {
  border-color: #4ade80;
}

/* Remove old text badges if they exist */
.diet-badge {
  display: none !important;
}

/* ============================================

   EMERGENCY FIXES FOR OVERLAYS
   ============================================ */

/* Ensure generic hidden class works */
.hidden {
  display: none !important;
}

/* Hide all modal-overlay elements by default */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 500;
  align-items: center;
  justify-content: center;
}

/* Show modal-overlay when active (via JS) */
.modal-overlay.active {
  display: flex !important;
}

/* Hide cooking-mode by default */
/* Hide cooking-mode by default */
#cooking-mode {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  background: var(--background);
  /* Solid background for readability */
  /* Higher than recipe detail */
}

#cooking-mode.active {
  display: flex !important;
}

/* Hide recipe-detail by default (JS controls via inline style) */
#recipe-detail {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--background, #0f172a);
  z-index: 1000;
  overflow-y: auto;
}

/* Onboarding overlay - hidden when .hidden class is present */
.onboarding-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.onboarding-overlay.hidden {
  display: none !important;
}

/* Tutorial overlay */
#tutorial-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 600;
  background: rgba(0, 0, 0, 0.9);
}

#tutorial-overlay.active {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Chef thinking overlay */
.chef-thinking-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 700;
}

.chef-thinking-overlay.active {
  display: flex !important;
}

/* Loading overlay */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.loading-overlay.active {
  display: flex !important;
}

/* ============================================
   Surprise Cloud Animation
   ============================================ */
.surprise-cloud {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  height: 400px;
  pointer-events: none;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.surprise-cloud-glow {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.4) 0%, rgba(59, 130, 246, 0.1) 50%, transparent 70%);
  filter: blur(40px);
  opacity: 0;
  animation: glow-fade-in 1s ease-out forwards;
}

.cloud-thumbnail {
  position: absolute;
  width: 60px;
  height: 60px;
  background: var(--surface-color);
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  /* Start offset by randomly assigned CSS vars --tx, --ty in JS */
  /* But we animate FROM bottom center TO target */
  opacity: 0;
  transform: translate(0, 50px) scale(0.5);
  /* Start pos */
  animation: cloud-pop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    cloud-float 6s ease-in-out infinite alternate;
}

@keyframes glow-fade-in {
  to {
    opacity: 1;
  }
}

@keyframes cloud-pop {
  to {
    opacity: 1;
    transform: translate(var(--tx), var(--ty)) scale(1);
  }
}

@keyframes cloud-float {
  0% {
    margin-top: 0px;
  }

  100% {
    margin-top: -10px;
  }
}

/* Shake Animation for empty search */
.shake {
  animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

  10%,
  90% {
    transform: translate3d(-1px, 0, 0);
  }

  20%,
  80% {
    transform: translate3d(2px, 0, 0);
  }

  30%,
  50%,
  70% {
    transform: translate3d(-3px, 0, 0);
  }

  40%,
  60% {
    transform: translate3d(3px, 0, 0);
  }
}