/* ==========================================================================
   Catalogue d'Effets Web - Styles Principaux
   ========================================================================== */

/* --------------------------------------------------------------------------
   Variables & Reset
   -------------------------------------------------------------------------- */
:root {
  /* Primary Colors (accent) */
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --accent: #06b6d4;
  --accent-light: #22d3ee;

  /* Background Colors */
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #12121a;
  --bg-elevated: #1a1a24;
  --bg-dark: #0a0a0f; /* Legacy alias */
  --border: rgba(255, 255, 255, 0.08);

  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #8b8b93;

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --gradient-accent: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --gradient-warm: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
  --gradient-cool: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);

  /* Animation Speed Multiplier (1 = normal, 0.5 = faster, 2 = slower) */
  --animation-speed: 1;

  /* Grid Gap for density control */
  --grid-gap: 1.5rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
  --transition-smooth: 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Noise texture - hidden by default, shown with .theme-noise */
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)'/%3E%3C/svg%3E");
  opacity: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity var(--transition-base);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

/* ==========================================================================
   THEME SYSTEM
   ========================================================================== */

/* --------------------------------------------------------------------------
   Background Theme Classes
   -------------------------------------------------------------------------- */

/* Dark Theme (Default) */
.theme-dark,
body {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: #12121a;
  --bg-elevated: #1a1a24;
  --text-primary: #ffffff;
  --text-secondary: #a1a1aa;
  --text-muted: #8b8b93;
  --border: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

/* Light Theme */
.theme-light {
  --bg-primary: #f8fafc;
  --bg-secondary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-elevated: #ffffff;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: rgba(0, 0, 0, 0.1);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  background: var(--bg-primary);
  color: var(--text-primary);
}

.theme-light .nav {
  background: rgba(248, 250, 252, 0.9);
}

.theme-light .hero-badge {
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.2);
}

.theme-light .category-card::before {
  background: linear-gradient(135deg, transparent 50%, rgba(99, 102, 241, 0.08) 100%);
}

.theme-light .demo-tag {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
}

.theme-light .code-preview {
  background: #1e293b;
}

/* Gradient Theme - Animated gradient background */
.theme-gradient {
  position: relative;
}

.theme-gradient::after {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(
    -45deg,
    #0a0a1a,
    #1a0a2e,
    #0a1a2e,
    #0a2a1a,
    #2a1a0a,
    #1a0a1a
  );
  background-size: 400% 400%;
  animation: gradientShift calc(15s * var(--animation-speed)) ease infinite;
  z-index: -2;
  pointer-events: none;
}

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

/* Grid Theme - Dot grid pattern */
.theme-grid {
  position: relative;
}

.theme-grid::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(
    circle at center,
    rgba(99, 102, 241, 0.15) 1px,
    transparent 1px
  );
  background-size: 30px 30px;
  z-index: -1;
  pointer-events: none;
}

/* Noise Theme - Noise texture overlay */
.theme-noise::before {
  opacity: 0.04;
}

/* --------------------------------------------------------------------------
   Font Family Classes
   -------------------------------------------------------------------------- */
.font-inter {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.font-playfair {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

.font-space-grotesk {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
}

.font-jetbrains {
  font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

.font-poppins {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* Apply font to headings as well */
.font-inter h1, .font-inter h2, .font-inter h3, .font-inter h4, .font-inter h5, .font-inter h6 {
  font-family: inherit;
}

.font-playfair h1, .font-playfair h2, .font-playfair h3, .font-playfair h4, .font-playfair h5, .font-playfair h6 {
  font-family: inherit;
}

.font-space-grotesk h1, .font-space-grotesk h2, .font-space-grotesk h3, .font-space-grotesk h4, .font-space-grotesk h5, .font-space-grotesk h6 {
  font-family: inherit;
}

.font-jetbrains h1, .font-jetbrains h2, .font-jetbrains h3, .font-jetbrains h4, .font-jetbrains h5, .font-jetbrains h6 {
  font-family: inherit;
}

.font-poppins h1, .font-poppins h2, .font-poppins h3, .font-poppins h4, .font-poppins h5, .font-poppins h6 {
  font-family: inherit;
}

/* --------------------------------------------------------------------------
   Grid Density Classes
   -------------------------------------------------------------------------- */

/* Compact Density - smaller gaps, more condensed */
.density-compact {
  --grid-gap: 0.75rem;
  --space-4: 0.75rem;
  --space-6: 1rem;
  --space-8: 1.5rem;
}

.density-compact .category-card,
.density-compact .demo-card {
  padding: var(--space-4);
}

.density-compact .category-icon {
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
}

.density-compact .demo-preview {
  height: 180px;
}

.density-compact .category-grid,
.density-compact .demo-grid,
.density-compact .grid {
  gap: var(--grid-gap);
}

/* Comfortable Density (Default) */
.density-comfortable {
  --grid-gap: 1.5rem;
}

/* Spacious Density - larger gaps, more breathing room */
.density-spacious {
  --grid-gap: 2.5rem;
  --space-4: 1.25rem;
  --space-6: 2rem;
  --space-8: 3rem;
}

.density-spacious .category-card,
.density-spacious .demo-card {
  padding: var(--space-8);
}

.density-spacious .category-icon {
  width: 72px;
  height: 72px;
  font-size: 2rem;
}

.density-spacious .demo-preview {
  height: 300px;
}

.density-spacious .category-grid,
.density-spacious .demo-grid,
.density-spacious .grid {
  gap: var(--grid-gap);
}

/* --------------------------------------------------------------------------
   Reduce Motion Support
   -------------------------------------------------------------------------- */
.reduce-motion,
.reduce-motion * {
  animation-duration: 0s !important;
  animation-delay: 0s !important;
  transition-duration: 0s !important;
  transition-delay: 0s !important;
}

.reduce-motion .theme-gradient::after {
  animation: none;
}

/* Respect system preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  body:not(.force-motion),
  body:not(.force-motion) * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------------------
   Favorite Button Styles
   -------------------------------------------------------------------------- */
.favorite-btn {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-base);
  z-index: 10;
  opacity: 0;
}

/* Show favorite button on card hover */
.demo-card:hover .favorite-btn,
.category-card:hover .favorite-btn {
  opacity: 1;
}

/* Always show if favorited */
.favorite-btn.is-favorite {
  opacity: 1;
}

.favorite-btn:hover {
  background: rgba(0, 0, 0, 0.6);
  color: var(--primary-light);
  transform: scale(1.1);
}

.favorite-btn:active {
  transform: scale(0.95);
}

/* Star icon styling */
.favorite-btn svg,
.favorite-btn .star-icon {
  width: 18px;
  height: 18px;
  transition: all var(--transition-base);
}

/* Favorite state - filled star with glow */
.favorite-btn.is-favorite {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.2);
}

.favorite-btn.is-favorite:hover {
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.3);
}

.favorite-btn.is-favorite svg,
.favorite-btn.is-favorite .star-icon {
  fill: currentColor;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.5));
}

/* Animation when favoriting */
@keyframes favoritePopIn {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); opacity: 1; }
}

.favorite-btn.is-favorite.just-favorited {
  animation: favoritePopIn calc(0.4s * var(--animation-speed)) ease-out;
}

/* Light theme adjustments for favorite button */
.theme-light .favorite-btn {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-muted);
}

.theme-light .favorite-btn:hover {
  background: rgba(255, 255, 255, 0.95);
}

.theme-light .favorite-btn.is-favorite {
  background: rgba(251, 191, 36, 0.15);
  color: #d97706;
}

/* ==========================================================================
   ORIGINAL STYLES (Updated to use custom properties)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }
h4 { font-size: 1.25rem; }

.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.text-muted {
  color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.section {
  padding: var(--space-20) 0;
  position: relative;
}

.section-header {
  text-align: center;
  max-width: 800px;
  margin: 0 auto var(--space-16);
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1.125rem;
  margin-top: var(--space-4);
}

/* Grid */
.grid {
  display: grid;
  gap: var(--grid-gap);
}

.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

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

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

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: var(--space-4) 0;
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-base);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color var(--transition-fast), border-color var(--transition-fast);
}

.nav-theme-toggle:hover {
  color: var(--text-primary);
  border-color: var(--primary);
}

.nav-theme-toggle .icon-sun { display: none; }
.nav-theme-toggle .icon-moon { display: block; }
.theme-light .nav-theme-toggle .icon-sun { display: block; }
.theme-light .nav-theme-toggle .icon-moon { display: none; }

.nav-links {
  display: flex;
  gap: var(--space-8);
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  transition: color var(--transition-fast);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width var(--transition-base);
}

.nav-link:hover {
  color: var(--text-primary);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-favorites {
  display: flex;
  align-items: center;
  padding: 0.4rem;
}
.nav-favorites::after { display: none; }
.nav-favorites:hover svg {
  fill: #ef4444;
  stroke: #ef4444;
}

/* Mega Menu Dropdown */
.nav-dropdown {
  position: static;
}

.nav-dropdown > .nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-dropdown > .nav-link > svg {
  transition: transform var(--transition-fast);
}

.nav-dropdown:hover > .nav-link > svg {
  transform: rotate(180deg);
}

.mega-menu {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(18, 18, 26, 0.98);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  padding: var(--space-8) 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--transition-base), visibility var(--transition-base), transform var(--transition-base);
  z-index: 99;
}

/* Invisible bridge to prevent hover gap between link and menu */
.mega-menu::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  height: 20px;
}

.nav-dropdown:hover .mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.mega-menu-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-8);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.mega-menu-col h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: var(--space-3);
  font-weight: 700;
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
}

.mega-menu-col a {
  display: block;
  padding: 5px 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 450;
  transition: color var(--transition-fast), padding-left var(--transition-fast);
}

.mega-menu-col a:hover {
  color: var(--text-primary);
  padding-left: 6px;
}

@media (max-width: 768px) {
  .mega-menu {
    display: none !important;
  }
  .nav-links {
    display: none;
  }
  .nav-hamburger {
    display: flex;
  }
}

/* --------------------------------------------------------------------------
   Mobile Hamburger & Menu
   -------------------------------------------------------------------------- */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.nav-hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

body.mobile-menu-open {
  overflow: hidden;
}

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: var(--bg-secondary, #12121a);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  border-left: 1px solid var(--border);
}

.mobile-menu.open {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.mobile-menu-header .nav-logo {
  font-size: 1.3rem;
}

.mobile-menu-close {
  background: none;
  border: none;
  color: var(--text-secondary, #a1a1aa);
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.mobile-menu-close:hover {
  color: var(--text-primary, #fff);
}

.mobile-menu-body {
  padding: 16px 0;
}

.mobile-menu-search {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 20px 16px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 0.75rem);
  color: var(--text-secondary, #a1a1aa);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.mobile-menu-search:hover {
  border-color: var(--primary, #6366f1);
  color: var(--text-primary, #fff);
}

.mobile-menu-search svg {
  flex-shrink: 0;
  opacity: 0.6;
}

.mobile-menu-group {
  padding: 0 20px;
  margin-bottom: 20px;
}

.mobile-menu-group h4 {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-light, #818cf8);
  margin-bottom: 8px;
  font-weight: 700;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.mobile-menu-group a {
  display: block;
  padding: 6px 0;
  color: var(--text-secondary, #a1a1aa);
  font-size: 0.85rem;
  font-weight: 450;
  transition: color 0.15s, padding-left 0.15s;
}

.mobile-menu-group a:hover,
.mobile-menu-group a.active {
  color: var(--text-primary, #fff);
  padding-left: 6px;
}

.mobile-menu-group a.active {
  font-weight: 600;
}

.mobile-menu-links {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-menu-links a {
  display: block;
  padding: 8px 0;
  color: var(--text-secondary, #a1a1aa);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}

.mobile-menu-links a:hover {
  color: var(--text-primary, #fff);
}

.mobile-menu-links .mobile-cta {
  display: block;
  margin-top: 12px;
  padding: 12px 20px;
  background: var(--gradient-primary, linear-gradient(135deg, #6366f1, #8b5cf6, #d946ef));
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-lg, 0.75rem);
  text-align: center;
  transition: opacity 0.2s;
}

.mobile-menu-links .mobile-cta:hover {
  opacity: 0.9;
}

/* --------------------------------------------------------------------------
   Hero Section
   -------------------------------------------------------------------------- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: 80px;
  position: relative;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99, 102, 241, 0.3), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(139, 92, 246, 0.15), transparent),
    radial-gradient(ellipse 50% 30% at 20% 80%, rgba(6, 182, 212, 0.1), transparent);
  z-index: -1;
}

.hero-content {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  color: var(--primary-light);
  margin-bottom: var(--space-6);
}

.hero h1 {
  margin-bottom: var(--space-6);
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto var(--space-8);
}

/* --------------------------------------------------------------------------
   Category Cards
   -------------------------------------------------------------------------- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--grid-gap);
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  position: relative;
  overflow: hidden;
  transition: all calc(var(--transition-smooth) * var(--animation-speed));
  cursor: pointer;
}

.category-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 50%, rgba(99, 102, 241, 0.05) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.category-card:hover {
  transform: translateY(-8px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}

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

.category-icon {
  width: 60px;
  height: 60px;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  margin-bottom: var(--space-4);
  transition: transform var(--transition-base);
}

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

.category-card h3 {
  margin-bottom: var(--space-2);
}

.category-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: var(--space-4);
}

.category-count {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  background: rgba(99, 102, 241, 0.1);
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--primary-light);
}

/* --------------------------------------------------------------------------
   Effect Demo Containers
   -------------------------------------------------------------------------- */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--grid-gap);
}

/* Free filter active: flatten all sections into a single grid on <main> */
main.free-filter-active {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: var(--grid-gap);
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

main.free-filter-active > .page-header {
  grid-column: 1 / -1;
  display: block;
  padding: 150px 0 80px;
}

main.free-filter-active > .section,
main.free-filter-active > .section > .container,
main.free-filter-active > .section > .container > .demo-grid {
  display: contents !important;
}

main.free-filter-active > .section > .container > h2,
main.free-filter-active > .section > .container > h3,
main.free-filter-active > .section > .container > p,
main.free-filter-active > .section > .container > .section-header {
  display: none !important;
}

main.free-filter-active > .similar-effects,
main.free-filter-active > footer {
  grid-column: 1 / -1;
}

.demo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.demo-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.demo-preview {
  height: 250px;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.demo-info {
  padding: var(--space-6);
}

.demo-info h3 {
  font-size: 1.25rem;
  margin-bottom: var(--space-2);
}

.demo-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: var(--space-4);
}

.demo-tags {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.demo-tag {
  padding: var(--space-1) var(--space-2);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-size: 1rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-group {
  display: flex;
  gap: var(--space-4);
  justify-content: center;
  flex-wrap: wrap;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  padding: var(--space-12) 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Page Header (for category pages)
   -------------------------------------------------------------------------- */
.page-header {
  padding: 150px 0 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(99, 102, 241, 0.2), transparent);
  z-index: -1;
}

.page-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text-secondary);
  margin-bottom: var(--space-6);
  transition: color var(--transition-fast);
}

.page-header .back-link:hover {
  color: var(--primary-light);
}

/* Free effects filter toggle */
.free-filter-bar {
  max-width: 600px;
  margin: var(--space-6) auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(16, 185, 129, 0.06);
  border: 1px solid rgba(16, 185, 129, 0.15);
  border-radius: 12px;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.free-filter-label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.free-filter-count {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Premium CTA banner (shown when free filter active) */
.premium-cta-banner {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 16px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  background: rgba(139, 92, 246, 0.05);
  border: 1px solid transparent;
  border-radius: 10px;
  text-align: center;
  position: relative;
  transition: max-height 0.4s ease, opacity 0.3s ease, padding 0.4s ease, margin 0.4s ease, border-color 0.3s ease;
}

.premium-cta-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.08), rgba(255, 255, 255, 0.04), transparent);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.premium-cta-banner.visible::before {
  opacity: 1;
  animation: cta-reflect 2.5s 0.5s ease-in-out infinite;
}

@keyframes cta-reflect {
  0% { left: -100%; }
  80% { left: 140%; }
  81%, 100% { left: -100%; }
}

.premium-cta-banner.visible {
  padding: 12px 16px;
  max-height: 120px;
  opacity: 1;
  margin-top: 8px;
  border-color: rgba(139, 92, 246, 0.12);
}

.premium-cta-headline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.premium-cta-headline svg {
  vertical-align: -2px;
  margin-right: 4px;
}

.premium-cta-prices {
  display: inline;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.premium-cta-link {
  color: var(--primary-light);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.8rem;
  background: none;
  border: none;
  text-decoration: none;
  transition: color 0.2s ease;
}

.premium-cta-link:hover {
  color: #c4b5fd;
  text-decoration: underline;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-6);
  font-size: 0.85rem;
}

.breadcrumb a {
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--primary-light);
}

.breadcrumb .breadcrumb-sep {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.breadcrumb .breadcrumb-current {
  color: var(--text-primary);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Code Preview
   -------------------------------------------------------------------------- */
.code-preview {
  background: #0d0d12;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  font-family: 'Fira Code', monospace;
  font-size: 0.85rem;
  overflow-x: auto;
  border: 1px solid var(--border);
}

.code-preview code {
  color: #e2e8f0;
}

/* --------------------------------------------------------------------------
   Utility Classes
   -------------------------------------------------------------------------- */
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-8 { margin-bottom: var(--space-8); }
.text-center { text-align: center; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-4 { gap: var(--space-4); }

/* --------------------------------------------------------------------------
   Freemium Badges (Gratuit / Premium)
   -------------------------------------------------------------------------- */
.demo-card::before {
  content: 'Premium';
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.25);
  border-radius: var(--radius-full);
  z-index: 5;
  pointer-events: none;
}

.demo-card[data-free]::before {
  content: 'Gratuit';
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.25);
}

/* Light theme adjustments */
.theme-light .demo-card::before {
  color: #7c3aed;
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.2);
}

.theme-light .demo-card[data-free]::before {
  color: #059669;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
}

/* ==========================================================================
   Template Viewer Layout
   ========================================================================== */
.tv-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--bg-primary); position: sticky; top: 70px; z-index: 10; margin-top: 70px; }
.tv-back { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); text-decoration: none; font-size: 0.85rem; transition: color 0.2s; }
.tv-back:hover { color: var(--text-primary); }
.tv-back svg { flex-shrink: 0; }
.tv-title { font-size: 1.1rem; font-weight: 700; }
.tv-controls { display: flex; gap: 8px; }
.tv-controls button { background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; padding: 6px 10px; cursor: pointer; color: var(--text-secondary); transition: all 0.2s; }
.tv-controls button:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.tv-controls button.active { border-color: var(--primary); color: var(--primary); }
.tv-body { display: flex; height: calc(100vh - 70px - 50px); }
.tv-preview { flex: 2; position: relative; background: var(--bg-card); transition: flex 0.3s; }
.tv-preview iframe { width: 100%; height: 100%; border: none; transition: width 0.3s; margin: 0 auto; display: block; }
.tv-preview.tablet iframe { width: 768px; }
.tv-preview.mobile iframe { width: 375px; }
.tv-sidebar { flex: 0 0 340px; overflow-y: auto; padding: 24px; border-left: 1px solid var(--border); background: var(--bg-primary); transition: flex 0.3s, width 0.3s, padding 0.3s, opacity 0.3s; }
.tv-sidebar-header h2 { font-size: 1.2rem; margin-bottom: 8px; }
.tv-sidebar-header p { color: var(--text-secondary); font-size: 0.85rem; margin-bottom: 24px; line-height: 1.5; }
.tv-body.tv-compact .tv-sidebar { flex: 0 0 0; width: 0; padding: 0; overflow: hidden; opacity: 0; border-left: none; }
.tv-body.tv-compact .tv-preview { flex: 1; }
.tv-effect { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 16px; overflow: hidden; transition: border-color 0.3s, box-shadow 0.3s, background 0.3s; }
.tv-effect:hover { border-color: var(--primary); }
.tv-effect.tv-effect-active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 4px 16px rgba(99, 102, 241, 0.15); background: rgba(99, 102, 241, 0.03); }
.tv-effect-demo { height: 80px; position: relative; overflow: hidden; background: var(--bg-secondary); }
.tv-effect-info { padding: 12px; }
.tv-effect-info h4 { font-size: 0.9rem; margin-bottom: 4px; }
.tv-effect-info p { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 8px; line-height: 1.4; }
.tv-effect-link { font-size: 0.8rem; color: var(--primary); text-decoration: none; font-weight: 600; transition: color 0.2s; }
.tv-effect-link:hover { color: var(--primary-light); }
@media (max-width: 900px) { .tv-body { flex-direction: column; height: auto; } .tv-preview { height: 60vh; } .tv-sidebar { flex: none; border-left: none; border-top: 1px solid var(--border); } .tv-body.tv-compact .tv-sidebar { flex: none; height: 0; padding: 0; border-top: none; } }
@media (max-width: 768px) { .tv-header { top: 60px; margin-top: 60px; padding: 10px 16px; } .tv-body { height: calc(100vh - 60px - 46px); } .tv-preview.tablet iframe, .tv-preview.mobile iframe { width: 100%; } .tv-controls button span { display: none; } }

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Visually hidden (accessible) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   Similar Effects Section
   -------------------------------------------------------------------------- */
.similar-effects {
  padding: var(--space-12) 0;
  border-top: 1px solid var(--border);
}

.similar-effects h2 {
  text-align: center;
  margin-bottom: var(--space-8);
}

.similar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-6);
}

.similar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  text-align: center;
  text-decoration: none;
  transition: transform 0.3s, border-color 0.3s;
  color: var(--text-primary);
}

.similar-card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
}

.similar-card .similar-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: var(--space-3);
}

.similar-card h4 {
  margin-bottom: var(--space-2);
  font-size: 1rem;
}

.similar-card p {
  color: var(--text-secondary, #a1a1aa);
  font-size: 0.85rem;
  margin: 0;
}

/* ============================================
   Vote Button
   ============================================ */
.vote-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
  float: right;
  margin-top: -28px;
}
.vote-btn:hover {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
  color: var(--primary);
}
.vote-btn.voted {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary);
  border-color: var(--primary);
}
.vote-btn svg { width: 14px; height: 14px; }
.vote-count { font-weight: 600; }
