/* ============================================
   EditPro Hub — Design System & Global Styles
   ============================================ */

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

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Primary palette */
  --primary: #4f46e5;
  --primary-light: #818cf8;
  --primary-dark: #3730a3;
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;

  /* Secondary */
  --secondary: #0ea5e9;
  --secondary-light: #38bdf8;
  --secondary-dark: #0284c7;

  /* Accent */
  --accent: #f59e0b;
  --accent-light: #fbbf24;
  --accent-dark: #d97706;

  /* Success / Warning / Error */
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --error: #ef4444;
  --error-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;

  /* Neutrals */
  --white: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --gray-950: #030712;
  --black: #000000;

  /* Surfaces */
  --bg: var(--white);
  --bg-secondary: var(--gray-50);
  --bg-card: var(--white);
  --bg-card-hover: var(--gray-50);
  --bg-nav: rgba(255, 255, 255, 0.85);
  --text-primary: var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted: var(--gray-400);
  --border: var(--gray-200);
  --border-focus: var(--primary);

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 10px 10px -5px rgba(0,0,0,0.04);
  --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.25);

  /* Typography */
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Font sizes */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.25rem;
  --text-5xl: 3rem;
  --text-6xl: 3.75rem;

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

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

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-overlay: 300;
  --z-modal: 400;
  --z-toast: 500;
  --z-tooltip: 600;

  /* Layout */
  --max-width: 1280px;
  --max-width-narrow: 960px;
  --nav-height: 72px;
  --container-padding: var(--space-6);
}

/* ---------- Dark Mode ---------- */
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-secondary: #1e293b;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-nav: rgba(15, 23, 42, 0.9);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border: #334155;
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --primary-50: #1e1b4b;
  --primary-100: #312e81;
  --primary-200: #4338ca;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --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.6);
  --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.7);
}

/* ---------- CSS Reset / Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  transition: background-color var(--transition-base), color var(--transition-base);
}

img, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--primary-dark);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: var(--text-5xl); margin-bottom: var(--space-6); }
h2 { font-size: var(--text-4xl); margin-bottom: var(--space-4); }
h3 { font-size: var(--text-2xl); margin-bottom: var(--space-3); }
h4 { font-size: var(--text-xl); margin-bottom: var(--space-2); }

p {
  margin-bottom: var(--space-4);
  color: var(--text-secondary);
  line-height: 1.7;
}

ul, ol { list-style: none; }

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* ---------- Utility Classes ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.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;
}

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

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

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

.section-title {
  text-align: center;
  margin-bottom: var(--space-4);
  font-size: var(--text-4xl);
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--text-lg);
  max-width: 640px;
  margin: 0 auto var(--space-12);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  white-space: nowrap;
  min-height: 44px;
  min-width: 44px;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
  color: var(--white);
}

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

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

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--primary-light);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
  min-height: 36px;
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
  min-height: 52px;
  border-radius: var(--radius-xl);
}

.btn-icon {
  padding: var(--space-3);
  border-radius: var(--radius-md);
}

/* Ripple effect */
.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  transform: scale(0);
  animation: ripple 0.6s linear;
  pointer-events: none;
}

@keyframes ripple {
  to { transform: scale(4); opacity: 0; }
}

/* ---------- Navbar ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: var(--z-sticky);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}

.navbar.scrolled {
  box-shadow: var(--shadow-md);
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  flex-shrink: 0;
}

.navbar-logo:hover { color: var(--primary); }

.navbar-logo .logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: var(--text-lg);
  font-weight: 800;
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.navbar-nav a,
.navbar-nav button {
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.navbar-nav a:hover,
.navbar-nav button:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* Category dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-2);
  min-width: 260px;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: var(--z-dropdown);
}

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

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.nav-dropdown-menu a:hover {
  background: var(--primary-50);
  color: var(--primary);
}

.nav-dropdown-menu a .cat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-base);
  flex-shrink: 0;
}

/* Theme toggle */
.theme-toggle {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  font-size: var(--text-lg);
}

.theme-toggle:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: var(--text-xl);
}

/* ---------- Hero Section ---------- */
.hero {
  padding-top: calc(var(--nav-height) + var(--space-20));
  padding-bottom: var(--space-20);
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--primary-50) 0%, var(--bg) 100%);
}

[data-theme="dark"] .hero {
  background: linear-gradient(180deg, rgba(99,102,241,0.08) 0%, var(--bg) 100%);
}

.hero-inner {
  display: flex;
  align-items: center;
  gap: var(--space-16);
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.hero-content {
  flex: 1;
  max-width: 640px;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--primary-100);
  color: var(--primary-dark);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  margin-bottom: var(--space-6);
}

[data-theme="dark"] .hero-badge {
  background: rgba(99,102,241,0.2);
  color: var(--primary-light);
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, var(--text-6xl));
  line-height: 1.1;
  margin-bottom: var(--space-6);
}

.hero h1 .gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-8);
  max-width: 520px;
}

.hero-actions {
  display: flex;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.hero-stats {
  display: flex;
  gap: var(--space-8);
}

.hero-stat {
  text-align: center;
}

.hero-stat-number {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--primary);
}

.hero-stat-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.hero-visual {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1200px;
  z-index: 1;
}

/* 3D floating shapes */
.hero-3d-scene {
  position: relative;
  width: 420px;
  height: 420px;
  transform-style: preserve-3d;
}

.hero-shape {
  position: absolute;
  border-radius: var(--radius-2xl);
  transform-style: preserve-3d;
  animation: float 6s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  box-shadow: var(--shadow-2xl);
}

.hero-shape-1 {
  width: 140px;
  height: 140px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  top: 10%;
  left: 15%;
  animation-delay: 0s;
  transform: rotateY(15deg) rotateX(-10deg);
}

.hero-shape-2 {
  width: 110px;
  height: 110px;
  background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
  top: 35%;
  right: 10%;
  animation-delay: -2s;
  transform: rotateY(-20deg) rotateX(15deg);
  border-radius: var(--radius-xl);
}

.hero-shape-3 {
  width: 100px;
  height: 100px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  bottom: 15%;
  left: 25%;
  animation-delay: -4s;
  transform: rotateY(10deg) rotateX(-20deg);
  border-radius: 50%;
}

.hero-shape-4 {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #ec4899, #d946ef);
  top: 5%;
  right: 25%;
  animation-delay: -1s;
  transform: rotateY(-15deg) rotateX(25deg);
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
}

.hero-shape-5 {
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, var(--success), #059669);
  bottom: 30%;
  right: 15%;
  animation-delay: -3s;
  transform: rotateX(10deg) rotateY(25deg);
  clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}

@keyframes float {
  0%, 100% { transform: translateY(0) var(--hero-rotate, rotateY(15deg) rotateX(-10deg)); }
  50% { transform: translateY(-20px) var(--hero-rotate, rotateY(15deg) rotateX(-10deg)); }
}

/* ---------- Search Bar ---------- */
.search-bar {
  position: relative;
  max-width: 560px;
  margin-bottom: var(--space-8);
}

.search-bar input {
  width: 100%;
  padding: var(--space-4) var(--space-6);
  padding-left: 48px;
  padding-right: 48px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius-xl);
  font-size: var(--text-base);
  color: var(--text-primary);
  outline: none;
  transition: all var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.search-bar input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-100);
}

[data-theme="dark"] .search-bar input:focus {
  box-shadow: 0 0 0 4px rgba(99,102,241,0.3);
}

.search-bar input::placeholder {
  color: var(--text-muted);
}

.search-bar .search-icon {
  position: absolute;
  left: var(--space-4);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: var(--text-lg);
}

.search-bar .search-clear {
  position: absolute;
  right: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.search-bar .search-clear.visible {
  display: flex;
}

.search-bar .search-clear:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ---------- Tool Cards Grid ---------- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
}

.tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  perspective: 800px;
  cursor: pointer;
}

.tool-card:hover {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-lg);
}

.tool-card-inner {
  transition: transform var(--transition-base);
}

.tool-card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-4);
  transition: transform var(--transition-spring);
}

.tool-card:hover .tool-card-icon {
  transform: translateZ(10px) scale(1.05);
}

.tool-card h3 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-2);
  transition: color var(--transition-fast);
}

.tool-card:hover h3 {
  color: var(--primary);
}

.tool-card p {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0;
}

.tool-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transition: transform var(--transition-base);
  transform-origin: left;
}

.tool-card:hover::after {
  transform: scaleX(1);
}

/* ---------- Category Section ---------- */
.category-section {
  padding: var(--space-12) 0;
}

.category-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.category-header .cat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.category-header h2 {
  margin-bottom: 0;
  font-size: var(--text-2xl);
}

.category-header p {
  margin-bottom: 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Category icon backgrounds */
.cat-image { background: #fef3c7; color: #d97706; }
.cat-crop { background: #d1fae5; color: #059669; }
.cat-rotate { background: #dbeafe; color: #2563eb; }
.cat-text { background: #fce7f3; color: #db2777; }
.cat-convert { background: #ede9fe; color: #7c3aed; }
.cat-color { background: #ccfbf1; color: #0d9488; }
.cat-design { background: #fee2e2; color: #dc2626; }
.cat-utility { background: #f1f5f9; color: #475569; }

/* ---------- Ad Placeholder ---------- */
.ad-slot {
  background: var(--bg-secondary);
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 250px;
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin: var(--space-8) 0;
  overflow: hidden;
}

/* ---------- Toast Notifications ---------- */
.toast-container {
  position: fixed;
  top: calc(var(--nav-height) + var(--space-4));
  right: var(--space-4);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  font-size: var(--text-sm);
  min-width: 300px;
  max-width: 420px;
  pointer-events: auto;
  animation: slideInRight 0.3s ease-out;
}

.toast-success { border-left: 4px solid var(--success); }
.toast-error { border-left: 4px solid var(--error); }
.toast-info { border-left: 4px solid var(--info); }
.toast-warning { border-left: 4px solid var(--warning); }

.toast-icon { font-size: var(--text-lg); flex-shrink: 0; }
.toast-success .toast-icon { color: var(--success); }
.toast-error .toast-icon { color: var(--error); }
.toast-info .toast-icon { color: var(--info); }
.toast-warning .toast-icon { color: var(--warning); }

.toast-close {
  margin-left: auto;
  color: var(--text-muted);
  padding: var(--space-1);
  flex-shrink: 0;
}

.toast-close:hover { color: var(--text-primary); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOutRight {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* ---------- Footer ---------- */
.footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: var(--space-16) 0 var(--space-8);
}

[data-theme="dark"] .footer {
  background: var(--gray-950);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: var(--space-12);
  margin-bottom: var(--space-12);
}

.footer-brand p {
  color: var(--gray-400);
  font-size: var(--text-sm);
  margin-top: var(--space-4);
  max-width: 300px;
}

.footer h4 {
  color: var(--white);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-4);
  font-family: var(--font-body);
  font-weight: 600;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer-links a {
  color: var(--gray-400);
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--white);
}

.footer-bottom {
  border-top: 1px solid var(--gray-800);
  padding-top: var(--space-8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  color: var(--gray-500);
}

.footer-social {
  display: flex;
  gap: var(--space-4);
}

.footer-social a {
  color: var(--gray-400);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.footer-social a:hover {
  background: var(--gray-800);
  color: var(--white);
}

/* ---------- Cookie Banner ---------- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: var(--space-6);
  z-index: var(--z-overlay);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
  display: none;
}

.cookie-banner.visible {
  display: block;
}

.cookie-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  max-width: var(--max-width);
  margin: 0 auto;
}

.cookie-banner p {
  font-size: var(--text-sm);
  margin-bottom: 0;
  flex: 1;
}

.cookie-actions {
  display: flex;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* ---------- Animations ---------- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .hero-shape { animation: none; }
  .animate-in { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Focus States (Accessibility) ---------- */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .hero-inner {
    flex-direction: column;
    text-align: center;
  }

  .hero-content {
    max-width: 100%;
  }

  .hero-description {
    margin: 0 auto var(--space-8);
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-visual {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }
}

@media (max-width: 768px) {
  :root {
    --container-padding: var(--space-4);
    --nav-height: 64px;
  }

  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }

  .navbar-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: flex;
  }

  /* Mobile menu open */
  .mobile-nav-open .navbar-nav {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    padding: var(--space-6);
    gap: var(--space-2);
    overflow-y: auto;
    z-index: var(--z-overlay);
    animation: fadeIn 0.2s ease-out;
  }

  .mobile-nav-open .navbar-nav a,
  .mobile-nav-open .navbar-nav button {
    font-size: var(--text-base);
    padding: var(--space-4);
  }

  .tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-4);
  }

  .section {
    padding: var(--space-12) 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .footer-bottom {
    flex-direction: column;
    gap: var(--space-4);
    text-align: center;
  }

  .cookie-inner {
    flex-direction: column;
    text-align: center;
  }
}

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

  .hero-stats {
    flex-direction: column;
    gap: var(--space-4);
  }
}

/* ---------- No Results ---------- */
.no-results {
  text-align: center;
  padding: var(--space-16) var(--space-6);
  display: none;
}

.no-results.visible {
  display: block;
}

.no-results .emoji {
  font-size: 4rem;
  margin-bottom: var(--space-4);
}

.no-results h3 {
  margin-bottom: var(--space-2);
}

/* ---------- Page Loading ---------- */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ---------- Back to Top ---------- */
.back-to-top {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-lg);
  box-shadow: var(--shadow-lg);
  z-index: var(--z-sticky);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-base);
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  color: white;
}

/* ---------- Empty state / no-content ---------- */
.empty-state {
  text-align: center;
  padding: var(--space-16) var(--space-6);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: var(--space-4);
}

/* ---------- Popular / Recent labels ---------- */
.tool-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
  margin-left: var(--space-2);
}

.label-popular {
  background: var(--warning-light);
  color: var(--accent-dark);
}

.label-new {
  background: var(--success-light);
  color: #059669;
}
