/* ============================================================
   STUDENTS ADDA — styles.css
   Design System · Animations · Components
   Cache-busted via PHP filemtime()
============================================================ */

/* ============================================================
   KEYFRAME ANIMATIONS
============================================================ */

/* Floating blob animations (ported from studyhub hero) */
@keyframes floatBlob1 {
  0%,  100% { transform: translate(0,   0)   scale(1);    }
  33%        { transform: translate(50px, -40px) scale(1.09); }
  66%        { transform: translate(-25px, 25px) scale(0.94); }
}
@keyframes floatBlob2 {
  0%,  100% { transform: translate(0,   0)   scale(1);    }
  33%        { transform: translate(-60px, 25px) scale(1.13); }
  66%        { transform: translate(35px, -50px) scale(0.91); }
}
@keyframes floatBlob3 {
  0%,  100% { transform: translate(0, 0)   scale(1);    }
  50%        { transform: translate(30px, 40px) scale(1.07); }
}
@keyframes floatBlob4 {
  0%,  100% { transform: translate(0, 0)   scale(1);    }
  40%        { transform: translate(-20px, -30px) scale(1.05); }
  80%        { transform: translate(15px, 20px)   scale(0.96); }
}

/* Particle float */
@keyframes floatParticle {
  0%   { transform: translateY(0)    rotate(0deg);   opacity: 0;   }
  10%  { opacity: 1; }
  90%  { opacity: 0.85; }
  100% { transform: translateY(-140px) rotate(360deg); opacity: 0; }
}

/* Card entrance */
@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(26px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Filter chip entrance stagger */
@keyframes chipEntrance {
  from { opacity: 0; transform: translateY(10px) scale(0.94); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* Glow pulse */
@keyframes pulseGlow {
  0%,  100% { box-shadow: 0 0 0 0   rgba(74, 222, 128, 0);    }
  50%        { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0.13); }
}

/* Shimmer for premium labels */
@keyframes shimmer {
  0%   { background-position: 200% 0;  }
  100% { background-position: -200% 0; }
}

/* Slide up for modals */
@keyframes slideUp {
  from { transform: translateY(22px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* Fade in */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Blob morph for modal decoration */
@keyframes blobMorph {
  0%,  100% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
  25%        { border-radius: 30% 60% 70% 40% / 50% 60% 30% 60%; }
  50%        { border-radius: 50% 60% 30% 60% / 30% 50% 70% 50%; }
  75%        { border-radius: 40% 50% 60% 30% / 60% 40% 50% 60%; }
}

/* Breathing dot */
@keyframes breathe {
  0%,  100% { opacity: 1;   transform: scale(1);   }
  50%        { opacity: 0.5; transform: scale(0.7); }
}

/* Ping / ripple */
@keyframes ping {
  0%   { box-shadow: 0 0 0 0   rgba(74, 222, 128, 0.55); }
  70%  { box-shadow: 0 0 0 9px rgba(74, 222, 128, 0);    }
  100% { box-shadow: 0 0 0 0   rgba(74, 222, 128, 0);    }
}

/* Spinner */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Click badge tick */
@keyframes badgeTick {
  0%   { transform: scale(1);    }
  40%  { transform: scale(1.18); }
  70%  { transform: scale(0.94); }
  100% { transform: scale(1);    }
}

/* Countdown digit flip */
@keyframes digitFlip {
  0%   { transform: rotateX(0deg);   opacity: 1;   }
  49%  { transform: rotateX(90deg);  opacity: 0;   }
  50%  { transform: rotateX(-90deg); opacity: 0;   }
  100% { transform: rotateX(0deg);   opacity: 1;   }
}

/* Ticker number roll */
@keyframes tickerRoll {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0);    }
}

/* Nav brand mark spin on hover */
@keyframes brandSpin {
  from { transform: rotate(0deg);   }
  to   { transform: rotate(360deg); }
}

/* Tab slide (for filter bar) */
@keyframes tabSlide {
  from { opacity: 0; transform: translateX(-10px); }
  to   { opacity: 1; transform: translateX(0);     }
}

/* Stat counter entrance */
@keyframes statFadeIn {
  from { opacity: 0; transform: translateX(-6px); }
  to   { opacity: 1; transform: translateX(0);    }
}

/* Search focus ripple */
@keyframes searchRipple {
  0%   { box-shadow: 0 0 0 0   rgba(74, 222, 128, 0.22); }
  100% { box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);   }
}

/* Reschedule overlay entrance */
@keyframes overlayFadeIn {
  from { opacity: 0; backdrop-filter: blur(0px); }
  to   { opacity: 1; backdrop-filter: blur(10px); }
}

/* ============================================================
   DESIGN SYSTEM — BABY GREEN MATTE
============================================================ */
:root {
  --void:       #080f0a;
  --base:       #0c1510;
  --surface-0:  #101a13;
  --surface-1:  #162019;
  --surface-2:  #1c2a1f;
  --surface-3:  #243228;

  --mint-50:    #f0fdf4;
  --mint-100:   #dcfce7;
  --mint-200:   #bbf7d0;
  --mint-300:   #86efac;
  --mint-400:   #4ade80;
  --mint-500:   #22c55e;
  --mint-600:   #16a34a;

  --sage:       #a3c9a8;
  --sage-dim:   #6b8f76;
  --sage-ghost: #3d5c45;

  --text-primary:   #e8f5ea;
  --text-secondary: #9bbfa3;
  --text-muted:     #5a7a62;
  --text-inverse:   #080f0a;

  --border-subtle:  rgba(74, 222, 128, 0.07);
  --border-soft:    rgba(74, 222, 128, 0.14);
  --border-mid:     rgba(74, 222, 128, 0.25);
  --border-strong:  rgba(74, 222, 128, 0.45);

  --glow-sm:   0 0 12px rgba(74, 222, 128, 0.12);
  --glow-md:   0 0 24px rgba(74, 222, 128, 0.18);
  --glow-lg:   0 0 48px rgba(74, 222, 128, 0.14);

  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-xl:   28px;
  --radius-pill: 999px;

  --ease-out-expo:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:      cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-in-out-quad: cubic-bezier(0.45, 0, 0.55, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  background-color: var(--void);
  color: var(--text-primary);
  padding-top: 76px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Grain overlay for matte texture */
body::before {
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.6;
}

/* ============================================================
   AMBIENT GLOW BLOBS (fixed background)
============================================================ */
.ambient {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.18;
}
.ambient-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #22c55e 0%, transparent 70%);
  top: -200px; left: -100px;
  animation: floatBlob2 18s ease-in-out infinite;
}
.ambient-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #15803d 0%, transparent 70%);
  bottom: 10%; right: -150px;
  animation: floatBlob1 14s ease-in-out infinite reverse;
}

/* ============================================================
   NAVBAR
============================================================ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 900;
  background: rgba(8, 15, 10, 0.88);
  backdrop-filter: blur(24px) saturate(1.4);
  border-bottom: 1px solid var(--border-subtle);
  height: 76px;
  display: flex; align-items: center;
  transition: background 0.35s ease, border-color 0.35s ease,
              box-shadow 0.35s ease;
}
.navbar.scrolled {
  background: rgba(8, 15, 10, 0.97);
  border-bottom-color: var(--border-soft);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}
.nav-inner {
  max-width: 1200px; width: 100%; margin: 0 auto;
  padding: 0 32px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand {
  font-family: 'Sora', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text-primary);
  text-decoration: none;
  display: flex; align-items: center; gap: 10px;
  letter-spacing: -0.02em;
}
.nav-brand-mark {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--mint-400) 0%, var(--mint-600) 100%);
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 12px rgba(74, 222, 128, 0.28);
  transition: transform 0.4s var(--ease-spring), box-shadow 0.3s ease;
}
.nav-brand:hover .nav-brand-mark {
  transform: rotate(15deg) scale(1.1);
  box-shadow: 0 4px 20px rgba(74, 222, 128, 0.45);
}
.nav-brand-mark .material-symbols-outlined {
  font-size: 18px;
  color: var(--void);
}
.nav-actions {
  display: flex; align-items: center; gap: 10px;
}
.nav-link-ghost {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  transition: all 0.22s ease;
}
.nav-link-ghost:hover {
  color: var(--mint-300);
  border-color: var(--border-soft);
  background: rgba(74, 222, 128, 0.04);
  transform: translateY(-1px);
}
.btn-nav-primary {
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--void);
  background: var(--mint-400);
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.22s ease;
  letter-spacing: 0.01em;
  position: relative; overflow: hidden;
}
.btn-nav-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255, 255, 255, 0.2);
  border-radius: inherit;
  opacity: 0;
  transform: scale(0);
  transition: transform 0.4s var(--ease-spring), opacity 0.3s ease;
}
.btn-nav-primary:hover {
  background: var(--mint-300);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(74, 222, 128, 0.3);
}
.btn-nav-primary:hover::after { opacity: 1; transform: scale(1); }
.btn-nav-primary:active { transform: scale(0.96); }

.nav-user-pill {
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--surface-1);
  cursor: pointer;
  position: relative;
  transition: all 0.22s ease;
}
.nav-user-pill:hover {
  border-color: var(--border-soft);
  color: var(--text-primary);
  box-shadow: var(--glow-sm);
}
.nav-user-avatar {
  width: 22px; height: 22px;
  background: linear-gradient(135deg, var(--mint-500), var(--mint-300));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--void);
  animation: pulseGlow 3s ease infinite;
}

/* Dropdown */
.dropdown-menu-custom {
  position: absolute; top: calc(100% + 10px); right: 0;
  min-width: 160px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 6px;
  opacity: 0; pointer-events: none;
  transform: translateY(-8px) scale(0.97);
  transition: all 0.22s var(--ease-out-expo);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4);
  transform-origin: top right;
}
.nav-user-pill:hover .dropdown-menu-custom {
  opacity: 1; pointer-events: all;
  transform: translateY(0) scale(1);
}
.dropdown-item-custom {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.84rem;
  text-decoration: none;
  transition: all 0.15s ease;
}
.dropdown-item-custom:hover {
  background: rgba(74, 222, 128, 0.08);
  color: var(--mint-300);
  transform: translateX(3px);
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.nav-toggle:hover {
  border-color: var(--border-mid);
  color: var(--mint-300);
}

/* ============================================================
   HERO — mesh gradients + floating blobs + dot grid + particles
============================================================ */
.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 32px 72px;
  text-align: center;
  /* Deep dark green base */
  background: #060d08;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Mesh gradient layer */
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 75% 55% at 12% 50%,  rgba(34, 197, 94, 0.45) 0%, transparent 60%),
    radial-gradient(ellipse 55% 70% at 88% 22%,  rgba(74, 222, 128, 0.30) 0%, transparent 55%),
    radial-gradient(ellipse 45% 45% at 50% 110%, rgba(21, 128, 61, 0.55)  0%, transparent 60%),
    radial-gradient(ellipse 32% 38% at 68% 78%,  rgba(16, 185, 129, 0.20) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Dot grid overlay */
.hero::after {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(circle, rgba(74, 222, 128, 0.07) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

/* Floating blob elements */
.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  pointer-events: none;
  mix-blend-mode: screen;
  z-index: 0;
}
.hero-blob-1 {
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.55) 0%, transparent 70%);
  top: -100px; left: -80px;
  animation: floatBlob1 14s ease-in-out infinite;
}
.hero-blob-2 {
  width: 340px; height: 340px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.38) 0%, transparent 70%);
  top: -60px; right: -40px;
  animation: floatBlob2 17s ease-in-out infinite;
}
.hero-blob-3 {
  width: 280px; height: 280px;
  background: radial-gradient(circle, rgba(74, 222, 128, 0.30) 0%, transparent 70%);
  bottom: -80px; left: 44%;
  animation: floatBlob3 12s ease-in-out infinite;
}
.hero-blob-4 {
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(21, 128, 61, 0.35) 0%, transparent 70%);
  bottom: 5px; right: 18%;
  animation: floatBlob4 10s ease-in-out infinite reverse;
}

/* Particles container */
.hero-particles {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.hero-particle {
  position: absolute;
  border-radius: 50%;
  animation: floatParticle linear infinite;
}

/* Hero content sits above all fx */
.hero-content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
}

.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(74, 222, 128, 0.07);
  border: 1px solid var(--border-soft);
  color: var(--mint-300);
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 28px;
  animation: slideUp 0.6s var(--ease-out-expo) both;
}
.hero-eyebrow-dot {
  width: 6px; height: 6px;
  background: var(--mint-400);
  border-radius: 50%;
  animation: breathe 2.4s ease-in-out infinite;
}

.hero-headline {
  font-family: 'Sora', sans-serif;
  font-size: clamp(2.8rem, 6vw, 5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: 20px;
  color: var(--text-primary);
  text-shadow: 0 4px 28px rgba(34, 197, 94, 0.4);
  animation: slideUp 0.65s 0.08s var(--ease-out-expo) both;
}
.hero-headline-accent {
  background: linear-gradient(135deg, var(--mint-300) 0%, var(--mint-400) 50%, #a3e4b5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  color: rgba(155, 191, 163, 0.80);
  font-size: 1.05rem;
  font-weight: 400;
  max-width: 520px;
  margin: 0 auto 36px;
  line-height: 1.65;
  animation: slideUp 0.65s 0.16s var(--ease-out-expo) both;
}

/* Search bar */
.search-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto 28px;
  animation: slideUp 0.65s 0.22s var(--ease-out-expo) both;
}
.search-field {
  width: 100%;
  background: rgba(22, 32, 25, 0.85);
  backdrop-filter: blur(20px);
  border: 1.5px solid rgba(74, 222, 128, 0.16);
  padding: 15px 20px 15px 52px;
  border-radius: var(--radius-pill);
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
  outline: none;
}
.search-field:focus {
  border-color: var(--border-mid);
  background: rgba(28, 42, 31, 0.95);
  animation: searchRipple 0.5s ease forwards;
}
.search-field::placeholder { color: var(--text-muted); }
.search-icon-wrap {
  position: absolute;
  left: 18px; top: 50%;
  transform: translateY(-50%);
  color: var(--sage-dim);
  pointer-events: none;
  transition: color 0.2s ease;
}
.search-wrap:focus-within .search-icon-wrap { color: var(--mint-400); }
.search-icon-wrap .material-symbols-outlined { font-size: 20px; }

/* Live ticker */
.live-ticker {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--sage);
  font-size: 0.82rem;
  font-weight: 500;
  animation: slideUp 0.65s 0.28s var(--ease-out-expo) both;
}
.live-dot {
  width: 7px; height: 7px;
  background: var(--mint-400);
  border-radius: 50%;
  animation: ping 2s ease infinite;
}
#activeUsers { animation: tickerRoll 0.4s var(--ease-out-expo); }

/* ============================================================
   FILTER BAR — staggered chip entrance
============================================================ */
.filter-bar {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 28px 32px 0;
  margin-bottom: 40px;
  position: relative; z-index: 1;
}
.filter-chip {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 7px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: var(--surface-1);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.22s ease;
  letter-spacing: 0.01em;
  /* Stagger entrance */
  opacity: 0;
  animation: chipEntrance 0.5s var(--ease-out-expo) both;
}
.filter-chip:nth-child(1) { animation-delay: 0.05s; }
.filter-chip:nth-child(2) { animation-delay: 0.12s; }
.filter-chip:nth-child(3) { animation-delay: 0.19s; }
.filter-chip:nth-child(4) { animation-delay: 0.26s; }
.filter-chip:nth-child(5) { animation-delay: 0.33s; }
.filter-chip:hover {
  border-color: var(--border-soft);
  color: var(--text-secondary);
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 222, 128, 0.06);
}
.filter-chip.active {
  background: rgba(74, 222, 128, 0.10);
  border-color: var(--border-mid);
  color: var(--mint-300);
  box-shadow: var(--glow-sm);
  animation: pulseGlow 3s ease infinite, chipEntrance 0.5s var(--ease-out-expo) both;
}
.filter-chip:active { transform: scale(0.95) !important; }

/* ============================================================
   TOOLS GRID
============================================================ */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px 80px;
  position: relative; z-index: 1;
}

/* ============================================================
   BLOB BUTTON SYSTEM (ported from studyhub)
   Works on any element with .sa-btn — tracks cursor and
   expands a soft blob from wherever the mouse entered.
============================================================ */
.sa-btn {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.22s var(--ease-spring),
              box-shadow 0.25s ease,
              background 0.2s ease,
              border-color 0.2s ease,
              color 0.2s ease;
}
.sa-btn-blob {
  position: absolute;
  width: 0; height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
  transform: translate(-50%, -50%) scale(0);
  pointer-events: none;
  z-index: 0;
  transition:
    width  0.55s cubic-bezier(.4, 0, .2, 1),
    height 0.55s cubic-bezier(.4, 0, .2, 1),
    opacity 0.4s ease,
    transform 0.55s cubic-bezier(.4, 0, .2, 1);
  opacity: 0;
}
.sa-btn:hover .sa-btn-blob {
  width: 360px; height: 360px;
  transform: translate(-50%, -50%) scale(1);
  opacity: 1;
}
.sa-btn:not(:hover) .sa-btn-blob {
  opacity: 0;
  transition-duration: 0.3s;
}
/* All direct children (non-blob) stay above */
.sa-btn > *:not(.sa-btn-blob) { position: relative; z-index: 1; }
/* Mint tint for outline-style buttons */
.sa-btn-outline .sa-btn-blob { background: rgba(74, 222, 128, 0.12); }
/* Solid green buttons use lighter blob */
.sa-btn-solid .sa-btn-blob  { background: rgba(255, 255, 255, 0.20); }
.sa-btn:hover  { transform: translateY(-2px); }
.sa-btn:active { transform: scale(0.96) !important; transition-duration: 0.08s !important; }

/* ============================================================
   TOOL CARD
============================================================ */
.tool-card {
  background: var(--surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  display: flex; flex-direction: column;
  position: relative;
  cursor: default;

  /* Scroll-reveal start state */
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity     0.5s ease,
    transform   0.5s var(--ease-out-expo),
    border-color 0.3s ease,
    box-shadow  0.3s ease;
}
.tool-card.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Inner glow on hover (studyhub radial glow technique) */
.tool-card::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 50% 0%, rgba(74, 222, 128, 0.07) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  z-index: 0;
}
.tool-card:hover {
  transform: translateY(-6px) scale(1.01);
  border-color: var(--border-mid);
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(74, 222, 128, 0.10) inset,
    var(--glow-md);
}
.tool-card:hover::before { opacity: 1; }

/* Stagger entrance for revealed cards */
.tools-grid .tool-card:nth-child(1)  { transition-delay: 0.03s; }
.tools-grid .tool-card:nth-child(2)  { transition-delay: 0.07s; }
.tools-grid .tool-card:nth-child(3)  { transition-delay: 0.11s; }
.tools-grid .tool-card:nth-child(4)  { transition-delay: 0.15s; }
.tools-grid .tool-card:nth-child(5)  { transition-delay: 0.19s; }
.tools-grid .tool-card:nth-child(6)  { transition-delay: 0.23s; }
.tools-grid .tool-card:nth-child(n+7){ transition-delay: 0.27s; }

/* Premium shimmer stripe */
.card-premium-stripe {
  position: absolute; top: 0; left: 0; right: 0; height: 2px; z-index: 4;
  background: linear-gradient(90deg, #a3c9a8, #4ade80, #bbf7d0, #4ade80, #a3c9a8);
  background-size: 300%;
  animation: shimmer 2.8s linear infinite;
}

/* Card image */
.card-img-wrap {
  position: relative;
  height: 192px;
  overflow: hidden;
  background: var(--surface-2);
  z-index: 1;
}
.card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out-expo), filter 0.4s ease;
  filter: saturate(0.85) brightness(0.88);
}
.tool-card:hover .card-img {
  transform: scale(1.05);
  filter: saturate(0.95) brightness(0.96);
}
.card-img-gradient {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 70%;
  background: linear-gradient(to top, rgba(12, 21, 16, 0.97) 0%, transparent 100%);
}

/* Labels */
.card-labels {
  position: absolute; bottom: 12px; left: 14px;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  border: 1px solid transparent;
  transition: transform 0.2s var(--ease-spring);
}
.tool-card:hover .chip { transform: translateY(-1px); }
.chip .material-symbols-outlined { font-size: 11px; }
.chip-ai      { background: rgba(74, 222, 128, 0.12); border-color: rgba(74, 222, 128, 0.25); color: var(--mint-300); }
.chip-premium { background: rgba(251, 191, 36, 0.10); border-color: rgba(251, 191, 36, 0.20); color: #fde68a; }
.chip-new     { background: rgba(56, 189, 248, 0.10); border-color: rgba(56, 189, 248, 0.20); color: #bae6fd; }
.chip-beta    { background: rgba(232, 121, 249, 0.10); border-color: rgba(232, 121, 249, 0.20); color: #f5d0fe; }

/* Discount tag */
.discount-tag {
  position: absolute; top: 12px; right: 12px;
  background: #dc2626;
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  letter-spacing: 0.02em;
  animation: pulseGlow 2.5s ease infinite;
}

/* Card body */
.card-body {
  padding: 20px 22px;
  flex: 1;
  display: flex; flex-direction: column;
  position: relative; z-index: 1;
}
.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.card-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
  letter-spacing: -0.02em;
  transition: color 0.2s ease;
}
.tool-card:hover .card-title { color: var(--mint-200); }
.card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex: 1;
  margin-bottom: 14px;
}

/* Stats row */
.card-stats {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
  animation: statFadeIn 0.4s var(--ease-out-expo) both;
}
.stat-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
  transition: color 0.2s ease, transform 0.2s ease;
}
.stat-item:hover { color: var(--text-secondary); transform: translateY(-1px); }
.stat-item .material-symbols-outlined { font-size: 14px; color: var(--sage-dim); }

/* Click count badge */
.click-count-badge {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(74, 222, 128, 0.07);
  border: 1px solid var(--border-subtle);
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  font-family: 'DM Mono', monospace;
  font-size: 0.72rem;
  color: var(--sage-dim);
  transition: all 0.25s ease;
  cursor: default;
}
.click-count-badge.ticked {
  color: var(--mint-400);
  border-color: var(--border-soft);
  background: rgba(74, 222, 128, 0.12);
  animation: badgeTick 0.35s var(--ease-spring);
}

/* Review stars */
.review-trigger {
  display: flex; align-items: center; gap: 4px;
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--text-muted);
  transition: color 0.2s ease, transform 0.2s ease;
}
.review-trigger:hover { color: #fbbf24; transform: translateY(-1px); }
.star-icon { color: #fbbf24; font-size: 0.85rem; }

/* Countdown row */
.countdown-row {
  font-size: 0.78rem;
  color: #fbbf24;
  display: flex; align-items: center; gap: 5px;
  margin-bottom: 10px;
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.14);
  border-radius: var(--radius-sm);
  padding: 5px 10px;
}
.countdown-row .material-symbols-outlined { font-size: 14px; }

/* Seats badge */
.seats-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #f87171;
  white-space: nowrap;
}
.seats-badge .material-symbols-outlined { font-size: 13px; }

/* Card action row */
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.btn-launch {
  flex: 1;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.86rem;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  letter-spacing: 0.01em;
  /* Blob system */
  position: relative; overflow: hidden; isolation: isolate;
  transition:
    transform 0.22s var(--ease-spring),
    box-shadow 0.25s ease,
    background 0.22s ease,
    border-color 0.22s ease;
}
.btn-launch > *:not(.sa-btn-blob) { position: relative; z-index: 1; }
.btn-launch:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-launch:not(:disabled):hover { transform: translateY(-2px); }
.btn-launch:not(:disabled):active { transform: scale(0.96) !important; }

.btn-launch-free {
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid var(--border-mid);
  color: var(--mint-300);
}
.btn-launch-free .sa-btn-blob { background: rgba(74, 222, 128, 0.15); }
.btn-launch-free:hover:not(:disabled) {
  background: rgba(74, 222, 128, 0.20);
  border-color: var(--border-strong);
  color: var(--mint-200);
  box-shadow: var(--glow-md);
}

.btn-launch-premium {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  border: none;
  color: #1a0f00;
  font-weight: 700;
}
.btn-launch-premium .sa-btn-blob { background: rgba(255, 255, 255, 0.22); }
.btn-launch-premium:hover:not(:disabled) {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.35);
}

.btn-icon {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.22s ease;
  flex-shrink: 0;
  position: relative; overflow: hidden;
}
.btn-icon .material-symbols-outlined { font-size: 17px; position: relative; z-index: 1; }
.btn-icon:hover {
  border-color: var(--border-soft);
  color: var(--mint-300);
  background: rgba(74, 222, 128, 0.07);
  transform: translateY(-2px) scale(1.05);
  box-shadow: var(--glow-sm);
}
.btn-icon:active { transform: scale(0.93) !important; }

/* ============================================================
   RESCHEDULED OVERLAY
============================================================ */
.reschedule-overlay {
  position: absolute; inset: 0;
  background: rgba(8, 15, 10, 0.88);
  backdrop-filter: blur(10px);
  z-index: 10;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 24px;
  border-radius: inherit;
  animation: overlayFadeIn 0.4s ease both;
}
.reschedule-overlay .material-symbols-outlined {
  font-size: 36px; color: #fbbf24; margin-bottom: 10px;
  animation: floatBlob3 3s ease-in-out infinite;
}
.countdown-mono {
  font-family: 'DM Mono', monospace;
  font-size: 1.1rem;
  color: var(--mint-300);
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid var(--border-soft);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  margin-top: 8px;
  letter-spacing: 0.08em;
  animation: pulseGlow 2s ease infinite;
}

/* ============================================================
   STATES — Empty / Loading
============================================================ */
.state-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 0;
  color: var(--text-muted);
  animation: fadeIn 0.4s ease;
}
.spinner {
  width: 36px; height: 36px;
  border: 2px solid var(--border-subtle);
  border-top-color: var(--mint-400);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 14px;
}

/* ============================================================
   MODALS
============================================================ */
.modal-backdrop-custom {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop-custom.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal-box {
  background: var(--surface-1);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 480px;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.5),
              0 0 0 1px rgba(74, 222, 128, 0.04) inset;
  animation: slideUp 0.30s var(--ease-spring);
  overflow: hidden;
}
.modal-box.wide { max-width: 720px; }

.modal-header {
  padding: 24px 28px 0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}
.modal-close {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.18s ease;
}
.modal-close:hover {
  color: var(--text-primary);
  border-color: var(--border-soft);
  transform: rotate(90deg) scale(1.1);
}
.modal-close .material-symbols-outlined { font-size: 16px; }
.modal-body { padding: 20px 28px 28px; }

/* Form fields */
.field-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field-label {
  font-size: 0.78rem; font-weight: 600; color: var(--text-muted);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.field-input {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.field-input:focus {
  border-color: var(--border-mid);
  background: var(--surface-3);
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.07);
}
.field-input::placeholder { color: var(--text-muted); }
textarea.field-input { resize: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Primary button */
.btn-primary-full {
  width: 100%;
  background: var(--mint-500);
  color: var(--void);
  border: none;
  padding: 11px 20px;
  border-radius: var(--radius-md);
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 8px;
  position: relative; overflow: hidden; isolation: isolate;
  transition: all 0.22s ease;
}
.btn-primary-full > *:not(.sa-btn-blob) { position: relative; z-index: 1; }
.btn-primary-full:hover {
  background: var(--mint-400);
  box-shadow: 0 6px 24px rgba(74, 222, 128, 0.32);
  transform: translateY(-2px);
}
.btn-primary-full:active { transform: scale(0.97); }
.divider { height: 1px; background: var(--border-subtle); margin: 16px 0; }

/* ============================================================
   REVIEW MODAL — Star Rating
============================================================ */
.star-rating-row {
  display: flex; justify-content: center; gap: 8px;
  margin-bottom: 16px;
}
.star-btn {
  font-size: 2rem;
  cursor: pointer;
  color: var(--surface-3);
  transition: all 0.18s var(--ease-spring);
  background: none; border: none;
}
.star-btn.lit { color: #fbbf24; }
.star-btn:hover { transform: scale(1.22) rotate(-5deg); }

/* ============================================================
   TOOL DETAIL MODAL
============================================================ */
.detail-hero {
  position: relative;
  height: 220px;
  overflow: hidden;
}
.detail-hero img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.7) saturate(0.8);
  transition: transform 0.6s var(--ease-out-expo);
}
.detail-hero:hover img { transform: scale(1.03); }
.detail-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--surface-1) 0%, rgba(16, 26, 19, 0.3) 100%);
  display: flex; align-items: flex-end; padding: 20px 24px;
}
.detail-hero-title {
  font-family: 'Sora', sans-serif;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

/* Reviews inside detail modal */
.review-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
  transition: transform 0.2s ease;
}
.review-item:hover { transform: translateX(4px); }
.review-stars { color: #fbbf24; font-size: 0.85rem; margin-bottom: 4px; }
.review-text { font-size: 0.85rem; color: var(--text-muted); }
.btn-write-review {
  background: none;
  border: 1px solid var(--border-soft);
  color: var(--mint-300);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.22s ease;
}
.btn-write-review:hover {
  background: rgba(74, 222, 128, 0.08);
  border-color: var(--border-mid);
  transform: translateY(-1px);
}

/* ============================================================
   TIPPY CUSTOM THEME
============================================================ */
.tippy-box[data-theme~='adda'] {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-secondary);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.tippy-box[data-theme~='adda'][data-placement^='top'] > .tippy-arrow::before {
  border-top-color: var(--surface-2);
}
.tippy-box[data-theme~='adda'][data-placement^='bottom'] > .tippy-arrow::before {
  border-bottom-color: var(--surface-2);
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 768px) {
  body { padding-top: 76px; }
  .hero { padding: 64px 20px 48px; }
  .hero-headline { font-size: 2.5rem; }
  .tools-grid { grid-template-columns: 1fr; padding: 0 20px 60px; gap: 16px; }
  .filter-bar { padding: 20px 20px 0; }
  .nav-inner { padding: 0 20px; }
  .nav-toggle { display: flex; }
  .nav-actions-expanded { display: none; }
  .nav-actions-expanded.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 76px; left: 0; right: 0;
    background: var(--surface-1);
    border-bottom: 1px solid var(--border-subtle);
    padding: 16px 20px;
    gap: 10px;
    z-index: 850;
    animation: slideUp 0.25s var(--ease-out-expo);
  }
}

@media (max-width: 480px) {
  .modal-body { padding: 18px; }
  .field-row { grid-template-columns: 1fr; }
}