/* ═══════════════════════════════════════════════════════════════════════════
   ABYSSAL — Documentation & Knowledge Base Stylesheet (docs.css)
   Clean, modern, responsive layout & typography for Docs, FAQ, and Command Dir.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
    --abyss-bg: #07080b;
    --abyss-surface: #0d0f18;
    --abyss-card: rgba(18, 20, 28, 0.75);
    --abyss-card-hover: rgba(26, 29, 42, 0.85);
    --abyss-border: rgba(255, 255, 255, 0.08);
    --abyss-border-subtle: rgba(255, 255, 255, 0.04);
    --abyss-accent: #6366f1;
    --abyss-accent-glow: rgba(99, 102, 241, 0.25);
    --abyss-text-primary: #f3f4f6;
    --abyss-text-secondary: #9ca3af;
    --abyss-text-muted: #6b7280;
    --sidebar-width: 280px;
    --header-height: 64px;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--abyss-bg);
    color: var(--abyss-text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Font helpers */
.font-outfit { font-family: 'Outfit', sans-serif; }
.font-mono { font-family: 'JetBrains Mono', monospace; }

/* ── Sticky Header & Navbar ─────────────────────────────────────────────── */
.docs-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(8, 9, 14, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--abyss-border);
    padding: 0 24px;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

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

.docs-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.docs-brand img {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.docs-nav-links {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-left: 24px;
}

.docs-nav-links a {
    color: var(--abyss-text-secondary);
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s;
    letter-spacing: -0.01em;
}

.docs-nav-links a:hover,
.docs-nav-links a.active {
    color: #ffffff;
}

.docs-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ── Master Docs Layout (Grid) ──────────────────────────────────────────── */
.docs-layout-container {
    max-width: 1380px;
    width: 100%;
    margin: 0 auto;
    padding: 36px 24px 64px;
    display: grid;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
    flex: 1;
}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.docs-sidebar {
    width: var(--sidebar-width);
    position: sticky;
    top: calc(var(--header-height) + 24px);
    max-height: calc(100vh - var(--header-height) - 48px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 12px;
}

.docs-sidebar::-webkit-scrollbar {
    width: 4px;
}
.docs-sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.sidebar-section-title {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #818cf8;
    padding: 14px 12px 6px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--abyss-text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.sidebar-link i {
    width: 18px;
    text-align: center;
    font-size: 13px;
}

.sidebar-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-link.active {
    color: #c7d2fe;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.15);
    border-color: rgba(99, 102, 241, 0.3);
}

/* ── Main Content Area ──────────────────────────────────────────────────── */
.docs-content {
    min-width: 0;
    width: 100%;
}

.docs-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--abyss-text-muted);
    margin-bottom: 20px;
}

.docs-breadcrumbs a {
    color: var(--abyss-text-secondary);
    transition: color 0.2s;
}

.docs-breadcrumbs a:hover {
    color: #ffffff;
}

.docs-article {
    background: var(--abyss-card);
    border: 1px solid var(--abyss-border);
    border-radius: 20px;
    padding: 40px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

@media (max-width: 768px) {
    .docs-article {
        padding: 24px 18px;
        border-radius: 14px;
    }
}

/* ── Typography in Article ──────────────────────────────────────────────── */
.docs-article h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-bottom: 12px;
}

.docs-article h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
    margin-top: 36px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.docs-article h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #f3f4f6;
    margin-top: 24px;
    margin-bottom: 8px;
}

.docs-article p {
    color: #d1d5db;
    font-size: 0.925rem;
    line-height: 1.7;
    margin-bottom: 16px;
}

.docs-article p strong {
    color: #ffffff;
}

.docs-article ul, .docs-article ol {
    margin-left: 20px;
    margin-bottom: 20px;
    color: #d1d5db;
    font-size: 0.925rem;
    line-height: 1.7;
}

.docs-article li {
    margin-bottom: 6px;
}

/* ── Interactive Components ─────────────────────────────────────────────── */
.cmd-box {
    background: #090b12;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 10px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0 16px;
    transition: border-color 0.2s;
}

.cmd-box:hover {
    border-color: rgba(99, 102, 241, 0.4);
}

.cmd-box code {
    color: #a5b4fc;
    word-break: break-all;
}

.copy-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #9ca3af;
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.copy-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    color: #ffffff;
    border-color: rgba(99, 102, 241, 0.5);
}

.step-badge {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #a5b4fc;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    font-family: 'Outfit', sans-serif;
}

.badge-subtle {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 10px;
    border-radius: 9999px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.card-feature {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 18px;
    transition: all 0.2s ease;
}

.card-feature:hover {
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(255, 255, 255, 0.04);
}

/* Callout Boxes */
.callout-info {
    background: rgba(99, 102, 241, 0.08);
    border-left: 3px solid #6366f1;
    border-radius: 0 10px 10px 0;
    padding: 14px 18px;
    margin: 18px 0;
    font-size: 0.9rem;
    color: #d1d5db;
}

.callout-warning {
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid #f59e0b;
    border-radius: 0 10px 10px 0;
    padding: 14px 18px;
    margin: 18px 0;
    font-size: 0.9rem;
    color: #fde68a;
}

/* ── FAQ Page Layout & Accordion ────────────────────────────────────────── */
.faq-container {
    max-width: 960px;
    width: 100%;
    margin: 0 auto;
    padding: 48px 24px 80px;
    flex: 1;
}

.faq-hero {
    text-align: center;
    margin-bottom: 40px;
}

.faq-hero h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.75rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    margin-top: 12px;
    margin-bottom: 12px;
}

.faq-hero p {
    color: var(--abyss-text-secondary);
    font-size: 1.05rem;
    max-width: 620px;
    margin: 0 auto;
}

.faq-item {
    background: var(--abyss-card);
    border: 1px solid var(--abyss-border);
    border-radius: 14px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.faq-item:hover {
    border-color: rgba(99, 102, 241, 0.35);
}

.faq-question-btn {
    width: 100%;
    padding: 18px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    text-align: left;
    font-weight: 600;
    font-size: 15px;
    color: #ffffff;
    background: none;
    border: none;
    cursor: pointer;
}

.faq-answer-content {
    padding: 0 22px 20px;
    color: #d1d5db;
    font-size: 0.925rem;
    line-height: 1.7;
}

/* ── Full Utility Helper Polyfill (so templates with Tailwind classes work perfectly) ── */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.grid { display: grid; }
.block { display: block; }
.hidden { display: none; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }
.min-w-0 { min-width: 0; }
.w-full { width: 100%; }

.gap-1\.5 { gap: 6px; }
.gap-2 { gap: 8px; }
.gap-2\.5 { gap: 10px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-8 { gap: 32px; }

.space-y-1 > * + * { margin-top: 4px; }
.space-y-1\.5 > * + * { margin-top: 6px; }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-6 > * + * { margin-top: 24px; }
.space-y-8 > * + * { margin-top: 32px; }

.space-x-2 > * + * { margin-left: 8px; }
.space-x-3 > * + * { margin-left: 12px; }
.space-x-5 > * + * { margin-left: 20px; }
.space-x-6 > * + * { margin-left: 24px; }

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

/* Responsive Grid & Flex */
@media (min-width: 640px) {
    .sm\:flex-row { flex-direction: row; }
    .sm\:items-center { align-items: center; }
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .sm\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .sm\:text-3xl { font-size: 1.875rem; }
    .sm\:text-4xl { font-size: 2.25rem; }
    .sm\:text-5xl { font-size: 3rem; }
    .sm\:inline-block { display: inline-block; }
}

@media (min-width: 768px) {
    .md\:flex { display: flex; }
    .md\:flex-row { flex-direction: row; }
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:w-64 { width: 16rem; }
}

/* Padding & Margin */
.p-2\.5 { padding: 10px; }
.p-3 { padding: 12px; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.p-6 { padding: 24px; }
.px-3 { padding-left: 12px; padding-right: 12px; }
.px-3\.5 { padding-left: 14px; padding-right: 14px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.px-5 { padding-left: 20px; padding-right: 20px; }
.px-6 { padding-left: 24px; padding-right: 24px; }
.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-1\.5 { padding-top: 6px; padding-bottom: 6px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-2\.5 { padding-top: 10px; padding-bottom: 10px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.py-8 { padding-top: 32px; padding-bottom: 32px; }
.py-12 { padding-top: 48px; padding-bottom: 48px; }
.pb-2 { padding-bottom: 8px; }
.pb-6 { padding-bottom: 24px; }
.pt-2 { padding-top: 8px; }
.pt-3 { padding-top: 12px; }
.pt-4 { padding-top: 16px; }
.pt-6 { padding-top: 24px; }
.pl-9 { padding-left: 36px; }
.pr-3 { padding-right: 12px; }

.mb-2 { margin-bottom: 8px; }
.mb-6 { margin-bottom: 24px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-6 { margin-top: 24px; }
.mt-12 { margin-top: 48px; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Text sizes & weights */
.text-\[10px\] { font-size: 10px; }
.text-\[11px\] { font-size: 11px; }
.text-xs { font-size: 12px; }
.text-sm { font-size: 14px; }
.text-base { font-size: 16px; }
.text-lg { font-size: 18px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }
.text-3xl { font-size: 30px; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.uppercase { text-transform: uppercase; }
.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }
.leading-relaxed { line-height: 1.625; }
.text-center { text-align: center; }

/* Colors */
.text-white { color: #ffffff; }
.text-black { color: #000000; }
.text-gray-300 { color: #d1d5db; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-indigo-300 { color: #a5b4fc; }
.text-indigo-400 { color: #818cf8; }
.text-amber-400 { color: #fbbf24; }
.text-yellow-400 { color: #facc15; }
.text-cyan-400 { color: #22d3ee; }
.text-rose-400 { color: #fb7185; }
.text-emerald-400 { color: #34d399; }
.text-purple-400 { color: #c084fc; }
.text-blue-400 { color: #60a5fa; }
.text-green-400 { color: #4ade80; }

/* Backgrounds */
.bg-white { background-color: #ffffff; }
.bg-white\/5 { background-color: rgba(255, 255, 255, 0.05); }
.bg-white\/\[0\.02\] { background-color: rgba(255, 255, 255, 0.02); }
.bg-white\/\[0\.03\] { background-color: rgba(255, 255, 255, 0.03); }
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.1); }
.bg-indigo-500\/10 { background-color: rgba(99, 102, 241, 0.1); }
.bg-indigo-500\/20 { background-color: rgba(99, 102, 241, 0.2); }
.bg-indigo-600\/10 { background-color: rgba(79, 70, 229, 0.1); }
.bg-indigo-600\/15 { background-color: rgba(79, 70, 229, 0.15); }
.bg-purple-600\/10 { background-color: rgba(147, 51, 234, 0.1); }
.bg-purple-500\/10 { background-color: rgba(168, 85, 247, 0.1); }
.bg-purple-500\/20 { background-color: rgba(168, 85, 247, 0.2); }
.bg-cyan-500\/10 { background-color: rgba(6, 182, 212, 0.1); }
.bg-cyan-500\/20 { background-color: rgba(6, 182, 212, 0.2); }
.bg-rose-500\/10 { background-color: rgba(244, 63, 94, 0.1); }
.bg-rose-500\/20 { background-color: rgba(244, 63, 94, 0.2); }
.bg-amber-500\/20 { background-color: rgba(245, 158, 11, 0.2); }
.bg-yellow-500\/10 { background-color: rgba(234, 179, 8, 0.1); }
.bg-yellow-500\/20 { background-color: rgba(234, 179, 8, 0.2); }
.bg-emerald-500\/10 { background-color: rgba(16, 185, 129, 0.1); }
.bg-blue-500\/10 { background-color: rgba(59, 130, 246, 0.1); }
.bg-blue-500\/20 { background-color: rgba(59, 130, 246, 0.2); }

/* Borders & Radius */
.border { border-width: 1px; border-style: solid; border-color: rgba(255, 255, 255, 0.1); }
.border-b { border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgba(255, 255, 255, 0.08); }
.border-t { border-top-width: 1px; border-top-style: solid; border-top-color: rgba(255, 255, 255, 0.08); }
.border-white\/5 { border-color: rgba(255, 255, 255, 0.05); }
.border-white\/10 { border-color: rgba(255, 255, 255, 0.1); }
.border-indigo-500\/20 { border-color: rgba(99, 102, 241, 0.2); }
.border-indigo-500\/30 { border-color: rgba(99, 102, 241, 0.3); }
.border-purple-500\/20 { border-color: rgba(168, 85, 247, 0.2); }
.border-cyan-500\/20 { border-color: rgba(6, 182, 212, 0.2); }
.border-rose-500\/20 { border-color: rgba(244, 63, 94, 0.2); }
.border-emerald-500\/20 { border-color: rgba(16, 185, 129, 0.2); }
.border-yellow-500\/20 { border-color: rgba(234, 179, 8, 0.2); }
.border-blue-500\/20 { border-color: rgba(59, 130, 246, 0.2); }

.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.rounded-full { border-radius: 9999px; }

/* Transitions & Hovers */
.transition-all { transition: all 0.2s ease; }
.transition-colors { transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease; }
.transition-transform { transition: transform 0.2s ease; }

.hover\:bg-white\/5:hover { background-color: rgba(255, 255, 255, 0.05); }
.hover\:bg-white\/10:hover { background-color: rgba(255, 255, 255, 0.1); }
.hover\:bg-gray-200:hover { background-color: #e5e7eb; }
.hover\:text-white:hover { color: #ffffff; }
.hover\:text-indigo-400:hover { color: #818cf8; }

/* Focus */
.focus\:outline-none:focus { outline: none; }
.focus\:border-indigo-500:focus { border-color: #6366f1; }

/* Responsive adjustments */
@media (max-width: 1024px) {
    .docs-layout-container {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 24px 16px;
    }
    .docs-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        padding-right: 0;
    }
    .docs-nav-links {
        display: none;
    }
}
