/* ToolPilot — Design System */
:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #4338ca;
  --bg: #f8fafc;
  --bg-card: #ffffff;
  --bg-input: #f1f5f9;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px rgba(0,0,0,.04);
  --transition: .2s ease;
}
[data-theme="dark"] {
  --bg: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #334155;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
  --shadow: 0 1px 3px rgba(0,0,0,.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.3);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background var(--transition), color var(--transition);
}

/* Typography */
h1 { font-size: 2rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.5rem; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.125rem; font-weight: 600; }
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }

/* Layout */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }
main { flex: 1; padding: 2rem 0; }

/* Header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: .75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.logo span { color: var(--primary); }
.header-actions { display: flex; align-items: center; gap: .75rem; }
.theme-toggle {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .4rem .6rem;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--text);
  transition: all var(--transition);
}
.theme-toggle:hover { border-color: var(--primary); }

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: all var(--transition);
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }

/* Tool Grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.tool-card {
  text-decoration: none;
  color: var(--text);
}
.tool-card .icon {
  font-size: 2rem;
  margin-bottom: .75rem;
  display: block;
}
.tool-card h3 { margin-bottom: .35rem; }
.tool-card p { color: var(--text-muted); font-size: .9rem; }

/* Hero */
.hero {
  text-align: center;
  padding: 3rem 0 2rem;
}
.hero h1 { font-size: 2.5rem; margin-bottom: .75rem; }
.hero p { color: var(--text-muted); font-size: 1.15rem; max-width: 600px; margin: 0 auto; }

/* Tool Page */
.tool-header { margin-bottom: 1.5rem; }
.tool-header h1 { font-size: 1.75rem; margin-bottom: .35rem; }
.tool-header p { color: var(--text-muted); }
.breadcrumb { font-size: .85rem; color: var(--text-muted); margin-bottom: 1rem; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary); }

/* Form Elements */
textarea, input[type="text"], input[type="number"], select {
  width: 100%;
  padding: .75rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: .95rem;
  transition: border-color var(--transition);
  resize: vertical;
}
textarea:focus, input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
textarea { min-height: 160px; font-family: 'JetBrains Mono', 'Fira Code', monospace; font-size: .875rem; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .4rem; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.25rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: .9rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg-input); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { border-color: var(--primary); }
.btn-sm { padding: .4rem .8rem; font-size: .8rem; }
.btn-group { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; }

/* Tool Layout */
.tool-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.tool-panel { display: flex; flex-direction: column; gap: .75rem; }
@media (max-width: 768px) {
  .tool-layout { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.75rem; }
}

/* Copied Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: var(--bg);
  padding: .6rem 1.25rem;
  border-radius: 8px;
  font-size: .875rem;
  font-weight: 500;
  opacity: 0;
  transition: all .3s ease;
  z-index: 1000;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Ad Placeholder */
.ad-slot {
  background: var(--bg-input);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .8rem;
  margin: 1.5rem 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 3rem;
  text-align: center;
  color: var(--text-muted);
  font-size: .85rem;
}
.site-footer a { color: var(--text-muted); }
.footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: .75rem; }

/* Range Input */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
}

/* Checkbox / Toggle */
.toggle-row { display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
.toggle-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--primary); }

/* Color swatches */
.color-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .75rem; margin-top: 1rem; }
.color-swatch {
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
}
.color-swatch:hover { transform: scale(1.05); }
.color-swatch .preview { height: 80px; }
.color-swatch .info { padding: .5rem; font-size: .75rem; font-family: monospace; text-align: center; }

/* SEO content section */
.seo-content {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.seo-content h2 { margin-bottom: .75rem; }
.seo-content p { color: var(--text-muted); margin-bottom: 1rem; font-size: .95rem; }

/* Stats bar */
.stats-bar {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding: .75rem 0;
  font-size: .9rem;
}
.stat { display: flex; align-items: center; gap: .35rem; }
.stat-value { font-weight: 700; color: var(--primary); }
