/* ============================================================
   DevBox Pro Documentation — Design System
   ============================================================ */

/* ---------- Google Font ---------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Colors */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-card: rgba(17, 24, 39, 0.7);
  --bg-card-hover: rgba(30, 41, 59, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --bg-glass-border: rgba(255, 255, 255, 0.08);

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1;
  --accent-secondary: #8b5cf6;
  --accent-tertiary: #a78bfa;
  --accent-glow: rgba(99, 102, 241, 0.3);

  --green: #10b981;
  --green-glow: rgba(16, 185, 129, 0.15);
  --orange: #f59e0b;
  --red: #ef4444;
  --cyan: #06b6d4;

  --border-color: rgba(148, 163, 184, 0.1);
  --border-glow: rgba(99, 102, 241, 0.4);

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);
  --gradient-card: linear-gradient(145deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.04) 100%);
  --gradient-bg: radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.12) 0%, transparent 60%),
                 radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, 0.08) 0%, transparent 60%);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  --font-size-6xl: 3.75rem;

  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;

  /* Shadows */
  --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 30px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px var(--accent-glow);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;

  /* Layout */
  --container-max: 1200px;
  --nav-height: 72px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 2rem);
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  background-image: var(--gradient-bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a {
  color: var(--accent-tertiary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--accent-primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ---------- Utility ---------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ---------- Navigation ---------- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--nav-height);
  z-index: 1000;
  background: rgba(11, 15, 25, 0.75);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-base), box-shadow var(--transition-base);
}
.navbar.scrolled {
  background: rgba(11, 15, 25, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.navbar .container {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: var(--font-size-xl);
  color: var(--text-primary);
}
.nav-brand img {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: color var(--transition-fast), background var(--transition-fast);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.06);
}
.nav-links a.active {
  color: var(--accent-tertiary);
}

.nav-cta {
  background: var(--gradient-hero) !important;
  color: #fff !important;
  font-weight: 600 !important;
  padding: var(--space-sm) var(--space-lg) !important;
}
.nav-cta:hover {
  opacity: 0.9;
  box-shadow: var(--shadow-glow);
}

/* Mobile toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: var(--space-sm);
}
.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}
.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------- Page Hero ---------- */
.page-hero {
  padding-top: calc(var(--nav-height) + var(--space-4xl));
  padding-bottom: var(--space-4xl);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 500px;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.15), transparent 70%);
  pointer-events: none;
}
.page-hero h1 {
  font-size: var(--font-size-5xl);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--space-lg);
  position: relative;
}
.page-hero h1 .gradient-text {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-hero .subtitle {
  font-size: var(--font-size-xl);
  color: var(--text-secondary);
  max-width: 680px;
  margin: 0 auto var(--space-2xl);
  line-height: 1.6;
}

/* ---------- Home Hero (larger) ---------- */
.home-hero h1 {
  font-size: var(--font-size-6xl);
}
.home-hero .subtitle {
  font-size: var(--font-size-2xl);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: var(--font-size-base);
  cursor: pointer;
  border: none;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn-primary {
  background: var(--gradient-hero);
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px var(--accent-glow);
  color: #fff;
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-primary);
  border: 1px solid var(--bg-glass-border);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.btn-group {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- Sections ---------- */
.section {
  padding: var(--space-4xl) 0;
}
.section-alt {
  background: rgba(255, 255, 255, 0.01);
}
.section-header {
  text-align: center;
  margin-bottom: var(--space-3xl);
}
.section-header h2 {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  margin-bottom: var(--space-md);
}
.section-header p {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
}

/* ---------- Glass Cards ---------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: var(--space-lg);
  background: var(--gradient-card);
  border: 1px solid var(--bg-glass-border);
}

.card h3 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  margin-bottom: var(--space-sm);
}
.card p {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  line-height: 1.7;
}

/* ---------- Grid Layouts ---------- */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-xl);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-xl);
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-xl);
}

/* ---------- Screenshot / Image ---------- */
.screenshot-wrap {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--bg-glass-border);
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-slow), box-shadow var(--transition-slow);
}
.screenshot-wrap:hover {
  transform: scale(1.02);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.screenshot-wrap img {
  width: 100%;
  display: block;
}
.screenshot-caption {
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  text-align: center;
}

/* ---------- Feature Row (alternating image + text) ---------- */
.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3xl);
  align-items: center;
  margin-bottom: var(--space-4xl);
}
.feature-row.reverse {
  direction: rtl;
}
.feature-row.reverse > * {
  direction: ltr;
}
.feature-row .feature-content h3 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--space-md);
}
.feature-row .feature-content p {
  color: var(--text-secondary);
  margin-bottom: var(--space-md);
  line-height: 1.8;
}
.feature-row .feature-content ul {
  list-style: none;
  padding: 0;
}
.feature-row .feature-content ul li {
  padding: var(--space-xs) 0;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}
.feature-row .feature-content ul li::before {
  content: '✓';
  color: var(--green);
  font-weight: 700;
  flex-shrink: 0;
}

/* ---------- Version Table ---------- */
.version-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1px solid var(--bg-glass-border);
}
.version-table th,
.version-table td {
  padding: var(--space-md) var(--space-lg);
  text-align: left;
}
.version-table thead {
  background: rgba(99, 102, 241, 0.1);
}
.version-table th {
  font-weight: 600;
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.version-table tbody tr {
  border-bottom: 1px solid var(--border-color);
  transition: background var(--transition-fast);
}
.version-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}
.version-table td {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
}
.version-table tbody tr:last-child td {
  border-bottom: none;
}

/* Labels / Badges */
.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
}
.badge-latest {
  background: var(--green-glow);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-lts {
  background: rgba(6, 182, 212, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
}
.badge-legacy {
  background: rgba(245, 158, 11, 0.1);
  color: var(--orange);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ---------- Steps / Numbered Guide ---------- */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}
.step-item {
  counter-increment: step;
  display: flex;
  gap: var(--space-xl);
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--border-color);
}
.step-item:last-child {
  border-bottom: none;
}
.step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--gradient-hero);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-size-xl);
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}
.step-content h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
  margin-bottom: var(--space-sm);
}
.step-content p {
  color: var(--text-secondary);
  line-height: 1.7;
}
.step-content .screenshot-wrap {
  margin-top: var(--space-lg);
  max-width: 700px;
}

/* ---------- Accordion / FAQ ---------- */
.accordion-item {
  border: 1px solid var(--bg-glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-md);
  overflow: hidden;
  transition: border-color var(--transition-base);
}
.accordion-item.open {
  border-color: var(--border-glow);
}
.accordion-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg) var(--space-xl);
  background: var(--bg-card);
  border: none;
  color: var(--text-primary);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-family);
  transition: background var(--transition-fast);
}
.accordion-header:hover {
  background: var(--bg-card-hover);
}
.accordion-chevron {
  font-size: var(--font-size-lg);
  transition: transform var(--transition-base);
  color: var(--text-muted);
}
.accordion-item.open .accordion-chevron {
  transform: rotate(180deg);
}
.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}
.accordion-body-inner {
  padding: 0 var(--space-xl) var(--space-xl);
  color: var(--text-secondary);
  line-height: 1.8;
}
.accordion-body-inner p {
  margin-bottom: var(--space-md);
}
.accordion-body-inner p:last-child {
  margin-bottom: 0;
}

/* ---------- Info Callout ---------- */
.callout {
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-xl);
  margin: var(--space-xl) 0;
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}
.callout-icon {
  flex-shrink: 0;
  font-size: 1.25rem;
}
.callout-info {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.2);
}
.callout-tip {
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.callout-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.callout p {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
}

/* ---------- Code Block ---------- */
.code-block {
  background: #0d1117;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  overflow-x: auto;
  border: 1px solid var(--border-color);
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: var(--font-size-sm);
  line-height: 1.8;
  color: #e6edf3;
  margin: var(--space-md) 0;
}

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border-color);
  padding: var(--space-3xl) 0 var(--space-xl);
  margin-top: var(--space-4xl);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}
.footer-brand p {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin-top: var(--space-md);
  line-height: 1.7;
  max-width: 300px;
}
.footer-col h4 {
  font-size: var(--font-size-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-lg);
  color: var(--text-primary);
}
.footer-col ul {
  list-style: none;
}
.footer-col ul li {
  margin-bottom: var(--space-sm);
}
.footer-col ul li a {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}
.footer-col ul li a:hover {
  color: var(--text-primary);
}
.footer-bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

/* ---------- Scroll Animations ---------- */
.animate-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.animate-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Port Reference Table ---------- */
.port-table {
  width: 100%;
}

/* ---------- Stats Bar ---------- */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: var(--space-3xl);
  padding: var(--space-3xl) 0;
  flex-wrap: wrap;
}
.stat-item {
  text-align: center;
}
.stat-number {
  font-size: var(--font-size-4xl);
  font-weight: 800;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  margin-top: var(--space-xs);
}

/* ---------- Guide Card ---------- */
.guide-card {
  display: block;
  color: var(--text-primary);
}
.guide-card:hover {
  color: var(--text-primary);
}
.guide-card .card-icon {
  transition: transform var(--transition-base);
}
.guide-card:hover .card-icon {
  transform: scale(1.1);
}

/* ---------- Service Card ---------- */
.service-card {
  text-align: center;
}
.service-card .card-icon {
  margin: 0 auto var(--space-lg);
  width: 60px;
  height: 60px;
  font-size: 1.75rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-xl); }
}

@media (max-width: 768px) {
  :root {
    --nav-height: 64px;
  }

  .nav-links {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(11, 15, 25, 0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: var(--space-xl);
    gap: var(--space-xs);
    border-bottom: 1px solid var(--border-color);
    transform: translateY(-120%);
    opacity: 0;
    transition: transform var(--transition-base), opacity var(--transition-base);
    z-index: 999;
  }
  .nav-links.open {
    transform: translateY(0);
    opacity: 1;
  }
  .nav-links a {
    width: 100%;
    justify-content: center;
    padding: var(--space-md);
  }

  .nav-toggle {
    display: flex;
  }

  .page-hero h1 {
    font-size: var(--font-size-3xl);
  }
  .home-hero h1 {
    font-size: var(--font-size-4xl);
  }
  .page-hero .subtitle {
    font-size: var(--font-size-base);
  }
  .home-hero .subtitle {
    font-size: var(--font-size-lg);
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .feature-row {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  .feature-row.reverse {
    direction: ltr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .footer-brand p {
    max-width: 100%;
  }

  .stats-bar {
    gap: var(--space-xl);
  }

  .step-item {
    flex-direction: column;
    gap: var(--space-md);
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 var(--space-md);
  }
  .card {
    padding: var(--space-lg);
  }
  .home-hero h1 {
    font-size: var(--font-size-3xl);
  }
  .btn-group {
    flex-direction: column;
    align-items: stretch;
  }
  .btn {
    justify-content: center;
  }
}
