/* ============================================================
   IronClad Docs — Premium Dark Theme
   ============================================================ */

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

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Primary palette */
  --clr-bg-deep:      #0a0e1a;
  --clr-bg:           #0f1523;
  --clr-bg-card:      rgba(17, 25, 45, 0.65);
  --clr-bg-card-hover:rgba(22, 32, 58, 0.8);
  --clr-bg-code:      #151d30;
  --clr-bg-code-header:#1a2540;

  /* Accents */
  --clr-accent:       #6c8aff;
  --clr-accent-bright:#8aa5ff;
  --clr-accent-glow:  rgba(108, 138, 255, 0.15);
  --clr-accent-2:     #c084fc;   /* purple-400 */
  --clr-accent-3:     #22d3ee;   /* cyan-400 */
  --clr-success:      #34d399;
  --clr-warning:      #fbbf24;
  --clr-danger:       #f87171;

  /* Text */
  --clr-text:         #e2e8f0;
  --clr-text-muted:   #94a3b8;
  --clr-text-dim:     #64748b;

  /* Borders */
  --clr-border:       rgba(148, 163, 184, 0.12);
  --clr-border-hover: rgba(108, 138, 255, 0.35);

  /* Glass */
  --glass-blur:       16px;
  --glass-border:     1px solid rgba(255, 255, 255, 0.06);

  /* Layout */
  --sidebar-w:        280px;
  --header-h:         64px;
  --radius:           12px;
  --radius-sm:        8px;
  --radius-xs:        6px;

  /* Transitions */
  --ease:             cubic-bezier(0.4, 0, 0.2, 1);
  --duration:         0.25s;
}

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

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--clr-bg-deep);
  color: var(--clr-text);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

/* ---------- Animated Background ---------- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(108, 138, 255, 0.08) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(192, 132, 252, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(34, 211, 238, 0.04) 0%, transparent 60%);
  z-index: -1;
  pointer-events: none;
}

/* ---------- Selection ---------- */
::selection {
  background: rgba(108, 138, 255, 0.3);
  color: #fff;
}

/* ---------- Links ---------- */
a {
  color: var(--clr-accent);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}
a:hover { color: var(--clr-accent-bright); }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  z-index: 100;
  background: rgba(10, 14, 26, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: var(--glass-border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
}

.header-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.header-brand img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
}
.header-brand span {
  font-weight: 700;
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--clr-accent), var(--clr-accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.header-nav a {
  color: var(--clr-text-muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-xs);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all var(--duration) var(--ease);
}
.header-nav a:hover {
  color: var(--clr-text);
  background: var(--clr-accent-glow);
}
.header-nav a.btn-outline {
  border: 1px solid var(--clr-border-hover);
  color: var(--clr-accent);
  margin-left: 0.5rem;
}
.header-nav a.btn-outline:hover {
  background: rgba(108, 138, 255, 0.12);
  color: var(--clr-accent-bright);
}

/* Mobile hamburger */
.mobile-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--clr-text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* ============================================================
   LAYOUT — Sidebar + Main
   ============================================================ */
.page-wrapper {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: 1.5rem 1rem 2rem 1.5rem;
  border-right: var(--glass-border);
  background: rgba(10, 14, 26, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 50;
  transition: transform 0.3s var(--ease);
}

.sidebar-section {
  margin-bottom: 1.5rem;
}
.sidebar-section h4 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clr-text-dim);
  margin-bottom: 0.5rem;
  padding-left: 0.75rem;
}
.sidebar-section a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-xs);
  color: var(--clr-text-muted);
  font-size: 0.85rem;
  font-weight: 450;
  transition: all var(--duration) var(--ease);
}
.sidebar-section a:hover {
  color: var(--clr-text);
  background: var(--clr-accent-glow);
}
.sidebar-section a.active {
  color: var(--clr-accent);
  background: var(--clr-accent-glow);
  font-weight: 600;
}
.sidebar-section a .icon {
  font-size: 1em;
  width: 1.2em;
  text-align: center;
  flex-shrink: 0;
}

/* Scrollbar */
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--clr-border); border-radius: 4px; }

/* ---------- Main Content ---------- */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 2.5rem 3rem 4rem;
  max-width: 900px;
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero {
  text-align: center;
  padding: 3rem 0 3.5rem;
  position: relative;
}

.hero-logo {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  margin-bottom: 1.5rem;
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 8px 32px rgba(108, 138, 255, 0.2));
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #fff, var(--clr-accent-bright), var(--clr-accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero p {
  font-size: 1.15rem;
  color: var(--clr-text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
}

.hero-install {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--clr-bg-code);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 0.85rem 1.5rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  color: var(--clr-accent-bright);
  transition: border-color var(--duration) var(--ease);
}
.hero-install:hover { border-color: var(--clr-border-hover); }

.hero-install .copy-btn {
  background: none;
  border: none;
  color: var(--clr-text-dim);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.2rem;
  transition: color var(--duration) var(--ease);
}
.hero-install .copy-btn:hover { color: var(--clr-accent); }

/* Badges row */
.hero-badges {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.hero-badges img { height: 22px; }

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  margin-bottom: 3rem;
  scroll-margin-top: calc(var(--header-h) + 1rem);
}
.section h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section h2 .anchor {
  opacity: 0;
  color: var(--clr-text-dim);
  font-size: 0.9em;
  transition: opacity var(--duration) var(--ease);
  text-decoration: none;
}
.section h2:hover .anchor { opacity: 1; }

.section h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--clr-text);
  margin: 1.5rem 0 0.75rem;
}

.section p {
  color: var(--clr-text-muted);
  margin-bottom: 1rem;
}

/* ============================================================
   TABS
   ============================================================ */
.tabs {
  margin-bottom: 1rem;
}
.tab-buttons {
  display: flex;
  gap: 0.25rem;
  border-bottom: 1px solid var(--clr-border);
  margin-bottom: 0;
}
.tab-btn {
  background: none;
  border: none;
  color: var(--clr-text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.65rem 1.25rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--duration) var(--ease);
  position: relative;
  bottom: -1px;
}
.tab-btn:hover {
  color: var(--clr-text);
}
.tab-btn.active {
  color: var(--clr-accent);
  border-bottom-color: var(--clr-accent);
}
.tab-panel {
  display: none;
  animation: fadeIn 0.3s var(--ease);
}
.tab-panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   CODE BLOCKS
   ============================================================ */
.code-block {
  position: relative;
  background: var(--clr-bg-code);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  overflow: hidden;
}
.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: var(--clr-bg-code-header);
  border-bottom: 1px solid var(--clr-border);
  font-size: 0.75rem;
  color: var(--clr-text-dim);
  font-family: 'JetBrains Mono', monospace;
}
.code-block pre {
  margin: 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--clr-text);
}
.code-block code {
  font-family: inherit;
}

/* Copy button */
.copy-code-btn {
  background: none;
  border: 1px solid var(--clr-border);
  color: var(--clr-text-dim);
  font-size: 0.75rem;
  font-family: inherit;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--duration) var(--ease);
}
.copy-code-btn:hover {
  color: var(--clr-accent);
  border-color: var(--clr-border-hover);
}
.copy-code-btn.copied {
  color: var(--clr-success);
  border-color: var(--clr-success);
}

/* Inline code */
code:not(.code-block code) {
  background: var(--clr-bg-code);
  padding: 0.15em 0.4em;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85em;
  color: var(--clr-accent-bright);
  border: 1px solid var(--clr-border);
}

/* Syntax highlighting helpers */
.code-comment { color: var(--clr-text-dim); }
.code-keyword { color: var(--clr-accent-2); }
.code-string  { color: var(--clr-success); }
.code-cmd     { color: var(--clr-accent-3); }

/* ============================================================
   CALLOUT / ALERT BOXES
   ============================================================ */
.callout {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.callout.info {
  background: rgba(108, 138, 255, 0.08);
  border-color: var(--clr-accent);
  color: var(--clr-accent-bright);
}
.callout.tip {
  background: rgba(52, 211, 153, 0.08);
  border-color: var(--clr-success);
  color: var(--clr-success);
}
.callout.warning {
  background: rgba(251, 191, 36, 0.08);
  border-color: var(--clr-warning);
  color: var(--clr-warning);
}
.callout.danger {
  background: rgba(248, 113, 113, 0.08);
  border-color: var(--clr-danger);
  color: var(--clr-danger);
}
.callout strong { font-weight: 600; }
.callout p { color: inherit; margin: 0; }

/* ============================================================
   CARDS / GLASS PANELS
   ============================================================ */
.card {
  background: var(--clr-bg-card);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: var(--glass-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: background var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.card:hover {
  background: var(--clr-bg-card-hover);
  border-color: var(--clr-border-hover);
}

/* ============================================================
   PLATFORM TABLE
   ============================================================ */
.platform-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}
.platform-table th,
.platform-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--clr-border);
}
.platform-table th {
  color: var(--clr-text-dim);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.platform-table td { color: var(--clr-text-muted); }
.platform-table tr:hover td { color: var(--clr-text); }
.platform-table a { font-weight: 500; }

/* ============================================================
   STEP INDICATORS
   ============================================================ */
.steps { counter-reset: step-counter; }
.step {
  position: relative;
  padding-left: 3.5rem;
  margin-bottom: 2rem;
  counter-increment: step-counter;
}
.step::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--clr-accent), var(--clr-accent-2));
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(108, 138, 255, 0.25);
}
.step h3 {
  margin-top: 0;
  margin-bottom: 0.5rem;
}
.step p {
  font-size: 0.9rem;
}

/* Vertical connector line between steps */
.step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: calc(1.1rem - 1px);
  top: 2.5rem;
  bottom: -1.25rem;
  width: 2px;
  background: linear-gradient(to bottom, var(--clr-accent), transparent);
  opacity: 0.3;
}

/* ============================================================
   DOWNLOAD BUTTON
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.9rem;
  border: none;
  cursor: pointer;
  transition: all var(--duration) var(--ease);
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--clr-accent), var(--clr-accent-2));
  color: #fff;
  box-shadow: 0 4px 16px rgba(108, 138, 255, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(108, 138, 255, 0.45);
  transform: translateY(-1px);
  color: #fff;
}
.btn-secondary {
  background: var(--clr-bg-code);
  color: var(--clr-text);
  border: 1px solid var(--clr-border);
}
.btn-secondary:hover {
  border-color: var(--clr-border-hover);
  background: var(--clr-bg-card-hover);
  color: var(--clr-text);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  margin-left: var(--sidebar-w);
  padding: 2rem 3rem;
  border-top: var(--glass-border);
  text-align: center;
  color: var(--clr-text-dim);
  font-size: 0.8rem;
}
.site-footer a { color: var(--clr-text-muted); }
.site-footer a:hover { color: var(--clr-accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; padding: 2rem 1.5rem 3rem; max-width: 100%; }
  .site-footer { margin-left: 0; padding: 2rem 1.5rem; }
  .mobile-toggle { display: block; }
}

@media (max-width: 640px) {
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 1rem; }
  .hero-install { font-size: 0.8rem; padding: 0.7rem 1rem; }
  .main-content { padding: 1.5rem 1rem 2rem; }
  .tab-btn { padding: 0.5rem 0.75rem; font-size: 0.8rem; }
  .header-nav a:not(.btn-outline) { display: none; }
  .step { padding-left: 3rem; }
}

/* ============================================================
   SCROLLBAR (main)
   ============================================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--clr-bg-deep); }
::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 163, 184, 0.25); }

/* ============================================================
   UTILITIES
   ============================================================ */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.text-muted { color: var(--clr-text-muted); }
.text-accent { color: var(--clr-accent); }

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 40;
}
.sidebar-overlay.active {
  display: block;
}
