/* ReasonKit Documentation Theme
 * Unified with main site design system
 * https://reasonkit.sh
 */

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

:root {
    /* ReasonKit Brand Colors */
    --rk-bg-void: #030508;
    --rk-bg-deep: #0a0d14;
    --rk-bg-card: #0f1419;
    --rk-bg-surface: #141a22;
    --rk-cyan: #06b6d4;
    --rk-purple: #a855f7;
    --rk-pink: #ec4899;
    --rk-green: #10b981;
    --rk-orange: #f97316;
    --rk-yellow: #eab308;
    --rk-text: #f8fbff;
    --rk-text-secondary: #e5e7eb;
    --rk-text-dim: #9ca3af;
    --rk-border: rgba(6, 182, 212, 0.2);
    --rk-border-accent: rgba(6, 182, 212, 0.4);

    /* Gradients */
    --rk-gradient: linear-gradient(135deg, #06b6d4 0%, #a855f7 50%, #ec4899 100%);
    --rk-glow: 0 0 20px rgba(6, 182, 212, 0.3);
    --rk-glow-strong: 0 0 40px rgba(6, 182, 212, 0.4);

    /* Typography */
    --font-heading: 'Space Grotesk', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ===== UNIFIED HEADER BAR ===== */
/* Matches main site nav: padding-based height, same proportions */
.rk-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(3, 5, 8, 0.8);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--rk-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    z-index: 1000;
    font-family: var(--font-heading);
}

.rk-header-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--rk-text);
    font-weight: 800;
    font-size: 1.5rem;
    background: var(--rk-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: opacity 0.2s;
}

.rk-header-logo:hover {
    opacity: 0.85;
}

.rk-header-logo svg {
    width: 36px;
    height: 36px;
}

.rk-header-nav {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.rk-header-nav a {
    color: var(--rk-text-dim);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 0;
    position: relative;
}

.rk-header-nav a:hover {
    color: var(--rk-cyan);
}

.rk-header-nav a.active {
    color: var(--rk-cyan);
}

.rk-header-nav a.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--rk-gradient);
    border-radius: 2px;
}

/* Offset content for fixed header */
html {
    padding-top: 70px !important;
}

.sidebar {
    top: 70px !important;
    height: calc(100vh - 70px) !important;
}

.menu-bar {
    top: 70px !important;
}

@media (max-width: 768px) {
    .rk-header {
        padding: 0 1rem;
    }
    .rk-header-nav {
        display: none;
    }
}

/* ===== AYU THEME OVERRIDES ===== */
.ayu {
    --bg: var(--rk-bg-deep);
    --fg: var(--rk-text-secondary);
    --sidebar-bg: var(--rk-bg-void);
    --sidebar-fg: var(--rk-text-dim);
    --sidebar-active: var(--rk-cyan);
    --sidebar-spacer: var(--rk-border);
    --scrollbar: var(--rk-bg-card);
    --icons: var(--rk-cyan);
    --icons-hover: var(--rk-purple);
    --links: var(--rk-cyan);
    --inline-code-color: var(--rk-pink);
    --theme-popup-bg: var(--rk-bg-card);
    --theme-popup-border: var(--rk-border);
    --theme-hover: var(--rk-bg-void);
    --quote-bg: var(--rk-bg-card);
    --quote-border: var(--rk-cyan);
    --table-border-color: var(--rk-border);
    --table-header-bg: var(--rk-bg-card);
    --table-alternate-bg: rgba(6, 182, 212, 0.03);
    --searchbar-border-color: var(--rk-border);
    --searchbar-bg: var(--rk-bg-card);
    --searchbar-fg: var(--rk-text);
    --searchbar-shadow: var(--rk-glow);
    --searchresults-header-fg: var(--rk-cyan);
    --searchresults-border-color: var(--rk-border);
    --searchresults-li-bg: var(--rk-bg-card);
    --search-mark-bg: rgba(6, 182, 212, 0.3);
}

/* ===== BASE STYLES ===== */
html {
    font-family: var(--font-body);
    scroll-behavior: smooth;
}

body {
    background: var(--rk-bg-deep);
}

/* ===== SIDEBAR ===== */
.sidebar {
    background: var(--rk-bg-void);
    border-right: 1px solid var(--rk-border);
    font-family: var(--font-body);
}

.sidebar .sidebar-scrollbox {
    padding: 1.5rem 1rem;
}

/* Sidebar title/logo area */
.sidebar .chapter li.part-title {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--rk-text-dim);
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    padding: 0 0.5rem;
}

.sidebar .chapter li.part-title:first-child {
    margin-top: 0;
}

.sidebar a {
    color: var(--rk-text-dim);
    font-size: 0.9rem;
    font-weight: 450;
    transition: all 0.2s ease;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin: 0.125rem 0;
    display: block;
}

.sidebar a:hover {
    color: var(--rk-cyan);
    background: rgba(6, 182, 212, 0.08);
    text-decoration: none;
}

.sidebar li.chapter-item.expanded > a,
.sidebar a.active {
    color: var(--rk-cyan);
    background: rgba(6, 182, 212, 0.12);
    font-weight: 600;
}

/* Nested items */
.sidebar .section li {
    padding-left: 1rem;
}

.sidebar .section li a {
    font-size: 0.85rem;
    padding: 0.4rem 0.75rem;
}

/* ===== MENU BAR ===== */
.menu-bar {
    background: var(--rk-bg-void);
    border-bottom: 1px solid var(--rk-border);
}

.menu-bar i {
    color: var(--rk-cyan);
}

.menu-bar i:hover {
    color: var(--rk-purple);
}

.menu-bar .left-buttons button,
.menu-bar .right-buttons button {
    color: var(--rk-text-dim);
}

.menu-bar .left-buttons button:hover,
.menu-bar .right-buttons button:hover {
    color: var(--rk-cyan);
}

/* ===== MAIN CONTENT ===== */
.content {
    max-width: 920px;
    padding: 2.5rem 3rem;
    font-family: var(--font-body);
}

.content main {
    color: var(--rk-text-secondary);
    line-height: 1.7;
}

/* Headings */
.content h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--rk-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    border-bottom: 2px solid var(--rk-border);
    padding-bottom: 0.75rem;
    margin-bottom: 1.75rem;
    margin-top: 0;
}

.content h2 {
    font-family: var(--font-heading);
    color: var(--rk-cyan);
    font-size: 1.75rem;
    font-weight: 600;
    margin-top: 3rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--rk-border);
    padding-bottom: 0.5rem;
}

.content h3 {
    font-family: var(--font-heading);
    color: var(--rk-purple);
    font-size: 1.35rem;
    font-weight: 600;
    margin-top: 2.25rem;
    margin-bottom: 0.75rem;
}

.content h4 {
    font-family: var(--font-heading);
    color: var(--rk-pink);
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1.75rem;
    margin-bottom: 0.5rem;
}

.content h5, .content h6 {
    font-family: var(--font-heading);
    color: var(--rk-text);
    font-weight: 600;
}

/* Paragraphs */
.content p {
    margin: 1rem 0;
    line-height: 1.75;
}

/* Links */
.content a {
    color: var(--rk-cyan);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.content a:hover {
    color: var(--rk-purple);
    border-bottom-color: var(--rk-purple);
}

/* ===== CODE BLOCKS ===== */
.content pre {
    background: var(--rk-bg-void) !important;
    border: 1px solid var(--rk-border-accent);
    border-radius: 10px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    box-shadow: var(--rk-glow);
    overflow-x: auto;
}

.content pre:hover {
    box-shadow: var(--rk-glow-strong);
    border-color: var(--rk-cyan);
}

.content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.content :not(pre) > code {
    background: var(--rk-bg-card);
    color: var(--rk-pink);
    padding: 0.2em 0.5em;
    border-radius: 5px;
    border: 1px solid var(--rk-border);
    font-size: 0.88em;
}

/* Code block header (language indicator) */
.content pre code {
    background: transparent;
    border: none;
    padding: 0;
}

/* ===== TABLES ===== */
.content table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5rem 0;
    border: 1px solid var(--rk-border);
    border-radius: 10px;
    overflow: hidden;
}

.content th {
    background: var(--rk-bg-card);
    color: var(--rk-cyan);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    text-align: left;
    padding: 0.875rem 1rem;
    border-bottom: 2px solid var(--rk-border-accent);
}

.content td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--rk-border);
    vertical-align: top;
}

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

.content tr:nth-child(even) {
    background: rgba(6, 182, 212, 0.03);
}

.content tr:hover {
    background: rgba(6, 182, 212, 0.08);
}

/* ===== BLOCKQUOTES ===== */
.content blockquote {
    background: var(--rk-bg-card);
    border-left: 4px solid var(--rk-cyan);
    border-radius: 0 10px 10px 0;
    padding: 1.25rem 1.5rem;
    margin: 1.75rem 0;
    color: var(--rk-text-dim);
}

.content blockquote p {
    margin: 0;
    font-style: italic;
}

.content blockquote code {
    background: var(--rk-bg-surface);
}

/* ===== LISTS ===== */
.content ul, .content ol {
    margin: 1rem 0;
    padding-left: 1.75rem;
}

.content li {
    margin: 0.5rem 0;
    line-height: 1.7;
}

.content li::marker {
    color: var(--rk-cyan);
}

.content li > p {
    margin: 0.25rem 0;
}

/* Nested lists */
.content li ul, .content li ol {
    margin: 0.5rem 0;
}

/* ===== HORIZONTAL RULES ===== */
.content hr {
    border: none;
    height: 2px;
    background: var(--rk-gradient);
    margin: 2.5rem 0;
    opacity: 0.4;
    border-radius: 2px;
}

/* ===== NAVIGATION BUTTONS ===== */
.nav-chapters {
    font-family: var(--font-heading);
    font-size: 0.95rem;
}

.nav-chapters a {
    color: var(--rk-cyan) !important;
    padding: 0.875rem 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--rk-border);
    transition: all 0.2s ease;
    background: var(--rk-bg-card);
}

.nav-chapters a:hover {
    background: rgba(6, 182, 212, 0.1);
    border-color: var(--rk-cyan);
    box-shadow: var(--rk-glow);
}

/* ===== SEARCH ===== */
#searchbar {
    font-family: var(--font-body);
    background: var(--rk-bg-card);
    border: 1px solid var(--rk-border);
    border-radius: 8px;
    color: var(--rk-text);
    padding: 0.5rem 1rem;
}

#searchbar:focus {
    border-color: var(--rk-cyan);
    box-shadow: var(--rk-glow);
    outline: none;
}

#searchbar::placeholder {
    color: var(--rk-text-dim);
}

.searchresults-header {
    color: var(--rk-cyan);
    font-family: var(--font-heading);
}

.searchresults-outer li {
    background: var(--rk-bg-card);
    border: 1px solid var(--rk-border);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.searchresults-outer li:hover {
    border-color: var(--rk-cyan);
}

/* ===== THEME POPUP ===== */
#theme-list {
    background: var(--rk-bg-card);
    border: 1px solid var(--rk-border);
    border-radius: 10px;
    overflow: hidden;
}

#theme-list button {
    color: var(--rk-text);
    font-family: var(--font-body);
}

#theme-list button:hover {
    background: rgba(6, 182, 212, 0.1);
    color: var(--rk-cyan);
}

/* ===== SPECIAL CALLOUTS ===== */
/* Info boxes */
.content .warning {
    background: rgba(234, 179, 8, 0.1);
    border-left: 4px solid var(--rk-yellow);
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

.content .info {
    background: rgba(6, 182, 212, 0.1);
    border-left: 4px solid var(--rk-cyan);
    padding: 1rem 1.5rem;
    border-radius: 0 8px 8px 0;
    margin: 1.5rem 0;
}

/* ===== THINKTOOL INDICATORS ===== */
/* Color coding for ThinkTool documentation */
.content h1:contains("GigaThink"),
.content h2:contains("GigaThink") {
    border-color: var(--rk-yellow);
}

.content h1:contains("LaserLogic"),
.content h2:contains("LaserLogic") {
    border-color: var(--rk-cyan);
}

.content h1:contains("BedRock"),
.content h2:contains("BedRock") {
    border-color: var(--rk-orange);
}

.content h1:contains("ProofGuard"),
.content h2:contains("ProofGuard") {
    border-color: var(--rk-green);
}

.content h1:contains("BrutalHonesty"),
.content h2:contains("BrutalHonesty") {
    border-color: var(--rk-pink);
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .content {
        padding: 1.5rem 1rem;
    }

    .content h1 {
        font-size: 2rem;
    }

    .content h2 {
        font-size: 1.5rem;
    }

    .content h3 {
        font-size: 1.2rem;
    }

    .content pre {
        padding: 1rem;
        font-size: 0.85rem;
    }

    .content table {
        font-size: 0.9rem;
    }

    .nav-chapters a {
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }
}

/* ===== PRINT STYLES ===== */
@media print {
    .rk-header,
    .sidebar,
    .nav-chapters,
    .menu-bar {
        display: none !important;
    }

    html {
        padding-top: 0 !important;
    }

    .content {
        max-width: 100%;
        padding: 0;
    }

    .content h1 {
        -webkit-text-fill-color: #06b6d4;
        color: #06b6d4;
    }

    .content pre {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

/* ===== SELECTION ===== */
::selection {
    background: rgba(6, 182, 212, 0.3);
    color: var(--rk-text);
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--rk-bg-void);
}

::-webkit-scrollbar-thumb {
    background: var(--rk-bg-card);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--rk-border-accent);
}
