/* ==============================================================================
   DARIUS AI — DOCUMENTATION PORTAL STYLESHEET
   High-End Dark Studio Aesthetic (Deep Slate & Emerald Token Architecture)
   ============================================================================== */

:root {
  --bg-canvas: #07090E;
  --bg-sidebar: #0B0F19;
  --bg-card: #0F1626;
  --bg-card-hover: #131C2D;
  --bg-input: #151F32;
  --bg-code: #0B0F17;
  
  --border-subtle: #182338;
  --border-card: #1E2B45;
  --border-focus: #38BDF8;

  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-accent: #34D399;

  --accent-emerald: #10B981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.15);
  --accent-sky: #38BDF8;
  --accent-sky-glow: rgba(56, 189, 248, 0.15);
  --accent-purple: #A855F7;
  --accent-amber: #F59E0B;
  --accent-rose: #F43F5E;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, sans-serif;
  --font-mono: Consolas, "SF Mono", "Cascadia Code", "Fira Code", monospace;

  --sidebar-w: 280px;
  --header-h: 64px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 30px rgba(16, 185, 129, 0.12);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
  color-scheme: dark;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ── Typography ──────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  color: #FFFFFF;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.65rem; margin-top: 2.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border-subtle); padding-bottom: 0.5rem; }
h3 { font-size: 1.25rem; margin-top: 1.75rem; margin-bottom: 0.75rem; color: #E2E8F0; }
h4 { font-size: 1.05rem; margin-top: 1.25rem; margin-bottom: 0.5rem; color: #CBD5E1; }

p { margin-bottom: 1.15rem; color: var(--text-secondary); }
a { color: var(--accent-sky); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: #7DD3FC; text-decoration: underline; }

strong { color: #F8FAFC; font-weight: 600; }
ul, ol { margin-left: 1.5rem; margin-bottom: 1.25rem; color: var(--text-secondary); }
li { margin-bottom: 0.4rem; }

/* ── App Layout ──────────────────────────────────────────────────────────── */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.sidebar-header {
  height: var(--header-h);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-card);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: 0.04em;
}

.brand-version {
  font-size: 0.7rem;
  color: var(--accent-emerald);
  font-family: var(--font-mono);
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 0.75rem;
}

.nav-group {
  margin-bottom: 1.5rem;
}

.nav-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 0 0.6rem 0.5rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  text-decoration: none !important;
}

.nav-link:hover {
  background-color: var(--bg-card);
  color: #FFFFFF;
}

.nav-link.active {
  background: linear-gradient(90deg, var(--accent-emerald-glow), transparent);
  color: var(--text-accent);
  border-left: 3px solid var(--accent-emerald);
  font-weight: 600;
}

.nav-link .icon {
  font-size: 1rem;
}

.sidebar-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* ── Main Layout & Header ────────────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-nav {
  height: var(--header-h);
  background-color: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
}

.menu-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-size: 1.25rem;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.search-box {
  position: relative;
  width: 340px;
}

.search-input {
  width: 100%;
  height: 36px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-sm);
  padding: 0 2rem 0 2.25rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input:focus {
  border-color: var(--accent-sky);
  box-shadow: 0 0 0 2px var(--accent-sky-glow);
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.btn-header {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.825rem;
  font-weight: 600;
  text-decoration: none !important;
  transition: all 0.15s ease;
}

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

.btn-ghost:hover {
  background-color: var(--bg-card);
  border-color: var(--border-focus);
}

.btn-primary {
  background-color: var(--accent-emerald);
  color: #051A10;
  border: none;
}

.btn-primary:hover {
  background-color: #34D399;
  box-shadow: 0 0 16px var(--accent-emerald-glow);
}

/* ── Content Container ───────────────────────────────────────────────────── */
.content-body {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 2rem 6rem;
  width: 100%;
}

/* ── Hero Section ────────────────────────────────────────────────────────── */
.hero {
  padding: 2rem 0 3rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2.5rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background-color: var(--accent-emerald-glow);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--text-accent);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  font-family: var(--font-mono);
}

.hero-title {
  font-size: 2.75rem;
  line-height: 1.15;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #FFFFFF 40%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 720px;
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 2rem;
}

.btn-lg {
  padding: 0.75rem 1.4rem;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  font-weight: 600;
}

/* ── Feature Bento Grid ──────────────────────────────────────────────────── */
.grid-bento {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
}

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  transform: translateY(-2px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-card);
}

.card-icon {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
  display: inline-block;
}

.card-title {
  font-size: 1.1rem;
  margin-bottom: 0.45rem;
  color: #FFFFFF;
}

.card-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ── Code Blocks & Tabs ──────────────────────────────────────────────────── */
.code-box {
  background-color: var(--bg-code);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  margin: 1.25rem 0;
  overflow: hidden;
  position: relative;
}

.code-header {
  background-color: #0E1420;
  padding: 0.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.code-lang {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.btn-copy {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  font-family: var(--font-sans);
}

.btn-copy:hover {
  background-color: var(--bg-card);
  color: #FFFFFF;
}

pre {
  padding: 1.15rem 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  color: #E2E8F0;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background-color: rgba(30, 43, 69, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  color: #38BDF8;
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: inherit;
}

/* ── Interactive Tabs ────────────────────────────────────────────────────── */
.tabs-container {
  margin: 1.5rem 0;
}

.tabs-nav {
  display: flex;
  gap: 0.4rem;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 0.35rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  color: #FFFFFF;
  background-color: var(--bg-card);
}

.tab-btn.active {
  background-color: var(--bg-card);
  color: var(--accent-emerald);
  border-bottom: 2px solid var(--accent-emerald);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* ── Callout Boxes ───────────────────────────────────────────────────────── */
.callout {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 1.35rem 0;
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  font-size: 0.9rem;
}

.callout p { margin-bottom: 0; color: inherit; }

.callout-info {
  background-color: var(--accent-sky-glow);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #BAE6FD;
}

.callout-tip {
  background-color: var(--accent-emerald-glow);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #A7F3D0;
}

.callout-warning {
  background-color: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #FDE68A;
}

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  text-align: left;
}

th {
  background-color: #0E1524;
  color: #F8FAFC;
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-card);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: rgba(255, 255, 255, 0.02);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.page-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

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

  .sidebar.open {
    transform: translateX(0);
  }

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

  .menu-toggle {
    display: block;
  }

  .search-box {
    width: 220px;
  }
}

@media (max-width: 640px) {
  .top-nav {
    padding: 0 1rem;
  }

  .search-box {
    display: none;
  }

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

  .content-body {
    padding: 1.5rem 1rem 4rem;
  }
}
