/* ============================================================
   TextToolKit Professional Design System v2.0
   ============================================================
   Color philosophy: Deep tech gradient + glass cards + indigo accent
   Inspiration: Vercel, Linear, Notion dark mode
   ============================================================ */

/* ── Design Tokens ── */
:root {
  /* Background gradient layers */
  --bg-deepest: #070b16;
  --bg-deep: #0b1021;
  --bg-base: #0f1729;
  --bg-elevated: #151d30;
  --bg-card: rgba(21, 29, 48, 0.7);

  /* Accent — Indigo/Violet gradient */
  --accent-1: #6366f1;
  --accent-2: #8b5cf6;
  --accent-3: #a78bfa;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  --accent-glow: rgba(99, 102, 241, 0.25);

  /* Semantic */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  /* Text hierarchy */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-inverse: #0f1729;

  /* Borders */
  --border-subtle: rgba(148, 163, 184, 0.08);
  --border-default: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.2);
  --border-accent: rgba(99, 102, 241, 0.35);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4), 0 0 1px rgba(99,102,241,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.5), 0 0 4px rgba(99,102,241,0.15);
  --shadow-glow: 0 0 24px rgba(99,102,241,0.3);

  /* Spacing rhythm (4px base) */
  --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;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Typography */
  --font-sans: 'Inter', 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99,102,241,0.12), transparent),
    radial-gradient(ellipse 60% 40% at 80% 80%, rgba(139,92,246,0.06), transparent),
    var(--bg-deepest);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  letter-spacing: -0.011em;
}

/* ── Container ── */
.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: var(--space-10) var(--space-6);
}

/* ── Typography ── */
h1 {
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  background: linear-gradient(135deg, #e2e8f0 0%, #f8fafc 50%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-3);
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: var(--space-5);
  position: relative;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.subtitle {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-10);
  max-width: 600px;
  line-height: 1.6;
}

/* ── Glass Card ── */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin-bottom: var(--space-6);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}
.card--accent {
  border-color: var(--border-accent);
  box-shadow: 0 0 32px rgba(99,102,241,0.08);
}

/* ── Button System ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 28px;
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  line-height: 1;
}

.btn--primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.btn--primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.btn--primary:active {
  transform: translateY(0);
}

.btn--secondary {
  background: rgba(148,163,184,0.1);
  color: var(--text-primary);
  border: 1px solid var(--border-default);
}
.btn--secondary:hover {
  background: rgba(148,163,184,0.15);
  border-color: var(--border-strong);
}

.btn--lg {
  padding: 16px 36px;
  font-size: 1.05rem;
}
.btn--full {
  width: 100%;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Input ── */
.input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-deep);
  border: 1.5px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.input::placeholder { color: var(--text-tertiary); }
.input:focus {
  border-color: var(--accent-1);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-2);
}

/* ── Badge ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge--accent { background: rgba(99,102,241,0.15); color: var(--accent-3); }
.badge--success { background: rgba(16,185,129,0.15); color: var(--success); }
.badge--warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge--danger  { background: rgba(239,68,68,0.15); color: var(--danger); }

/* ── Table ── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
thead {
  background: rgba(99,102,241,0.06);
}
th {
  text-align: left;
  padding: 12px 16px;
  color: var(--text-tertiary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-default);
}
td {
  padding: 12px 16px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-subtle);
}
tr:last-child td { border-bottom: none; }
tr:hover td {
  background: rgba(99,102,241,0.04);
}

/* ── FAQ Accordion ── */
details {
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-3) 0;
}
details:last-child { border-bottom: none; }
summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  padding: var(--space-2) 0;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.2s;
}
summary:hover { color: var(--accent-3); }
summary::after {
  content: '+';
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-tertiary);
  transition: transform 0.2s;
}
details[open] summary::after {
  content: '−';
  transform: rotate(180deg);
}
details p, details .answer {
  color: var(--text-secondary);
  padding: var(--space-2) 0 var(--space-3);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ── Stat Card ── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  text-align: center;
}
.stat-card__value {
  font-size: 2rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-card__label {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Tool Header ── */
.tool-header {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.back-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  transition: all 0.2s;
}
.back-link:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  background: rgba(148,163,184,0.08);
}

/* ── Section Divider ── */
.section-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong), transparent);
  margin: var(--space-10) 0;
}

/* ── List Styles ── */
.content-list {
  list-style: none;
  padding: 0;
}
.content-list li {
  padding: var(--space-2) 0;
  padding-left: var(--space-6);
  position: relative;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}
.content-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
}

/* ── Hero Section (for homepage) ── */
.hero {
  text-align: center;
  padding: var(--space-16) 0 var(--space-12);
}
.hero h1 {
  font-size: 3.5rem;
  margin-bottom: var(--space-4);
}
.hero .subtitle {
  margin: 0 auto var(--space-8);
  font-size: 1.2rem;
}
.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--space-10);
  margin-top: var(--space-8);
}
.hero-stat {
  text-align: center;
}
.hero-stat__num {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-stat__label {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .container { padding: var(--space-6) var(--space-4); }
  h1 { font-size: 2rem; }
  .hero h1 { font-size: 2.5rem; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { gap: var(--space-6); flex-wrap: wrap; }
}
@media (max-width: 480px) {
  h1 { font-size: 1.75rem; }
  .stat-grid { grid-template-columns: 1fr; }
  .card { padding: var(--space-5); }
}
