/* ============================================================
   QUASAR TOOLS - Production Design System
   A modern, accessible, responsive CSS framework
   ============================================================ */

/* === CSS CUSTOM PROPERTIES === */
:root {
  /* Primary palette */
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-900: #312e81;
  --accent: #06b6d4;
  --accent-light: #22d3ee;
  --accent-dark: #0891b2;

  /* Semantic colors */
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --error: #ef4444;
  --error-light: #fee2e2;
  --info: #3b82f6;
  --info-light: #dbeafe;

  /* Surface colors */
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --surface-elevated: #ffffff;

  /* Border */
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --border-focus: var(--primary);

  /* Text */
  --text: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Border radius */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(0,0,0,.04);
  --shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.07), 0 2px 4px -2px rgba(0,0,0,.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.04);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition: 200ms ease;
  --transition-slow: 300ms ease;

  /* Z-index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-modal: 300;
  --z-toast: 400;
  --z-tooltip: 500;
}

/* === DARK THEME === */
[data-theme="dark"] {
  --primary: #818cf8;
  --primary-light: #a5b4fc;
  --primary-dark: #6366f1;
  --primary-50: #1e1b4b;
  --primary-100: #312e81;
  --primary-900: #e0e7ff;
  --accent: #22d3ee;
  --accent-light: #67e8f9;
  --accent-dark: #06b6d4;

  --success: #34d399;
  --success-light: #064e3b;
  --warning: #fbbf24;
  --warning-light: #78350f;
  --error: #f87171;
  --error-light: #7f1d1d;
  --info: #60a5fa;
  --info-light: #1e3a5f;

  --surface: #1e293b;
  --surface-2: #0f172a;
  --surface-3: #1a2332;
  --surface-elevated: #1e293b;

  --border: #334155;
  --border-light: #1e293b;

  --text: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.15);
  --shadow: 0 1px 3px rgba(0,0,0,.2), 0 1px 2px rgba(0,0,0,.15);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.25), 0 2px 4px -2px rgba(0,0,0,.15);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.3), 0 4px 6px -4px rgba(0,0,0,.15);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.35), 0 8px 10px -6px rgba(0,0,0,.2);
}

/* === RESET & BASE === */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--surface-2);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; border-radius: 2px; }

::selection {
  background: var(--primary);
  color: white;
}

/* === NAVIGATION === */
.nav {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background-color: rgba(255,255,255,.85);
}

[data-theme="dark"] .nav {
  background-color: rgba(30,41,59,.85);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.nav-logo:hover { opacity: 0.85; }
.nav-logo svg { flex-shrink: 0; }

.nav-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.nav-search input {
  width: 100%;
  height: 40px;
  padding: 0 var(--space-4) 0 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.875rem;
  outline: none;
  transition: all var(--transition);
}

.nav-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.12);
  background: var(--surface);
}

.nav-search input::placeholder { color: var(--text-muted); }

.nav-search svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav-links a {
  padding: 8px 14px;
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-links a:hover { color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--primary); background: var(--primary-50); }

.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  flex-shrink: 0;
}

.theme-toggle:hover { color: var(--text); border-color: var(--primary); background: var(--primary-50); }

/* Mobile menu button */
.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

/* === HERO SECTION === */
.hero {
  text-align: center;
  padding: var(--space-16) var(--space-6) var(--space-12);
  max-width: 780px;
  margin: 0 auto;
  position: relative;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-4);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto var(--space-8);
  line-height: 1.7;
}

.hero-search {
  max-width: 540px;
  margin: 0 auto;
  position: relative;
}

.hero-search input {
  width: 100%;
  height: 56px;
  padding: 0 var(--space-5) 0 52px;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: all var(--transition);
  box-shadow: var(--shadow-md);
}

.hero-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,.12), var(--shadow-lg);
}

.hero-search input::placeholder { color: var(--text-muted); }

.hero-search svg {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* Badges */
.badges {
  display: flex;
  justify-content: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-5);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: all var(--transition);
}

.badge:hover { border-color: var(--primary); color: var(--primary); }

.badge svg { width: 14px; height: 14px; }

/* === LAYOUT === */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}

/* === SECTION HEADERS === */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-header a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.section-header a:hover { opacity: 0.8; text-decoration: underline; }

/* === CATEGORY CARDS === */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-12);
}

.category-card {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: 18px var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
  box-shadow: var(--shadow-xs);
}

.category-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.category-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.25rem;
}

.category-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.category-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* === TOOL CARDS === */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-12);
}

.tool-card {
  display: flex;
  flex-direction: column;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text);
  transition: all 0.25s;
  box-shadow: var(--shadow-xs);
  position: relative;
  overflow: hidden;
}

.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity var(--transition);
}

.tool-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

.tool-card:hover::before { opacity: 1; }

.tool-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.tool-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(99,102,241,.12), rgba(6,182,212,.12));
  color: var(--primary);
}

.tool-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
}

.tool-card p {
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* === TOOL PAGE LAYOUT === */
.tool-page {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-8) var(--space-6) var(--space-16);
}

.tool-header {
  margin-bottom: var(--space-8);
}

.tool-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: var(--space-2);
  letter-spacing: -0.02em;
}

.tool-header p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
  transition: opacity var(--transition);
}

.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--border); }

/* === TOOL INTERFACE === */
.tool-interface {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  box-shadow: var(--shadow);
}

.tool-interface h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-4);
}

.tool-controls {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  align-items: center;
}

.tool-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
}

@media (max-width: 640px) {
  .tool-area { grid-template-columns: 1fr; }
}

.tool-input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.tool-input-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* === FORM ELEMENTS === */
textarea, input[type="text"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], select {
  width: 100%;
  padding: 12px var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  outline: none;
  transition: all var(--transition);
  resize: vertical;
}

textarea { min-height: 200px; }

textarea:focus, input:focus, select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.1);
  background: var(--surface);
}

textarea::placeholder, input::placeholder { color: var(--text-muted); }

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6l6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  font-family: inherit;
}

/* Checkbox */
input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

label.toggle-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: 0.875rem;
}

/* Range slider */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid white;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform var(--transition);
}

input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.15); }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px var(--space-5);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  white-space: nowrap;
  font-family: inherit;
  text-decoration: none;
  line-height: 1.4;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 1px 2px rgba(99,102,241,.2);
}

.btn-primary:hover:not(:disabled) { 
  opacity: 0.9; 
  transform: translateY(-1px); 
  box-shadow: 0 4px 12px rgba(99,102,241,.3);
}

.btn-primary:active:not(:disabled) { transform: translateY(0); }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); background: var(--primary-50); }

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover:not(:disabled) { opacity: 0.9; transform: translateY(-1px); }

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover:not(:disabled) { opacity: 0.9; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
}

.btn-ghost:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }

.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

.btn-lg { padding: 14px 28px; font-size: 1rem; }

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: var(--radius);
}

/* === TOAST NOTIFICATIONS === */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  padding: 12px var(--space-5);
  background: var(--text);
  color: var(--surface);
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  z-index: var(--z-toast);
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--transition-slow);
  max-width: 360px;
}

.toast.show { transform: translateY(0); opacity: 1; }

.toast.toast-success { background: var(--success); color: white; }
.toast.toast-error { background: var(--error); color: white; }

/* === STATS DISPLAY === */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.stat {
  padding: var(--space-2) var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
}

.stat strong {
  color: var(--primary);
  font-weight: 700;
}

/* === OUTPUT DISPLAY === */
.output-display {
  padding: 12px var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  min-height: 200px;
  white-space: pre-wrap;
  word-break: break-all;
  overflow: auto;
}

/* Code block */
.code-block {
  padding: var(--space-4);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.825rem;
  overflow-x: auto;
  white-space: pre;
}

/* Result section */
.result-section {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}

.result-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-3);
}

/* === SEARCH RESULTS DROPDOWN === */
.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  max-height: 400px;
  overflow-y: auto;
  z-index: var(--z-dropdown);
}

.search-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px var(--space-4);
  text-decoration: none;
  color: var(--text);
  transition: background var(--transition-fast);
  border-bottom: 1px solid var(--border-light);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--surface-2); }

.search-result-name {
  font-size: 0.9rem;
  font-weight: 500;
}

.search-result-name mark {
  background: rgba(99,102,241,0.2);
  color: var(--primary);
  border-radius: 2px;
  padding: 0 2px;
}

.search-result-cat {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: var(--space-4);
}

.search-no-results {
  padding: var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* === TAG BADGES === */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--primary-50);
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tag-success { background: var(--success-light); color: var(--success); }
.tag-warning { background: var(--warning-light); color: var(--warning); }
.tag-error { background: var(--error-light); color: var(--error); }

/* === HERO BACKGROUND === */
.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 500px;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99,102,241,.08), transparent);
  pointer-events: none;
  z-index: -1;
}

[data-theme="dark"] .hero-bg {
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99,102,241,.15), transparent);
}

/* === FOOTER === */
.footer {
  border-top: 1px solid var(--border);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.825rem;
  margin-top: var(--space-12);
  background: var(--surface);
}

.footer-content {
  max-width: 1280px;
  margin: 0 auto;
}

.footer-links {
  margin-top: var(--space-3);
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.footer a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.footer a:hover { color: var(--primary); background: var(--primary-50); }

/* === TOOL PAGE CONTENT SECTIONS === */
.tool-content-section {
  margin-top: var(--space-8);
}

.tool-content-section h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: var(--space-4);
  letter-spacing: -0.01em;
}

.tool-content-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-3);
}

.tool-content-section p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-3);
}

.tool-content-section ul, .tool-content-section ol {
  padding-left: var(--space-6);
  margin-bottom: var(--space-4);
}

.tool-content-section li {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-2);
}

/* FAQ Section */
.faq-section {
  margin-top: var(--space-8);
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-3);
  overflow: hidden;
  background: var(--surface);
}

.faq-question {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  background: none;
  border: none;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-family: inherit;
  transition: all var(--transition);
}

.faq-question:hover { color: var(--primary); background: var(--surface-2); }

.faq-question svg {
  flex-shrink: 0;
  transition: transform var(--transition-slow);
}

.faq-question.active svg { transform: rotate(180deg); }

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow), padding var(--transition-slow);
}

.faq-answer.open {
  max-height: 500px;
  padding: 0 var(--space-5) var(--space-5);
}

.faq-answer p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* Related Tools Grid */
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--space-3);
}

.related-tool-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text);
}

.related-tool-card:hover {
  border-color: var(--primary);
  background: var(--primary-50);
  transform: translateX(4px);
}

.related-tool-card h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

.related-tool-card p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.related-tool-card svg { 
  flex-shrink: 0; 
  color: var(--text-muted); 
  transition: all var(--transition);
}

.related-tool-card:hover svg { color: var(--primary); transform: translateX(4px); }

/* === AD PLACEHOLDERS === */
.ad-placeholder {
  margin: var(--space-8) 0;
  text-align: center;
}

.ad-placeholder-inner {
  display: inline-block;
  padding: 12px var(--space-8);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* === LOADING STATE === */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 10;
}

[data-theme="dark"] .loading-overlay {
  background: rgba(15,23,42,.7);
}

/* === ANIMATIONS === */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.animate-in { animation: fadeInUp 0.4s ease-out both; }
.animate-fade { animation: fadeIn 0.3s ease-out both; }

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .category-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: flex; }
  .hero { padding: var(--space-10) var(--space-6) var(--space-8); }
  .hero h1 { font-size: clamp(1.75rem, 6vw, 2.5rem); }
  .category-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .tools-grid { grid-template-columns: 1fr; }
  .tool-page { padding: var(--space-6) var(--space-4) var(--space-12); }
  .tool-interface { padding: var(--space-4); }
  .toast { left: var(--space-4); right: var(--space-4); bottom: var(--space-4); max-width: none; }
  .related-tools-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .badges { gap: var(--space-2); }
  .badge { font-size: 0.75rem; padding: 4px 10px; }
  .hero-search input { height: 48px; font-size: 0.95rem; }
  .tool-controls { gap: var(--space-1); }
  .btn-sm { padding: 5px 10px; font-size: 0.75rem; }
}

/* === UTILITY CLASSES === */
.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-muted { color: var(--text-muted); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.gap-4 { gap: var(--space-4); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* Print styles */
@media print {
  .nav, .footer, .theme-toggle, .hero-bg, .ad-placeholder { display: none !important; }
  body { background: white; color: black; }
  .tool-interface { border: 1px solid #ccc; box-shadow: none; }
}