/* ============================================
   TimeLens Documentation Site Styles
   GitHub-inspired dark theme with glassmorphism
   ============================================ */

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

:root {
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: #21262d;
  --bg-elevated: #1c2128;
  --border-color: #30363d;
  --border-light: #21262d;
  --text-primary: #e6edf3;
  --text-secondary: #8b949e;
  --text-muted: #6e7681;
  --accent: #58a6ff;
  --accent-hover: #79c0ff;
  --accent-dim: #1f6feb;
  --success: #3fb950;
  --warning: #d29922;
  --danger: #f85149;
  --purple: #a371f7;
  --pink: #f778ba;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  --glass-bg: rgba(22, 27, 34, 0.7);
  --glass-border: rgba(48, 54, 61, 0.5);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Monaco, monospace;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--accent-hover);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(13, 17, 23, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  transition: background 0.3s;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
}

.nav-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
}

.nav-title {
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s;
}
.nav-link:hover {
  color: var(--text-primary);
}

.github-icon {
  width: 18px;
  height: 18px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
  position: relative;
  padding: 140px 24px 80px;
  overflow: hidden;
  text-align: center;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(88, 166, 255, 0.12), transparent),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(163, 113, 247, 0.08), transparent),
    radial-gradient(ellipse 50% 30% at 20% 80%, rgba(63, 185, 80, 0.06), transparent);
}

.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: floatParticle 5s ease-in-out infinite;
}

@keyframes floatParticle {
  0%, 100% { opacity: 0; transform: translateY(0) scale(0.5); }
  50% { opacity: 0.6; transform: translateY(-30px) scale(1); }
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.hero-icon {
  width: 20px;
  height: 20px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent), var(--purple), 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: 600px;
  margin: 0 auto 28px;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}
.badge-dot.green { background: var(--success); }
.badge-dot.blue { background: var(--accent); }
.badge-dot.purple { background: var(--purple); }

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}
.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-dim), var(--purple));
  color: white;
  box-shadow: 0 4px 14px rgba(31, 111, 235, 0.3);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(31, 111, 235, 0.4);
  color: white;
}

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

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

/* ============================================
   STATS BAR
   ============================================ */
.stats-bar {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  padding: 32px 24px;
}

.stats-container {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 24px;
}

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

.stat-value {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* ============================================
   SECTIONS COMMON
   ============================================ */
.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px;
}

.section-header {
  text-align: center;
  margin-bottom: 56px;
}

.section-tag {
  display: inline-block;
  padding: 4px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ============================================
   FEATURES
   ============================================ */
.features {
  background: var(--bg-primary);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.feature-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.3s;
}
.feature-card:hover {
  border-color: var(--border-color);
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.feature-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(88,166,255,0.15), rgba(163,113,247,0.15));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.feature-icon-wrap svg {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ============================================
   QUICK START
   ============================================ */
.quickstart {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
}

.code-block {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 40px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.code-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-color);
}

.code-dots {
  display: flex;
  gap: 6px;
}
.code-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.code-dots span:nth-child(1) { background: #ff5f56; }
.code-dots span:nth-child(2) { background: #ffbd2e; }
.code-dots span:nth-child(3) { background: #27c93f; }

.code-filename {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  flex: 1;
}

.code-copy {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}
.code-copy:hover {
  background: var(--bg-elevated);
  color: var(--text-primary);
}
.code-copy svg {
  width: 14px;
  height: 14px;
}

.code-block pre {
  padding: 20px 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.7;
}

.code-keyword { color: var(--accent); }
.code-comment { color: var(--text-muted); }
.code-string { color: var(--success); }

.quickstart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
}

.quickstart-item {
  text-align: center;
  padding: 24px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.quickstart-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-dim), var(--purple));
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
}

.quickstart-item h4 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.quickstart-item p {
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.quickstart-item code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--accent);
}

/* ============================================
   TECH STACK
   ============================================ */
.tech-stack {
  background: var(--bg-primary);
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  max-width: 800px;
  margin: 0 auto;
}

.tech-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  transition: all 0.3s;
}
.tech-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.tech-logo {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  border-radius: var(--radius-sm);
}

.tech-card h4 {
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.tech-card p {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ============================================
   DOCUMENTATION
   ============================================ */
.documentation {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-light);
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.doc-card {
  display: block;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all 0.3s;
  color: inherit;
}
.doc-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: inherit;
}

.doc-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(88,166,255,0.12), rgba(163,113,247,0.12));
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
.doc-icon svg {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.doc-card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.doc-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.6;
  margin-bottom: 14px;
}

.doc-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
  background: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  padding: 40px 24px;
  text-align: center;
}

.footer-container {
  max-width: 800px;
  margin: 0 auto;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.footer-icon {
  width: 24px;
  height: 24px;
}

.footer-copy {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.85rem;
}
.footer-links a:hover {
  color: var(--accent);
}

/* ============================================
   MARKDOWN CONTENT PAGES (shared)
   ============================================ */
.content-wrapper {
  display: flex;
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 24px 60px;
  gap: 40px;
}

.sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 84px;
  align-self: flex-start;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 2px;
}

.sidebar-nav a {
  display: block;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all 0.15s;
}
.sidebar-nav a:hover,
.sidebar-nav a.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.sidebar-nav a.active {
  font-weight: 600;
}

.content-main {
  flex: 1;
  min-width: 0;
  max-width: 800px;
}

.content-main h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.content-main h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 40px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.content-main h3 {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--accent);
}

.content-main h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 20px 0 8px;
}

.content-main p {
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.7;
}

.content-main p strong {
  color: var(--text-primary);
}

.content-main ul,
.content-main ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.content-main li {
  color: var(--text-secondary);
  margin-bottom: 6px;
  line-height: 1.6;
}

.content-main li strong {
  color: var(--text-primary);
}

.content-main code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent);
}

.content-main pre {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  overflow-x: auto;
  margin-bottom: 20px;
}

.content-main pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
  font-size: 0.85rem;
  line-height: 1.7;
}

.content-main table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.content-main th,
.content-main td {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  text-align: left;
}

.content-main th {
  background: var(--bg-tertiary);
  font-weight: 600;
  color: var(--text-primary);
}

.content-main td {
  color: var(--text-secondary);
}

.content-main tr:nth-child(even) td {
  background: rgba(22, 27, 34, 0.4);
}

.content-main hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 32px 0;
}

.content-main blockquote {
  border-left: 3px solid var(--accent);
  padding: 12px 18px;
  background: var(--bg-tertiary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin-bottom: 16px;
}

.content-main blockquote p {
  margin-bottom: 0;
  color: var(--text-secondary);
}

.content-main a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.toc-list {
  list-style: none;
  padding-left: 0;
}
.toc-list li {
  margin-bottom: 2px;
}
.toc-list a {
  display: block;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
}
.toc-list a:hover {
  color: var(--text-secondary);
  background: var(--bg-tertiary);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.breadcrumb a {
  color: var(--text-secondary);
}
.breadcrumb a:hover {
  color: var(--accent);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    flex-direction: column;
    padding: 16px 24px;
    gap: 12px;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-toggle {
    display: flex;
  }

  .hero {
    padding: 120px 20px 60px;
    min-height: auto;
  }

  .hide-mobile {
    display: none;
  }

  .feature-grid,
  .doc-grid {
    grid-template-columns: 1fr;
  }

  .tech-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .quickstart-grid {
    grid-template-columns: 1fr;
  }

  .stats-container {
    gap: 16px;
  }

  .content-wrapper {
    flex-direction: column;
    padding-top: 100px;
  }
  .sidebar {
    width: 100%;
    position: static;
  }
}
