/* ============================================================
   RawDietPro 2.0 — Premium Health-Tech UI
   Theme: Midnight Jungle (Deep Charcoal, Neon Green, Sunset Glow)
============================================================ */

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

:root {
  --bg-deep: #0b0c10;
  --bg-card: rgba(255, 255, 255, 0.03);
  --bg-glass: rgba(255, 255, 255, 0.05);
  
  --primary: #45f3ff; /* Electric Cyan */
  --accent: #2ecc71;  /* Neon Green */
  --glow: rgba(46, 204, 113, 0.4);
  
  --orange: #ff9f43;
  --text-main: #f0f0f0;
  --text-dim: #94a3b8;
  --border: rgba(255, 255, 255, 0.1);
  --danger: #ff5e57;
  
  --font-main: 'Outfit', sans-serif;
  --radius: 20px;
}

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

body {
  font-family: var(--font-main);
  background-color: var(--bg-deep);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  padding-top: 80px;
}

/* ── DYNAMIC BACKGROUND ── */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: 
    radial-gradient(circle at 20% 20%, rgba(46, 204, 113, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(69, 243, 255, 0.05) 0%, transparent 40%);
  z-index: -1;
  pointer-events: none;
}

/* ── NAV BAR ───────────── */
.site-nav {
  position: fixed; top: 0; left: 0; width: 100%; height: 80px;
  background: rgba(11, 12, 16, 0.8);
  backdrop-filter: blur(15px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
}
.nav-inner {
  max-width: 1300px; margin: 0 auto; height: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 30px;
}
.nav-logo {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: white; font-weight: 900; font-size: 1.6rem;
  letter-spacing: -0.5px;
}
.nav-logo-icon { 
    filter: drop-shadow(0 0 8px var(--primary));
    font-size: 1.8rem;
}
.nav-logo span { color: var(--primary); }

/* ── HERO SECTION ───────── */
.hero { 
    text-align: center; 
    padding: 60px 20px 40px;
    position: relative;
}
.hero h1 { 
    font-size: clamp(2.5rem, 5vw, 4.2rem); 
    font-weight: 900; 
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -2px;
    margin-bottom: 20px;
    line-height: 1.1;
}
.hero p { 
    font-size: 1.25rem; 
    color: var(--text-dim); 
    max-width: 700px; 
    margin: 0 auto 30px;
    font-weight: 500;
}

/* ── LAYOUT ────────────── */
.container { max-width: 1300px; margin: 0 auto; padding: 40px 30px; }

.hybrid-layout {
  display: grid; grid-template-columns: 380px 1fr; gap: 40px; align-items: start;
}
@media (max-width: 1000px) { .hybrid-layout { grid-template-columns: 1fr; } }

/* ── CALCULATOR BOX (GLASS) ── */
.calc-box {
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  padding: 35px; border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  position: sticky; top: 110px;
}
.calc-box h2 { 
    font-size: 1.5rem; 
    font-weight: 800;
    margin-bottom: 25px; 
    display: flex;
    align-items: center;
    gap: 10px;
}
.calc-box h2::before {
    content: '';
    width: 4px; height: 24px;
    background: var(--primary);
    border-radius: 4px;
    box-shadow: 0 0 10px var(--primary);
}

.form-group { margin-bottom: 25px; }
.form-group label { 
    display: block; 
    font-weight: 700; 
    margin-bottom: 10px; 
    font-size: 0.9rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.form-control {
  width: 100%; 
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border);
  padding: 15px 18px; 
  border-radius: 12px; 
  color: white;
  font-family: var(--font-main); 
  font-size: 1.1rem;
  transition: all 0.3s;
}
.form-control:focus { 
    outline: none; 
    border-color: var(--primary); 
    box-shadow: 0 0 0 4px rgba(69, 243, 255, 0.1);
    background: rgba(0,0,0,0.5);
}

.calc-btn {
  width: 100%; 
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #000; border: none;
  padding: 18px; border-radius: 12px; 
  font-size: 1.1rem; font-weight: 800;
  cursor: pointer; 
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 10px 20px -10px var(--glow);
}
.calc-btn:hover { 
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px -10px var(--glow);
}

.macro-results {
  margin-top: 30px; 
  padding: 25px; 
  background: rgba(46, 204, 113, 0.08);
  border-radius: 16px; 
  border: 1px solid rgba(46, 204, 113, 0.2); 
  display: none;
  animation: slideIn 0.4s ease-out;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.macro-results.active { display: block; }
.macro-item { display: flex; justify-content: space-between; margin-bottom: 12px; font-weight: 600;}
.macro-item span:first-child { color: var(--text-dim); font-size: 0.95rem; }
.macro-item span:last-child { color: var(--accent); font-weight: 800; font-size: 1.2rem; }
.macro-total { 
    border-top: 1px solid rgba(255,255,255,0.1); 
    padding-top: 15px; margin-top: 15px; 
    font-size: 1.3rem; 
    color: white;
    text-align: center;
}

/* ── ALLERGY FILTER ARRAY ── */
.filter-section {
  background: var(--bg-glass);
  padding: 30px; border-radius: var(--radius);
  border: 1px solid var(--border); margin-bottom: 40px;
}
.filter-section h3 { 
    margin-bottom: 20px; 
    font-size: 1rem; 
    color: var(--text-dim); 
    text-transform: uppercase; 
    letter-spacing: 1px;
    font-weight: 800;
}
.tag-toggles { display: flex; flex-wrap: wrap; gap: 12px; }
.tag-btn {
  background: rgba(255,255,255,0.03); 
  border: 1px solid var(--border);
  color: var(--text-dim); 
  padding: 10px 20px; 
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer; 
  transition: all 0.3s;
}
.tag-btn:hover { border-color: var(--primary); color: white; }
.tag-btn.active {
  background: var(--danger); 
  border-color: var(--danger); 
  color: white;
  box-shadow: 0 0 15px rgba(255, 94, 87, 0.3);
}

/* ── RECIPE GRID ───────── */
.results-count { 
    font-weight: 800; 
    color: white; 
    font-size: 1.4rem; 
    margin-bottom: 25px; 
    display: flex;
    align-items: center;
    gap: 12px;
}
.results-count::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: var(--border);
}

.recipe-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); 
    gap: 25px; 
}
.recipe-card {
  background: var(--bg-glass); 
  border: 1px solid var(--border);
  border-radius: var(--radius); 
  overflow: hidden; 
  text-decoration: none; 
  color: inherit;
  transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex; flex-direction: column;
}
.recipe-card:hover { 
    transform: translateY(-8px); 
    box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.5);
    border-color: var(--primary);
    background: rgba(255,255,255,0.08);
}

.recipe-content { padding: 30px; flex-grow: 1; display: flex; flex-direction: column; }
.recipe-title { 
    font-size: 1.4rem; font-weight: 800; 
    margin-bottom: 12px; color: white; 
    line-height: 1.2;
}
.recipe-desc { 
    color: var(--text-dim); 
    font-size: 0.95rem; 
    margin-bottom: 20px; 
    flex-grow: 1; 
    line-height: 1.7;
}

.recipe-badging { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px;}
.badge-tag { 
    background: rgba(255, 94, 87, 0.1); 
    color: var(--danger); 
    padding: 5px 10px; 
    border-radius: 6px; 
    font-size: 0.7rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

.recipe-btn {
    margin-top: auto;
    color: var(--primary);
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.recipe-btn::after {
    content: '→';
    transition: transform 0.3s;
}
.recipe-card:hover .recipe-btn::after {
    transform: translateX(5px);
}

/* ── INDIVIDUAL RECIPE PAGE ── */
.recipe-hero { 
    padding: 80px 20px; 
    border-bottom: 1px solid var(--border); 
    text-align:center;
}
.recipe-hero h1 { font-size: 3.5rem; font-weight: 900; margin-bottom: 20px; letter-spacing: -2px;}
.recipe-layout { display: grid; grid-template-columns: 1fr 2fr; gap: 50px; margin-top: 50px; }
@media (max-width: 850px) { .recipe-layout { grid-template-columns: 1fr; } }

.ingredients-card { 
    background: var(--bg-glass); 
    border: 1px solid var(--border); 
    padding: 40px; 
    border-radius: var(--radius);
}
.ingredients-list { list-style: none; }
.ingredients-list li { 
    padding: 12px 0; 
    border-bottom: 1px solid var(--border); 
    font-weight: 600;
    color: var(--text-main);
}
.instructions-list { margin-left: 25px; }
.instructions-list li { 
    margin-bottom: 20px; 
    padding-left: 15px; 
    font-size: 1.1rem; 
    color: var(--text-dim);
}
.instructions-list li b { color: white; display: block; margin-bottom: 5px; font-size: 1.2rem;}

/* ── ADS & FOOTER ───────── */
.ad-slot { 
    background: rgba(255,255,255,0.02); 
    border: 1px dashed var(--border); 
    color: var(--text-dim); 
    display: flex; align-items: center; justify-content: center; 
    border-radius: 12px;
}
.ad-leaderboard { width: 100%; max-width: 970px; height: 90px; margin: 40px auto; }

.site-footer { 
    text-align: center; 
    padding: 60px 20px; 
    background: rgba(0,0,0,0.3); 
    border-top: 1px solid var(--border); 
    margin-top: 80px; 
    color: var(--text-dim);
}
.site-footer p { margin-bottom: 10px; }

/* ── UTILS ── */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── MOBILE OPTIMIZATIONS ── */
@media (max-width: 600px) {
  .hero h1 { font-size: 2.2rem; }
  .hybrid-layout { gap: 20px; }
  .calc-box { padding: 25px; position: relative; top: 0; }
  
  .tag-toggles { 
    gap: 14px; 
    justify-content: center;
  }
  .tag-btn { 
    padding: 12px 24px; 
    font-size: 1.05rem; 
    min-height: 48px; /* Meet 48px GSC requirement */
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 calc(50% - 14px); /* Two buttons per row on very small screens */
    min-width: 140px;
  }

  .nav-logo { font-size: 1.3rem; }
  .nav-inner { padding: 0 15px; }

  /* Fix overflow */
  .filter-section {
    padding: 20px 15px;
    margin-left: -5px;
    margin-right: -5px;
  }
}
