/* ============================================================
   Chronos UI — Documentation Site Styles
   Dark mode, premium feel, sidebar layout
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* ── Design Tokens ─────────────────────────────────────── */
:root {
  --bg-base:        #0a0a0f;
  --bg-surface:     #111118;
  --bg-elevated:    #1a1a25;
  --bg-hover:       #22223a;
  --border:         rgba(255,255,255,0.07);
  --border-accent:  rgba(124,58,237,0.5);

  --text-primary:   #f0f0ff;
  --text-secondary: #9090b0;
  --text-muted:     #5c5c80;
  --text-code:      #a78bfa;

  --accent:         #7c3aed;
  --accent-light:   #9f6cf7;
  --accent-glow:    rgba(124,58,237,0.25);
  --pink:           #ec4899;
  --pink-glow:      rgba(236,72,153,0.2);

  --sidebar-w:      260px;
  --topbar-h:       60px;
  --radius-sm:      6px;
  --radius-md:      12px;
  --radius-lg:      18px;
  --shadow-md:      0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow:    0 0 40px var(--accent-glow);

  --font-sans:      'Inter', system-ui, sans-serif;
  --font-mono:      'JetBrains Mono', 'Fira Code', monospace;

  --transition:     0.2s ease;
}

/* ── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-light); text-decoration: none; }
a:hover { color: #fff; }
img, video { max-width: 100%; }

/* ── Layout Shell ───────────────────────────────────────── */
.docs-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────── */
.docs-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  transition: transform var(--transition);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
}

.sidebar-logo {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--pink));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800; color: #fff;
  flex-shrink: 0;
}

.sidebar-brand-name {
  font-size: 1rem; font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.sidebar-brand-name span {
  color: var(--accent-light);
}

.sidebar-version {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-left: auto;
  background: var(--bg-elevated);
  padding: 2px 6px;
  border-radius: 4px;
}

.sidebar-nav {
  padding: 1rem 0;
  flex: 1;
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.5rem 1.5rem 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0.45rem 1.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  transition: all var(--transition);
  border-left: 2px solid transparent;
  text-decoration: none;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
  border-left-color: var(--border-accent);
}

.sidebar-link.active {
  color: var(--accent-light);
  background: var(--accent-glow);
  border-left-color: var(--accent);
  font-weight: 500;
}

.sidebar-link-icon {
  font-size: 14px;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
}

.sidebar-footer a {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--transition);
}

.sidebar-footer a:hover { color: var(--text-primary); }

/* ── Main Content ───────────────────────────────────────── */
.docs-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
}

.docs-topbar {
  position: sticky;
  top: 0;
  height: var(--topbar-h);
  background: rgba(10,10,15,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  z-index: 50;
  gap: 1rem;
}

.topbar-breadcrumb {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.topbar-breadcrumb .sep { color: var(--text-muted); opacity: 0.4; }
.topbar-breadcrumb .current { color: var(--text-primary); font-weight: 500; }

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-github {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-github:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

/* ── Page Content ───────────────────────────────────────── */
.docs-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
}

/* ── Page Header ────────────────────────────────────────── */
.page-header {
  margin-bottom: 3rem;
}

.page-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  color: var(--accent-light);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--text-primary) 50%, var(--accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.7;
}

/* ── Section Heading ────────────────────────────────────── */
.section-heading {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-heading::before {
  content: '';
  width: 3px;
  height: 16px;
  background: linear-gradient(to bottom, var(--accent), var(--pink));
  border-radius: 2px;
  flex-shrink: 0;
}

/* ── Preview Card ───────────────────────────────────────── */
.preview-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}

.preview-toolbar {
  display: flex;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  gap: 0.5rem;
}

.preview-dot { width: 10px; height: 10px; border-radius: 50%; }
.preview-dot.red   { background: #ff5f57; }
.preview-dot.amber { background: #ffbd2e; }
.preview-dot.green { background: #28c840; }

.preview-url {
  margin-left: 0.75rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  background: var(--bg-base);
  padding: 3px 12px;
  border-radius: 4px;
  border: 1px solid var(--border);
  flex: 1;
}

.preview-body {
  padding: 2rem;
  background: var(--bg-base);
  min-height: 120px;
}

.preview-body-flush {
  padding: 0;
  background: var(--bg-base);
  min-height: 120px;
}

/* ── Framework Tabs ─────────────────────────────────────── */
.tabs-bar {
  display: flex;
  gap: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 1rem;
  width: fit-content;
}

.tab-btn {
  padding: 6px 16px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: calc(var(--radius-md) - 4px);
  transition: all var(--transition);
  white-space: nowrap;
}

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

.tab-btn.active {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Code Block ─────────────────────────────────────────── */
.code-block {
  position: relative;
  margin-bottom: 2rem;
}

.code-block pre {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--text-primary);
}

.code-block code {
  font-family: inherit;
}

/* Syntax colouring (minimal, css-only) */
.kw  { color: #c084fc; }  /* keywords */
.str { color: #86efac; }  /* strings */
.cm  { color: #5c5c80; font-style: italic; }  /* comments */
.fn  { color: #93c5fd; }  /* function names */
.num { color: #fbbf24; }  /* numbers */
.tag { color: #f472b6; }  /* HTML/JSX tags */
.at  { color: #a78bfa; }  /* attributes */
.ty  { color: #34d399; }  /* types */

.copy-btn {
  position: absolute;
  top: 10px; right: 10px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition);
}

.copy-btn:hover { color: var(--text-primary); border-color: var(--border-accent); }
.copy-btn.copied { color: #4ade80; border-color: #4ade80; }

/* ── Props Table ────────────────────────────────────────── */
.props-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.props-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.props-table thead tr {
  background: var(--bg-elevated);
}

.props-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.props-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: top;
}

.props-table tbody tr:last-child td { border-bottom: none; }

.props-table tbody tr:hover td { background: var(--bg-hover); }

.prop-name {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-code);
  font-weight: 500;
}

.prop-type {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #34d399;
}

.prop-default {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.prop-required {
  display: inline-block;
  background: rgba(236,72,153,0.15);
  color: #f9a8d4;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Install Banner ─────────────────────────────────────── */
.install-banner {
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(236,72,153,0.08));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.install-banner code {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent-light);
  flex: 1;
}

/* ── Alert Boxes ────────────────────────────────────────── */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  border-left: 3px solid;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
}

.alert-tip  { background: rgba(52,211,153,0.08); border-color: #34d399; color: #a7f3d0; }
.alert-info { background: rgba(96,165,250,0.08); border-color: #60a5fa; color: #bfdbfe; }
.alert-warn { background: rgba(251,191,36,0.08); border-color: #fbbf24; color: #fde68a; }

/* ── Landing Hero ───────────────────────────────────────── */
.landing-hero {
  text-align: center;
  padding: 5rem 2rem 3rem;
  max-width: 760px;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-glow);
  border: 1px solid var(--border-accent);
  color: var(--accent-light);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.08;
  margin-bottom: 1.25rem;
}

.hero-gradient {
  background: linear-gradient(135deg, var(--accent-light), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--accent), #6d28d9);
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: 0 4px 20px var(--accent-glow);
  transition: all var(--transition);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
  color: #fff;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

/* ── Feature Pills ──────────────────────────────────────── */
.feature-pills {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 4rem;
}

.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.feature-pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.dot-react  { background: #61dafb; }
.dot-svelte { background: #ff3e00; }
.dot-wc     { background: #4ade80; }
.dot-ts     { background: #3b82f6; }
.dot-css    { background: #a78bfa; }

/* ── Component Grid ─────────────────────────────────────── */
.component-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

.component-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  text-decoration: none;
  transition: all 0.25s ease;
  display: flex;
  flex-direction: column;
}

.component-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), var(--shadow-glow);
  color: inherit;
}

.card-preview {
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  position: relative;
  overflow: hidden;
}

.card-preview-bg {
  position: absolute;
  inset: 0;
  opacity: 0.15;
}

.card-preview-icon {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

.card-body {
  padding: 1.25rem;
  flex: 1;
}

.card-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.375rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.card-footer {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}

.card-tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 4px;
}

.tag-react  { background: rgba(97,218,251,0.1); color: #61dafb; }
.tag-svelte { background: rgba(255,62,0,0.1);   color: #ff7750; }
.tag-wc     { background: rgba(74,222,128,0.1); color: #4ade80; }

/* ── Stats Bar ──────────────────────────────────────────── */
.stats-bar {
  display: flex;
  gap: 3rem;
  justify-content: center;
  padding: 2.5rem;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4rem;
}

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

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--accent-light), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Mobile Sidebar Toggle ──────────────────────────────── */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  font-size: 1.25rem;
  padding: 4px;
}

/* ── Scrollbar ──────────────────────────────────────────── */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: #2a2a40; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a55; }

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 768px) {
  .docs-sidebar {
    transform: translateX(-100%);
  }

  .docs-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 60px rgba(0,0,0,0.7);
  }

  .docs-main {
    margin-left: 0;
  }

  .sidebar-toggle {
    display: block;
  }

  .hero-title { font-size: 2rem; }

  .stats-bar { gap: 1.5rem; flex-wrap: wrap; }

  .landing-hero { padding: 3rem 1rem 2rem; }
}
