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

:root {
  --bg-dark: #090a0f;
  --card-bg: rgba(20, 24, 33, 0.65);
  --border-color: rgba(255, 255, 255, 0.08);
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  
  --accent-red: #e74c3c;
  --accent-red-glow: rgba(231, 76, 60, 0.4);
  --accent-green: #2ecc71;
  --accent-green-glow: rgba(46, 204, 113, 0.4);
  --accent-gold: #f1c40f;
  --accent-gold-glow: rgba(241, 196, 15, 0.4);
  
  --font-headings: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.6;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(231, 76, 60, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(46, 204, 113, 0.08) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Header styling */
header {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 10, 15, 0.8);
}

.logo {
  font-family: var(--font-headings);
  font-weight: 800;
  font-size: 1.5rem;
  background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.premium-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  background: linear-gradient(135deg, #f1c40f, #f39c12);
  color: #000;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.3);
}

/* Container Layout */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
}

/* Hero Section */
.hero-section {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.2rem;
  align-items: center;
}

@media (max-width: 968px) {
  .hero-section {
    grid-template-columns: 1fr;
  }
}

.hero-text h1 {
  font-family: var(--font-headings);
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

.hero-text h1 span {
  background: linear-gradient(135deg, var(--accent-red) 30%, var(--accent-green) 80%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-text p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  max-width: 600px;
}

.hero-visual {
  position: relative;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  aspect-ratio: 4/3;
}

.hero-visual picture,
.recipe-img-container picture {
  display: block;
  width: 100%;
  height: 100%;
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.hero-visual:hover img {
  transform: scale(1.03);
}

.hero-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9, 10, 15, 0.7) 0%, transparent 60%);
  pointer-events: none;
}

/* Interactive Card System - Glassmorphism */
.glass-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 2rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
  transform: translateY(-4px);
}

/* Section Title styling */
.section-header {
  margin-bottom: 1rem;
  text-align: center;
}

.section-header h2 {
  font-family: var(--font-headings);
  font-size: 2.2rem;
  font-weight: 700;
  position: relative;
  display: inline-block;
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent-red), var(--accent-green));
}

.section-header p {
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* Dynamic Portion Calculator & Dashboard Grid */
.calculator-grid {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.calculator-left-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.calculator-right-col {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

@media (max-width: 968px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }
}

.calculator-widget {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.control-label {
  font-family: var(--font-headings);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.control-label span.weight-value {
  color: var(--accent-green);
  font-size: 1.25rem;
  font-weight: 700;
}

/* Custom Range Slider */
.slider-container {
  position: relative;
  display: flex;
  align-items: center;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
  transition: var(--transition-smooth);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-red), var(--accent-green));
  cursor: pointer;
  box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
  transition: var(--transition-smooth);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.8);
}

/* Preset Portion Buttons */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.8rem;
}

@media (max-width: 480px) {
  .presets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.btn-preset {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.8rem 0.5rem;
  border-radius: 12px;
  cursor: pointer;
  font-family: var(--font-headings);
  font-weight: 500;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.btn-preset span.desc {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-preset:hover, .btn-preset.active {
  background: rgba(46, 204, 113, 0.15);
  border-color: var(--accent-green);
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.2);
}

.btn-preset.active span.desc {
  color: var(--text-main);
}

/* Macronutrient Gauges */
.macro-gauges {
  display: flex;
  justify-content: space-around;
  margin-top: 1rem;
}

.macro-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.circle-svg {
  width: 100px;
  height: 100px;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 8;
}

.circle-fill {
  fill: none;
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s ease;
}

.ring-carbs .circle-fill {
  stroke: var(--accent-red);
}
.ring-protein .circle-fill {
  stroke: var(--accent-green);
}
.ring-fat .circle-fill {
  stroke: var(--accent-gold);
}

.macro-ring-text {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.macro-val {
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1;
}

.macro-unit {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.macro-label {
  font-family: var(--font-headings);
  font-weight: 600;
  margin-top: 0.8rem;
  font-size: 0.9rem;
}

/* Nutrition Details Dashboard */
.nutrition-dashboard {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.summary-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 1.2rem 1.8rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
}

.cal-count {
  display: flex;
  flex-direction: column;
}

.cal-count .num {
  font-family: var(--font-headings);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-red);
  line-height: 1.1;
  text-shadow: 0 0 20px var(--accent-red-glow);
}

.cal-count .lbl {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Detailed Nutrition Grid */
.detail-nutrients-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

@media (max-width: 480px) {
  .detail-nutrients-grid {
    grid-template-columns: 1fr;
  }
}

.nutrient-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: var(--transition-smooth);
}

.nutrient-row:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

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

.nutrient-row:hover .nutrient-name {
  color: var(--text-main);
}

.nutrient-value {
  font-family: var(--font-headings);
  font-weight: 700;
  color: var(--text-main);
}

/* Apple Varieties Matrix */
.variety-section {
  margin-bottom: 1.5rem;
}

.variety-selector {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.btn-variety {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.6rem 1.5rem;
  border-radius: 50px;
  cursor: pointer;
  font-family: var(--font-headings);
  font-weight: 600;
  transition: var(--transition-smooth);
}

.btn-variety:hover, .btn-variety.active {
  background: var(--text-main);
  color: var(--bg-dark);
  box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

.variety-display {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2rem;
  align-items: center;
  min-height: 320px;
}

@media (max-width: 768px) {
  .variety-display {
    grid-template-columns: 1fr;
  }
}

.variety-visual-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 100%;
}

.variety-apple-img {
  width: 200px;
  height: 200px;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
  transition: var(--transition-smooth);
}

.variety-display:hover .variety-apple-img {
  transform: rotate(15deg) scale(1.05);
}

.variety-glow {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  filter: blur(40px);
  z-index: -1;
  opacity: 0.4;
  transition: var(--transition-smooth);
}

.variety-info h3 {
  font-family: var(--font-headings);
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
}

.variety-origin {
  font-size: 0.85rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 1rem;
}

.variety-desc {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.meter-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.meter-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.meter-label {
  width: 90px;
  font-size: 0.85rem;
  font-weight: 600;
}

.meter-bar-container {
  flex-grow: 1;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 1s cubic-bezier(0.16, 1, 0.3, 1);
}

.best-uses {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge-use {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Health Benefits Grid */
.benefits-section {
  margin-bottom: 1.5rem;
}

.benefits-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 580px) {
  .benefits-grid {
    grid-template-columns: 1fr;
  }
}

.benefit-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.benefit-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
}

.benefit-card:hover .benefit-icon {
  transform: scale(1.1) rotate(5deg);
}

.benefit-card.red-theme .benefit-icon {
  color: var(--accent-red);
  border-color: rgba(231, 76, 60, 0.3);
  box-shadow: 0 0 15px rgba(231, 76, 60, 0.1);
}

.benefit-card.green-theme .benefit-icon {
  color: var(--accent-green);
  border-color: rgba(46, 204, 113, 0.3);
  box-shadow: 0 0 15px rgba(46, 204, 113, 0.1);
}

.benefit-card.gold-theme .benefit-icon {
  color: var(--accent-gold);
  border-color: rgba(241, 196, 15, 0.3);
  box-shadow: 0 0 15px rgba(241, 196, 15, 0.1);
}

.benefit-card h3 {
  font-family: var(--font-headings);
  font-size: 1.2rem;
  font-weight: 700;
}

.benefit-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Premium Recipes Section */
.recipes-section {
  margin-bottom: 1.5rem;
}

.recipes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

@media (max-width: 968px) {
  .recipes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 640px) {
  .recipes-grid {
    grid-template-columns: 1fr;
  }
}

.recipe-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  height: 100%;
}

.recipe-img-container {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}

.recipe-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-smooth);
}

.recipe-card:hover .recipe-img-container img {
  transform: scale(1.05);
}

.recipe-tag {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(9, 10, 15, 0.85);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.8rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-green);
  backdrop-filter: blur(5px);
}

.recipe-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.recipe-content h3 {
  font-family: var(--font-headings);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  transition: var(--transition-smooth);
}

.recipe-card:hover .recipe-content h3 {
  color: var(--accent-green);
}

.recipe-content p {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.recipe-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1rem;
}

.recipe-meta span {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* Trivia Drawer Section */
.trivia-section {
  margin-bottom: 1.5rem;
}

.faq-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 800px;
  margin: 0 auto;
}

.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  overflow: hidden;
  transition: var(--transition-smooth);
}

.faq-header {
  padding: 1.2rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.faq-header h3 {
  font-family: var(--font-headings);
  font-size: 1.05rem;
  font-weight: 600;
}

.faq-icon {
  font-size: 1.2rem;
  transition: var(--transition-smooth);
  color: var(--accent-green);
}

.faq-body {
  padding: 0 1.5rem;
  max-height: 0;
  overflow: hidden;
  transition: var(--transition-smooth);
  color: var(--text-muted);
  font-size: 0.95rem;
}

.faq-item.active {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(20, 24, 33, 0.8);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
  color: var(--accent-red);
}

.faq-item.active .faq-body {
  padding: 0 1.5rem 1.5rem 1.5rem;
  max-height: 200px;
}

/* Footer Section */
footer {
  text-align: center;
  padding: 3rem 2rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.85rem;
  background: rgba(9, 10, 15, 0.5);
}

footer p {
  margin-bottom: 0.5rem;
}

footer a {
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition-smooth);
}

footer a:hover {
  color: var(--accent-green);
}

/* Advanced Profile section */
.advanced-profile-section {
  padding: 0 !important;
  overflow: hidden;
}
.advanced-header {
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
  transition: var(--transition-smooth);
}
.advanced-header:hover {
  background: rgba(255, 255, 255, 0.03);
}
.advanced-header h3 {
  font-family: var(--font-headings);
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}
.advanced-body {
  max-height: 0;
  overflow: hidden;
  transition: var(--transition-smooth);
  padding: 0 2rem;
}
.advanced-profile-section.active .advanced-body {
  max-height: 1200px;
  padding: 1.5rem 2rem 2.5rem 2rem;
  border-top: 1px solid var(--border-color);
}
.advanced-profile-section.active #advanced-icon {
  transform: rotate(45deg);
  color: var(--accent-red);
}
.advanced-tabs {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.8rem;
  flex-wrap: wrap;
}
.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-headings);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  padding: 0.3rem 0.8rem;
  position: relative;
  transition: var(--transition-smooth);
}
.tab-btn:hover, .tab-btn.active {
  color: var(--text-main);
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -0.85rem;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-green);
  border-radius: 2px;
}
.tab-content {
  display: none;
  animation: fadeIn 0.4s ease;
}
.tab-content.active {
  display: block;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Micro animations */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 0.4;
  }
  50% {
    transform: scale(1.05);
    opacity: 0.6;
  }
}

.variety-glow {
  animation: pulse 4s infinite ease-in-out;
}

/* Spotlight Search Container */
.search-container {
  width: 100%;
  max-width: 600px;
}

.search-label {
  font-family: var(--font-headings);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-green);
  margin-bottom: 0.6rem;
  padding-left: 0.2rem;
  text-shadow: 0 0 10px var(--accent-green-glow);
  transition: var(--transition-smooth);
}

.search-wrapper {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  padding: 1rem 1.5rem;
  transition: var(--transition-smooth);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.02), 0 4px 20px rgba(0, 0, 0, 0.3);
}

.search-wrapper:focus-within {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-green);
  box-shadow: 0 0 25px var(--accent-green-glow), 0 8px 32px rgba(0, 0, 0, 0.4);
}

.search-icon {
  color: var(--text-muted);
  font-size: 1.25rem;
  transition: var(--transition-smooth);
}

.search-wrapper:focus-within .search-icon {
  color: var(--accent-green);
  transform: scale(1.15);
}

#food-search-input {
  flex-grow: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 1.1rem;
  font-weight: 600;
}

#food-search-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.search-clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.search-clear-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

/* Spotlight Results Dropdown */
.search-results-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 100%;
  background: rgba(18, 22, 30, 0.95);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 200;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 0.5rem;
  transition: var(--transition-smooth);
  animation: slideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-results-dropdown.hidden {
  display: none;
}

.search-results-dropdown::-webkit-scrollbar {
  width: 6px;
}

.search-results-dropdown::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  border-radius: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: var(--font-headings);
  font-weight: 500;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.search-result-item i {
  font-size: 1rem;
  color: var(--accent-green);
  opacity: 0.7;
  transition: var(--transition-smooth);
}

.search-result-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.search-result-item:hover i {
  opacity: 1;
  transform: scale(1.1);
}

.search-result-item mark {
  background: none;
  color: var(--accent-green);
  font-weight: 700;
}

.no-results {
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

/* Dynamic Glassmorphic Visual Container */
.dynamic-visual-container {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.01);
  border-radius: 24px;
}

/* Moving/rotating animated glass orb */
.dynamic-orb {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-green) 100%);
  filter: blur(30px);
  opacity: 0.65;
  animation: orbFloat 6s infinite ease-in-out, orbColorShift 10s infinite alternate linear;
  transition: var(--transition-smooth);
}

/* Central floating glass card displaying the name and an icon */
.dynamic-glass-card {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 180px;
  height: 180px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: cardFloat 5s infinite ease-in-out;
  transition: var(--transition-smooth);
}

.dynamic-glass-card i {
  font-size: 3.5rem;
  color: var(--accent-green);
  text-shadow: 0 0 20px var(--accent-green-glow);
  transition: var(--transition-smooth);
}

.dynamic-glass-card span {
  font-family: var(--font-headings);
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  padding: 0 0.5rem;
  color: var(--text-main);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Floating Animations */
@keyframes orbFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-10px, 15px) scale(1.15);
  }
}

@keyframes cardFloat {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

@keyframes orbColorShift {
  0% {
    filter: blur(30px) hue-rotate(0deg);
  }
  100% {
    filter: blur(35px) hue-rotate(90deg);
  }
}

/* Glass badge overlay on hero visual */
.hero-visual-badge {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1.2rem;
  background: rgba(9, 10, 15, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 10;
  transition: var(--transition-smooth);
}

.hero-visual-badge i {
  color: var(--accent-green);
  font-size: 1rem;
  text-shadow: 0 0 10px var(--accent-green-glow);
}

.hero-visual-badge span {
  font-family: var(--font-headings);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Dynamic Exercise Burner Styling */
.exercise-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

@media (max-width: 968px) {
  .exercise-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .exercise-grid {
    grid-template-columns: 1fr;
  }
}

.exercise-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 18px;
  padding: 1.2rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  transition: var(--transition-smooth);
}

.exercise-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.exercise-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  transition: var(--transition-smooth);
}

.exercise-card:hover .exercise-icon {
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.1);
}

.exercise-card:nth-child(1) .exercise-icon {
  color: var(--accent-red);
  border-color: rgba(231, 76, 60, 0.3);
}

.exercise-card:nth-child(2) .exercise-icon {
  color: var(--accent-green);
  border-color: rgba(46, 204, 113, 0.3);
}

.exercise-card:nth-child(3) .exercise-icon {
  color: #3498db;
  border-color: rgba(52, 152, 219, 0.3);
}

.exercise-card:nth-child(4) .exercise-icon {
  color: var(--accent-gold);
  border-color: rgba(241, 196, 15, 0.3);
}

.exercise-info {
  display: flex;
  flex-direction: column;
}

.exercise-name {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.exercise-duration {
  font-family: var(--font-headings);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Premium Dropdown Styling */
.select-container {
  position: relative;
  width: 100%;
}
.premium-select {
  width: 100%;
  padding: 0.8rem 1.2rem;
  border-radius: 12px;
  background: rgba(9, 10, 15, 0.7);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  appearance: none;
  transition: var(--transition-smooth);
}
.premium-select:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(9, 10, 15, 0.9);
}
.premium-select:focus {
  border-color: var(--accent-green);
  box-shadow: 0 0 12px rgba(46, 204, 113, 0.2);
}
.select-container::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  right: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.8rem;
}

/* Micro-nutrient Progress Bars */
.nutrient-row.flex-column {
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
}
.nutrient-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.2rem;
}
.nutrient-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.6s ease;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

/* Biochemical Radar Tab Layout */
.radar-tab-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
  padding: 1rem 0;
}
@media (max-width: 640px) {
  .radar-tab-layout {
    grid-template-columns: 1fr;
    text-align: center;
  }
}
.radar-chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  min-height: 260px;
}
.radar-chart-container svg {
  width: 100%;
  max-width: 250px;
  height: 250px;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.4));
}
.radar-legend {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.radar-legend h4 {
  font-family: var(--font-headings);
  font-size: 1.3rem;
  color: var(--text-main);
}
.radar-legend p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.radar-legend-items {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.5rem;
}
.radar-legend-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.88rem;
}
@media (max-width: 640px) {
  .radar-legend-item {
    justify-content: center;
  }
}
.legend-color {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

/* SVG Radar Styling */
.radar-grid-line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}
.radar-grid-circle {
  fill: none;
  stroke: rgba(255, 255, 255, 0.05);
  stroke-width: 1;
}
.radar-axis-label {
  fill: var(--text-muted);
  font-family: var(--font-body);
  font-size: 8px;
  font-weight: 500;
  text-anchor: middle;
}
.radar-polygon-current {
  fill: rgba(46, 204, 113, 0.25);
  stroke: var(--accent-green);
  stroke-width: 2;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 0 6px var(--accent-green-glow));
}
.radar-polygon-target {
  fill: none;
  stroke: rgba(255, 255, 255, 0.2);
  stroke-width: 1.5;
  stroke-dasharray: 3 3;
}
.radar-dot {
  fill: var(--accent-green);
  stroke: var(--bg-dark);
  stroke-width: 1.5;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Premium Native Ad unit layouts */
.native-ad-section {
  position: relative;
  width: 100%;
}
.ad-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}
.ad-card {
  padding: 1.5rem !important;
  background: linear-gradient(135deg, rgba(20, 24, 33, 0.8), rgba(15, 18, 26, 0.8)) !important;
  border-color: rgba(241, 196, 15, 0.15) !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35) !important;
}
.ad-card:hover {
  border-color: rgba(241, 196, 15, 0.3) !important;
  transform: translateY(-2px) !important;
}
.ad-badge-top {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(241, 196, 15, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  border: 1px solid rgba(241, 196, 15, 0.25);
}
.ad-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1.5rem;
  align-items: center;
}
@media (max-width: 580px) {
  .ad-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
}
.ad-visual {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
@media (max-width: 580px) {
  .ad-visual {
    margin: 0 auto;
  }
}
.ad-visual-glow {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background-color: var(--accent-green);
  filter: blur(25px);
  opacity: 0.25;
  transition: var(--transition-smooth);
}
.ad-icon {
  font-size: 3.5rem;
  color: var(--accent-green);
  filter: drop-shadow(0 0 10px var(--accent-green-glow));
  z-index: 1;
  transition: var(--transition-smooth);
}
.ad-card:hover .ad-icon {
  transform: scale(1.1) rotate(5deg);
}
.ad-details {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.ad-sponsor-name {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ad-display-url {
  color: var(--accent-green);
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: -0.2rem;
  margin-bottom: 0.2rem;
  display: block;
  text-decoration: none;
}
.ad-product-title {
  font-family: var(--font-headings);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}
.ad-product-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.ad-action-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-top: 0.5rem;
}
@media (max-width: 580px) {
  .ad-action-row {
    justify-content: center;
  }
}
.ad-price {
  font-family: var(--font-headings);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Floating collapsible Bottom Meal Basket Drawer */
.meal-basket-drawer {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1280px;
  background: rgba(13, 16, 23, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: none;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  z-index: 99;
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  box-shadow: 0 -15px 40px rgba(0, 0, 0, 0.5);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}
.meal-basket-drawer.collapsed {
  transform: translateX(-50%) translateY(calc(100% - 64px));
}
.basket-handle {
  height: 64px;
  padding: 0 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.3s ease;
}
.basket-handle:hover {
  background: rgba(255, 255, 255, 0.04);
}
.handle-bar {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0.4rem auto 0.2rem auto;
}
.basket-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}
.basket-title {
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 1.1rem;
}
.basket-count-badge {
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: 50px;
  background: var(--accent-green);
  color: #000;
  font-weight: 700;
}
.basket-macros-preview {
  display: flex;
  gap: 0.8rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}
@media (max-width: 580px) {
  .basket-macros-preview {
    display: none;
  }
}
.basket-macros-preview span {
  font-weight: 600;
}
.toggle-chevron {
  transition: transform 0.4s ease;
  color: var(--text-muted);
}
.meal-basket-drawer:not(.collapsed) .toggle-chevron {
  transform: rotate(180deg);
}
.basket-body {
  height: 380px;
  padding: 1.5rem 2rem;
  overflow-y: auto;
}
.basket-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
  height: 100%;
}
@media (max-width: 768px) {
  .basket-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
  .basket-body {
    height: 450px;
  }
}
.basket-items-list-container, .basket-analytics {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.basket-header {
  font-family: var(--font-headings);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.4rem;
}
.basket-items-list {
  flex-grow: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding-right: 0.5rem;
}
.empty-basket-message {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-align: center;
  margin-top: 3rem;
  font-style: italic;
}

/* Individual Basket Item Row */
.basket-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0.8rem 1.2rem;
  border-radius: 14px;
  transition: var(--transition-smooth);
}
.basket-item-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}
.basket-item-info {
  display: flex;
  flex-direction: column;
  min-width: 140px;
}
.basket-item-name {
  font-family: var(--font-headings);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}
.basket-item-cals {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.basket-item-slider-group {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-grow: 1;
}
.basket-item-slider-group input[type="range"] {
  height: 6px;
}
.basket-item-weight {
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--accent-green);
  min-width: 45px;
  text-align: right;
}
.basket-item-delete {
  background: transparent;
  border: none;
  color: rgba(231, 76, 60, 0.6);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  transition: var(--transition-smooth);
}
.basket-item-delete:hover {
  color: var(--accent-red);
  background: rgba(231, 76, 60, 0.1);
}

/* Basket Aggregate Visuals */
.basket-summary-banner {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  padding: 1rem 1.2rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.basket-cal-ring {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}
.cal-ring-text {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.cal-ring-text .num {
  font-family: var(--font-headings);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
}
.cal-ring-text .lbl {
  font-size: 0.6rem;
  color: var(--text-muted);
}
.basket-macros-caps {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  flex-grow: 1;
}
.macro-bar-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.macro-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
}
.macro-bar-track {
  width: 100%;
  height: 5px;
  background: rgba(255,255,255,0.05);
  border-radius: 3px;
  overflow: hidden;
}
.macro-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* Basket Ad Recommendation */
.basket-ad {
  margin-top: auto;
  border-radius: 14px;
}
.basket-ad .ad-tag {
  font-size: 0.65rem;
}
.basket-ad-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: linear-gradient(135deg, rgba(20,24,33,0.9), rgba(15,18,26,0.9));
  border: 1px solid rgba(46, 204, 113, 0.15);
  border-radius: 12px;
}
.basket-ad-icon {
  font-size: 1.4rem;
  filter: drop-shadow(0 0 6px var(--accent-green-glow));
}
.basket-ad-text {
  display: flex;
  flex-direction: column;
}
.basket-ad-title {
  font-family: var(--font-headings);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-main);
}
.basket-ad-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Basket inside-drawer search autocomplete dropdown */
.basket-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  max-height: 180px;
  overflow-y: auto;
  background: rgba(13, 16, 23, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  z-index: 150;
  margin-top: 5px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
}
.basket-search-results.hidden {
  display: none;
}
.basket-search-results-item {
  padding: 0.6rem 0.8rem;
  font-size: 0.75rem;
  color: var(--text-main);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  transition: background 0.2s ease;
}
.basket-search-results-item:hover {
  background: rgba(255, 255, 255, 0.05);
}
.basket-search-results-item mark {
  background: transparent;
  color: var(--accent-green);
  font-weight: 700;
}
.basket-search-results-item i {
  color: var(--accent-green);
  font-size: 0.8rem;
}

/* Plate mode calculator widget overlay banner */
.plate-mode-banner {
  transition: opacity 0.4s ease;
}
.plate-mode-banner.hidden {
  opacity: 0;
  pointer-events: none;
  display: none !important;
}

/* Quick add chips style */
.btn-quick-add {
  transition: var(--transition-smooth);
}
.btn-quick-add:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  border-color: rgba(255, 255, 255, 0.15) !important;
  transform: translateY(-1px);
}

/* SEO Nutrition Pages Layout */
.seo-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}
.seo-header-card {
  padding: 2rem;
  margin-bottom: 2rem;
  text-align: center;
  border-radius: 16px;
}
.seo-title {
  font-family: var(--font-headings);
  font-weight: 800;
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-green) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
}
.seo-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}
.seo-grid {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 1.5rem;
}
.seo-sidebar-left, .seo-sidebar-right {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.seo-main-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.quick-stats-card, .nutrients-table-card, .article-card, .cta-card, .directory-sidebar-card, .adsense-card {
  padding: 1.5rem;
  border-radius: 16px;
}
.quick-stats-card h3, .nutrients-table-card h2, .article-card h2, .cta-card h3, .directory-sidebar-card h3 {
  font-family: var(--font-headings);
  margin-bottom: 1rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}
.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 0;
  border-bottom: 1px dashed var(--border-color);
}
.stat-item:last-child {
  border-bottom: none;
}
.stat-label {
  color: var(--text-muted);
}
.stat-value {
  font-weight: 600;
  color: var(--text-main);
}
.directory-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 0.5rem;
}
.directory-list::-webkit-scrollbar {
  width: 4px;
}
.directory-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
.directory-link-item {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem;
  border-radius: 6px;
  transition: var(--transition-smooth);
}
.directory-link-item:hover {
  color: var(--accent-green);
  background: rgba(255, 255, 255, 0.03);
  padding-left: 0.6rem;
}
.article-card p {
  margin-bottom: 1rem;
  line-height: 1.7;
}
.article-card p:last-child {
  margin-bottom: 0;
}
.ad-tag {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  font-weight: 700;
  display: block;
  text-align: center;
  margin-bottom: 0.5rem;
}
.directory-section {
  padding: 2rem;
  border-radius: 16px;
}
.directory-card {
  transition: var(--transition-smooth);
}
.directory-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-green) !important;
  box-shadow: 0 4px 20px rgba(46, 204, 113, 0.15);
}

@media (max-width: 1024px) {
  .seo-grid {
    grid-template-columns: 1fr;
  }
  .seo-sidebar-left, .seo-sidebar-right {
    order: 2;
  }
  .seo-main-content {
    order: 1;
  }
}

/* Premium Global Navigation Menu */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(9, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Mobile hamburger toggle (pure CSS, no JS required) */
.nav-toggle-checkbox {
  display: none;
}

.hamburger-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  font-size: 1.1rem;
  cursor: pointer;
  order: 3;
  flex-shrink: 0;
}

@media (max-width: 820px) {
  .hamburger-btn {
    display: flex;
  }

  /* Nav becomes a collapsible full-width panel anchored under the header.
     Uses position:absolute (not fixed) relative to the header's own box,
     since header already establishes a containing block via backdrop-filter;
     this avoids the fixed-position-inside-backdrop-filter viewport bug. */
  .header-nav {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(9, 10, 15, 0.98);
    border-bottom: 1px solid var(--border-color);
    max-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    opacity: 0;
    visibility: hidden;
    padding: 0 1.25rem;
    transition: max-height 0.35s ease, opacity 0.25s ease, padding 0.35s ease;
  }

  .nav-toggle-checkbox:checked ~ .header-nav {
    max-height: calc(100vh - 72px);
    opacity: 1;
    visibility: visible;
    padding: 0.5rem 1.25rem 1.5rem;
  }

  .header-nav .nav-link,
  .header-nav .nav-dropdown-btn {
    width: 100%;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--border-color);
    justify-content: space-between;
  }

  .header-nav .nav-dropdown {
    display: block;
    width: 100%;
    min-width: 0;
  }

  /* Mega menus become static, always-expanded stacked lists instead of
     hover popups (hover is unreliable on touch), and drop to one column
     so a wide grid can't stretch the page past the viewport width. */
  .header-nav .nav-dropdown-content {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    min-width: 0;
    width: 100%;
    padding: 0 0 0.5rem 0;
  }

  .header-nav .mega-menu-grid,
  .header-nav .health-mega-menu-grid {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .header-nav .mega-menu-column {
    min-width: 0;
  }
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-headings);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition-smooth);
}

.nav-link:hover, .nav-link.active {
  color: var(--text-main);
}

/* Dropdown Menu Container */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-headings);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0;
  transition: var(--transition-smooth);
}

.nav-dropdown-btn i.fa-chevron-down {
  font-size: 0.75rem;
  transition: transform 0.3s ease;
}

.nav-dropdown:hover .nav-dropdown-btn {
  color: var(--text-main);
}

.nav-dropdown:hover .nav-dropdown-btn i.fa-chevron-down {
  transform: rotate(180deg);
}

/* Dropdown Content (Single Column) */
.nav-dropdown-content {
  display: block;
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(13, 16, 23, 0.96);
  min-width: 250px;
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  padding: 0.6rem;
  z-index: 1000;
  transition: opacity 0.3s, transform 0.3s, visibility 0.3s;
}

.nav-dropdown:hover .nav-dropdown-content {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-dropdown-content a {
  color: var(--text-muted);
  padding: 0.6rem 1rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  font-family: var(--font-headings);
  font-weight: 500;
  border-radius: 8px;
  transition: var(--transition-smooth);
}

.nav-dropdown-content a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  padding-left: 1.2rem;
}

/* Mega Menu Dropdown (Multi Column) */
.nav-dropdown-content.mega-menu {
  min-width: 650px;
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 0.8rem;
}

.mega-menu-column {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.mega-menu-column h4 {
  font-family: var(--font-headings);
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--accent-green);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
  padding-left: 0.6rem;
  border-left: 2px solid var(--accent-green);
}

/* ==========================================================================
   Phase 5: Premium Features Styles (Compare, Optimizer, Prints)
   ========================================================================== */

/* Plate Optimizer Warning Card */
.deficiency-warning-card {
  box-shadow: 0 0 15px rgba(230, 126, 34, 0.1);
  transition: var(--transition-smooth);
}
.deficiency-warning-card:hover {
  box-shadow: 0 0 25px rgba(230, 126, 34, 0.25);
  border-color: rgba(230, 126, 34, 0.4) !important;
}
@keyframes pulseGlow {
  0% {
    opacity: 0.6;
    filter: drop-shadow(0 0 2px rgba(230, 126, 34, 0.4));
  }
  100% {
    opacity: 1;
    filter: drop-shadow(0 0 10px rgba(230, 126, 34, 0.8));
  }
}

/* Compare Mode Styling */
.compare-tab-layout {
  animation: fadeIn 0.4s ease;
}
.compare-deck {
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 1.5rem;
  backdrop-filter: blur(10px);
}
.compare-layout-split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 2rem;
}
@media (max-width: 768px) {
  .compare-layout-split {
    grid-template-columns: 1fr;
  }
}
.compare-row {
  display: grid;
  grid-template-columns: 1fr 100px 1fr;
  align-items: center;
  padding: 0.6rem 0.8rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.02);
  transition: var(--transition-smooth);
}
.compare-row:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.05);
}
.compare-val-a {
  text-align: right;
  font-family: var(--font-headings);
  font-weight: 700;
}
.compare-val-b {
  text-align: left;
  font-family: var(--font-headings);
  font-weight: 700;
}
.compare-lbl {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.compare-win-icon {
  font-size: 0.8rem;
  color: var(--accent-gold);
  filter: drop-shadow(0 0 5px var(--accent-gold-glow));
}

/* Compare Radar Chart Polygons */
.radar-polygon-compare-a {
  fill: rgba(231, 76, 60, 0.3);
  stroke: #e74c3c;
  stroke-width: 2;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 0 6px rgba(231, 76, 60, 0.3));
}
.radar-polygon-compare-b {
  fill: rgba(46, 204, 113, 0.3);
  stroke: #2ecc71;
  stroke-width: 2;
  transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  filter: drop-shadow(0 0 6px rgba(46, 204, 113, 0.3));
}

/* Lab Report Print Style */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 11pt !important;
  }
  
  header, footer, .search-container, .hero-plate-card, 
  .presets-grid, .slider-container, #meal-basket-drawer, 
  .native-ad-section, #add-to-meal-btn, #print-report-btn, 
  .variety-section, .benefits-grid, .recipes-grid, 
  .trivia-section, .directory-section, .advanced-tabs,
  #plate-mode-banner, .compare-search-wrapper,
  .btn-variety, .header-nav, .premium-badge {
    display: none !important;
  }
  
  main {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  
  .calculator-grid {
    display: block !important;
    width: 100% !important;
  }
  
  .glass-card {
    background: none !important;
    border: 1px solid #ddd !important;
    border-radius: 12px !important;
    box-shadow: none !important;
    padding: 1.2rem !important;
    margin-bottom: 1.5rem !important;
    color: #000 !important;
    backdrop-filter: none !important;
    transform: none !important;
    page-break-inside: avoid;
  }
  
  .control-label, .nutrient-name, .nutrient-value, h1, h2, h3, h4, p, span, .macro-label, .macro-val {
    color: #000 !important;
    text-shadow: none !important;
  }
  
  .nutrient-progress-bar {
    border: 1px solid #555 !important;
    background: #eee !important;
  }
  
  .nutrient-progress-fill {
    background-color: #333 !important;
    box-shadow: none !important;
  }
  
  svg {
    filter: brightness(0.2) contrast(1.5) !important;
  }
  
  .advanced-profile-section {
    display: block !important;
    border: 1px solid #ddd !important;
    page-break-before: always;
  }
  
  .advanced-body {
    max-height: none !important;
    overflow: visible !important;
    display: block !important;
    padding: 1.5rem !important;
  }
  
  .tab-content {
    display: none !important;
  }
  
  .tab-content.active {
    display: block !important;
  }
  
  /* If in compare tab, print compare deck nicely */
  #tab-compare.active {
    display: block !important;
  }
}

/* --- Mobile nav width overrides (kept last so they win cascade ties
   against the equal-specificity .nav-dropdown-content.mega-menu /
   .mega-menu-grid rules defined earlier in this file). Chrome's mobile
   viewport sizing accounts for an element's intrinsic min-width even when
   a parent clips it with overflow-x:hidden, so the fixed 650px/3-column
   desktop mega-menu was silently forcing the whole page wider than the
   phone screen. --- */
@media (max-width: 820px) {
  .header-nav .nav-dropdown-content.mega-menu {
    min-width: 0;
    width: 100%;
  }

  .header-nav .mega-menu-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer grids are written with inline `style="grid-template-columns: ..."`
   on 78/78 pages (either `.footer-content` on health/condition/granny pages,
   or an unnamed first child div on index.html). Grid items default to
   min-width:auto, so a fixed 2 or 4 column footer can't shrink below its
   widest link/paragraph and silently stretches the whole page past the
   phone's screen width -- the exact bug class flagged for this project.
   Inline styles need !important to be overridden from an external sheet. */
@media (max-width: 640px) {
  .footer-content,
  footer > div:first-child {
    grid-template-columns: 1fr !important;
  }

  .footer-widget,
  footer > div:first-child > div {
    min-width: 0;
  }
}

/* Site-wide safety net: 116 elements across the site use an inline
   `style="display: grid; grid-template-columns: 1fr 1fr; ..."` (feature
   sections, comparison rows, CTA cards, etc.) with no responsive collapse.
   Grid items default to min-width:auto, so any of these with content wider
   than half the phone's screen silently stretches the whole page. An
   attribute selector lets one rule catch all of them without editing each
   inline style by hand; !important is required to beat the inline style. */
@media (max-width: 640px) {
  [style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-columns: 1fr 1fr"] > * {
    min-width: 0;
  }
  [style*="grid-template-columns: 2fr 1fr 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  [style*="grid-template-columns: 2fr 1fr 1fr 1fr"] > * {
    min-width: 0;
  }
  [style*="grid-template-columns: 1fr 40px 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* .top-ad-panel wraps a hardcoded 728x90 desktop leaderboard AdSense unit
     (inline style="width:728px;height:90px" on the <ins>, present on 77/78
     pages). It's a position:fixed, horizontally-centered panel, so on a
     phone screen the oversized ad genuinely forces a horizontal scrollbar
     in real browsers (not just an emulator quirk). Rather than resizing a
     live AdSense slot via CSS -- which can visually corrupt the served
     creative -- hide this desktop-only unit on mobile; the site's separate
     .floating-ad-panel is already sized responsively for phones and keeps
     showing ads there. */
  .top-ad-panel {
    display: none !important;
  }
}






