/* ===== GROWTH GORILLA DARK PREMIUM THEME ===== */
/* Exact brand tokens from master prompt */

:root {
  --gg-bg: #06090f;            /* page */
  --gg-surface: #0a0f1a;       /* cards */
  --gg-elev: #0f172a;          /* inputs/raised */
  --gg-text: #e6f1ff;          /* primary text */
  --gg-muted: #9aa4b2;         /* secondary text */
  --gg-accent: #22c55e;        /* Gorilla green */
  --gg-accent-900: #0b2e17;
  --gg-border: #1e293b;
  --gg-grad-from: #0a1020;     /* hero gradient */
  --gg-grad-to: #062416;       /* subtle green */
  --gg-shadow: 0 12px 40px rgba(0,0,0,.45);
}

.gg-theme { color:var(--gg-text); background:var(--gg-bg); }
.gg-card { background:var(--gg-surface); border:1px solid var(--gg-border); border-radius:16px; }
.gg-hero { background: radial-gradient(1200px 600px at 65% 20%, rgba(34,197,94,0.06), transparent),
                    linear-gradient(135deg, var(--gg-grad-from), var(--gg-grad-to)); }
.gg-btn { background:var(--gg-accent); color:#06140a; border-radius:10px; padding:.85rem 1.2rem; font-weight:700; }
.gg-btn:hover { filter:brightness(1.05); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(34,197,94,.25);}
.gg-badge { background:var(--gg-accent-900); color:var(--gg-accent); border:1px solid var(--gg-accent); border-radius:999px; padding:.2rem .6rem; font-weight:600; font-size:.75rem;}
.gg-muted { color:var(--gg-muted); }

/* Apply base dark theme to main container */
.gg-theme {
  color: var(--gg-text);
  background: var(--gg-bg);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
}

/* ===== BASE COMPONENTS ===== */
.gg-card {
  background: var(--gg-surface);
  border: 1px solid var(--gg-border);
  border-radius: 16px;
  box-shadow: var(--gg-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gg-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 40px rgba(0,0,0,.55);
}

.gg-accent {
  color: var(--gg-accent);
  font-weight: 600;
}

.gg-btn {
  background: var(--gg-accent);
  color: #051006;
  border-radius: 10px;
  padding: 0.8rem 1.2rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  position: relative;
  overflow: hidden;
}

.gg-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.gg-btn:hover::before {
  left: 100%;
}

.gg-btn:hover {
  background: #2dd865;
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(34, 197, 94, 0.3);
}

.gg-btn:focus {
  outline: 2px solid var(--gg-accent);
  outline-offset: 2px;
}

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

/* ===== HERO GRADIENT ===== */
.gg-hero {
  background: linear-gradient(135deg, var(--gg-gradient-from), var(--gg-gradient-to));
  position: relative;
  overflow: hidden;
}

/* Hide hero mobile-only block by default; enabled via media query on mobile */
.gg-hero .gg-mobile-only { display: none; }

.gg-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 20% 30%, rgba(34, 197, 94, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(10, 58, 29, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

/* ===== TYPOGRAPHY ===== */
.gg-theme h1,
.gg-theme h2,
.gg-theme h3,
.gg-theme h4,
.gg-theme h5,
.gg-theme h6 {
  color: var(--gg-text);
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 1rem 0;
}

.gg-theme h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.05;
}

.gg-theme h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
}

.gg-theme h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
}

.gg-theme p {
  color: var(--gg-muted);
  margin: 0 0 1rem 0;
  line-height: 1.6;
}

.gg-theme strong {
  color: var(--gg-text);
  font-weight: 600;
}

/* ===== LAYOUT UTILITIES ===== */
.gg-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.gg-section {
  padding: 80px 0;
}

.gg-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: center;
}

.gg-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.gg-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

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

.gg-mb-4 { margin-bottom: 1rem; }
.gg-mb-6 { margin-bottom: 1.5rem; }
.gg-mb-8 { margin-bottom: 2rem; }
.gg-mt-4 { margin-top: 1rem; }
.gg-mt-6 { margin-top: 1.5rem; }
.gg-mt-8 { margin-top: 2rem; }

/* ===== ANIMATIONS ===== */
@keyframes ggFadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gg-animate-in {
  animation: ggFadeInUp 0.6s ease-out forwards;
}

.gg-animate-delay-1 { animation-delay: 0.1s; }
.gg-animate-delay-2 { animation-delay: 0.2s; }
.gg-animate-delay-3 { animation-delay: 0.3s; }

/* ===== RESPONSIVE DESIGN (360px - 1440px) ===== */

/* Large Desktop (1440px+) */
@media (min-width: 1440px) {
  .gg-hero h1 {
    font-size: 64px;
  }
}

/* Desktop (1024px - 1439px) */
@media (max-width: 1439px) and (min-width: 1024px) {
  .gg-hero h1 {
    font-size: 56px;
  }
}

/* Tablet (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
  .gg-hero {
    padding: 60px 0;
  }
  
  .gg-hero div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 32px;
    text-align: center;
  }
  
  .gg-hero h1 {
    font-size: 48px;
  }
  
  /* Grid adjustments */
  div[style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px;
  }
  
  div[style*="grid-template-columns:repeat(3,1fr)"] {
    grid-template-columns: 1fr !important;
    gap: 24px;
  }
}

/* Mobile Large (481px - 767px) */
@media (max-width: 767px) and (min-width: 481px) {
  .gg-hero {
    padding: 50px 0;
    text-align: center;
  }
  
  .gg-hero div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 24px;
  }
  
  .gg-hero h1 {
    font-size: 40px;
    line-height: 1.1;
  }
  
  /* All grids single column on mobile */
  div[style*="grid-template-columns:repeat(4,1fr)"],
  div[style*="grid-template-columns:repeat(3,1fr)"],
  div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }
  
  /* Button adjustments */
  .gg-btn {
    padding: 0.8rem 1.1rem;
    font-size: 0.95rem;
  }
  
  /* Table responsive */
  table {
    font-size: 0.9rem;
  }
  
  th, td {
    padding: 8px 12px !important;
  }
}

/* Mobile Small (360px - 480px) */
@media (max-width: 480px) {
  /* Container and spacing */
  div[style*="max-width:1200px"],
  div[style*="max-width:1100px"],
  div[style*="max-width:1050px"],
  div[style*="max-width:1000px"],
  div[style*="max-width:950px"],
  div[style*="max-width:900px"],
  div[style*="max-width:800px"] {
    padding: 0 16px !important;
  }
  
  /* Hero mobile */
  .gg-hero {
    padding: 40px 0 !important;
    text-align: center;
  }
  
  .gg-hero h1 {
    font-size: 32px !important;
    line-height: 1.2;
  }
  
  .gg-hero div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 20px;
  }
  
  /* Force single column layouts */
  div[style*="grid-template-columns:repeat(4,1fr)"],
  div[style*="grid-template-columns:repeat(3,1fr)"],
  div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }
  
  /* Section padding */
  section[style*="padding"] {
    padding: 32px 0 !important;
  }
  
  /* Card adjustments */
  .gg-card {
    padding: 16px !important;
  }
  
  /* Button full width */
  .gg-btn {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: 0.9rem;
    justify-content: center;
  }
  
  /* Typography scaling */
  h1 {
    font-size: 28px !important;
  }
  
  h2 {
    font-size: 24px !important;
  }
  
  h3 {
    font-size: 20px !important;
  }
  
  h4 {
    font-size: 18px !important;
  }
  
  /* Table mobile */
  table {
    font-size: 0.8rem;
  }
  
  th, td {
    padding: 6px 8px !important;
  }
  
  /* Funnel stages responsive */
  div[style*="grid-template-columns:repeat(3,1fr)"] div[style*="border-radius:14px"] {
    padding: 12px !important;
  }
}

/* ===== Mobile optimizations for new layouts ===== */
@media (max-width: 767px) {
  /* Header cleanup: stack and center CTA */
  header .gg-btn { padding: 0.7rem 1rem; }

  /* Show/hide desktop/mobile blocks (hero-specific to avoid desktop bleed) */
  .gg-hero .gg-desktop-only { display: none !important; }
  .gg-hero .gg-mobile-only { display: block !important; }

  /* Waste section: ensure vertical stack, no overflow */
  .gg-grid-3, .gg-grid-4 { grid-template-columns: 1fr !important; }
  /* Center and tighten the Waste (Difference) section */
  .gg-how, .gg-compare, .gg-alt, .gg-band { }
  section.gg-section .gg-head { text-align: center !important; }
  section.gg-section .gg-head + .gg-card { margin-top: 16px !important; }
  section.gg-section .gg-container { gap: 24px !important; }
  /* Specific to Difference funnel: reduce gap between heading/badges and cards */
  section.gg-section .gg-container[style*="gap:56px"] { gap: 24px !important; }
  section.gg-section .gg-container .gg-gap-sm { justify-content: center !important; }

  /* Comparison header center fix */
  h2.gg-h2 { text-align: center; }

  /* Footer spacing and wrapping */
  footer > div[style*="display:flex"] {
    padding: 18px 16px !important;
    gap: 8px !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
  }
  footer p { text-align: center !important; width: 100%; }

  /* How It Works: heading above steps on mobile */
  .gg-how .gg-container { grid-template-columns: 1fr !important; }
  .gg-how-head { order: -1; }
  .gg-how-steps { order: 0; }
  .gg-how .gg-head { text-align: center !important; }

  /* Compare table -> stacked cards on mobile */
  .gg-compare .gg-card { overflow: visible !important; }
  .gg-compare table { display: none; }
  .gg-compare .gg-mobile-table { display: grid !important; grid-template-columns: 1fr; gap: 12px; }
  .gg-compare .gg-mobile-row { display: grid; grid-template-columns: 1fr; gap: 10px; padding: 14px; border:1px solid var(--gg-border); border-radius:12px; background:linear-gradient(135deg, rgba(255,255,255,0.02), rgba(255,255,255,0.04)); box-shadow: var(--gg-shadow); }
  .gg-compare .gg-mobile-row .k { font-weight:800; color:var(--gg-text); font-size: 16px; }
  .gg-compare .gg-mobile-row .cols { display:grid; grid-template-columns: 1fr; gap:10px; }
  .gg-compare .gg-mobile-row .line { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border-radius:10px; }
  .gg-compare .gg-mobile-row .line .name { color:var(--gg-muted); font-weight:600; }
  .gg-compare .gg-mobile-row .line .val { font-weight:700; }
  .gg-compare .gg-mobile-row .line.col-leads { background:rgba(255,255,255,0.02); }
  .gg-compare .gg-mobile-row .line.col-shops { background:rgba(255,255,255,0.02); }
  .gg-compare .gg-mobile-row .line.col-gg { background:rgba(34,197,94,0.10); color:var(--gg-accent); border:1px solid rgba(34,197,94,0.30); box-shadow: inset 0 0 0 1px rgba(34,197,94,.12); }

  /* Proof Batch metrics side-by-side */
  .gg-grid-4 { grid-template-columns: repeat(2, 1fr) !important; row-gap: 20px !important; }
  /* Hide Compare section entirely on mobile */
  section.gg-compare { display: none !important; }

  /* Header: center logo/text, hide CTA */
  header > div[style*="display:flex"] {
    justify-content: center !important;
  }
  header .gg-btn { display: none !important; }
}

@media (min-width: 768px) {
  /* Ensure mobile-only elements stay hidden on desktop */
  .gg-mobile-only { display: none !important; }
}

@media (max-width: 767px) {
  /* Force any 2-col inline grids to stack cleanly */
  section.gg-section .gg-container[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  /* Step cards in How It Works: full width and centered */
  section.gg-section .gg-card[style*="min-width:240px"] {
    width: 100% !important;
    min-width: 0 !important;
    justify-content: center;
  }

  /* Reduce card padding for smaller screens for tighter rhythm */
  .gg-section .gg-card {
    padding: 16px !important;
  }

  /* Comparison table: allow horizontal scroll without layout shift */
  .gg-card > table { min-width: 640px; }
  /* Only the comparison card should scroll horizontally, not the whole page */
  section .gg-card > table { display: block; }
  section .gg-card { overflow-x: auto !important; overflow-y: visible; -webkit-overflow-scrolling: touch; }
  body, html { overflow-x: hidden; }

  /* Chips spacing: tighter height for comfort */
  .gg-chip-bad { padding: .4rem .6rem !important; font-size: .85rem !important; }
  
  /* Center headings like How We Compare more reliably */
  .gg-head .gg-h2 { text-align: center !important; }

  /* Ensure desktop table is hidden for Compare on mobile */
  .gg-compare .gg-card > table { display: none !important; }
}

@media (max-width: 360px) {
  .gg-container {
    padding: 0 12px;
  }
  
  .gg-section {
    padding: 40px 0;
  }
}

/* ===== FOCUS AND ACCESSIBILITY ===== */
.gg-theme *:focus {
  outline: 2px solid var(--gg-accent);
  outline-offset: 2px;
}

.gg-theme button:focus,
.gg-theme a:focus {
  outline-color: var(--gg-accent);
}

/* ===== HIGH CONTRAST SUPPORT ===== */
@media (prefers-contrast: high) {
  .gg-theme {
    --gg-text: #ffffff;
    --gg-muted: #cccccc;
    --gg-border: #666666;
  }
}

/* ===== REDUCED MOTION SUPPORT ===== */
@media (prefers-reduced-motion: reduce) {
  .gg-theme *,
  .gg-theme *::before,
  .gg-theme *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
