/* ==================== DOCS SUBDOMAIN - GITBOOK STYLE ==================== */

:root {
    /* Purple documentation color scheme */
    --primary-color: #7c3aed;
    --primary-dark: #6d28d9;
    --primary-light: #8b5cf6;
    --secondary-color: #a855f7;
    --accent-color: #06b6d4;
    
    /* Background colors */
    --bg-dark: #0f0d1e;
    --bg-darker: #0a0815;
    --bg-card: #1a1635;
    --bg-sidebar: #13102a;
    --bg-code: #1e1b3a;
    
    /* Text colors */
    --text-primary: #ffffff;
    --text-secondary: #c4b5fd;
    --text-muted: #9ca3af;
    --text-code: #e879f9;
    
    /* Borders */
    --border-color: rgba(124, 58, 237, 0.2);
    --border-hover: rgba(124, 58, 237, 0.4);
    
    /* Gradients */
    --gradient-1: linear-gradient(135deg, #7c3aed, #a855f7);
    --gradient-2: linear-gradient(135deg, #6d28d9, #06b6d4);
    
    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(124, 58, 237, 0.1);
    --shadow-md: 0 4px 16px rgba(124, 58, 237, 0.2);
    --shadow-lg: 0 8px 32px rgba(124, 58, 237, 0.3);
    
    /* Sizes */
    --header-height: 70px;
    --sidebar-width: 280px;
    --toc-width: 220px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
}

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

/* ==================== HEADER ==================== */
.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: rgba(15, 13, 30, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.header-container {
    height: 100%;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.sidebar-toggle {
    display: none;
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--primary-color);
    color: white;
}

.docs-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-text .highlight {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.docs-badge {
    padding: 0.25rem 0.75rem;
    background: var(--gradient-1);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.search-box input {
    width: 300px;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

.admin-link,
.home-link {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: var(--transition);
}

.admin-link:hover,
.home-link:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

/* ==================== DOCS CONTAINER ==================== */
.docs-container {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* ==================== SIDEBAR ==================== */
.docs-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    position: fixed;
    left: 0;
    height: calc(100vh - var(--header-height));
    transition: var(--transition);
}

.sidebar-content {
    padding: 2rem 0;
}

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

.category-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.category-sections {
    margin-top: 0.5rem;
}

.section-group {
    margin-bottom: 0.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.section-header:hover {
    background: rgba(124, 58, 237, 0.1);
    color: var(--primary-color);
}

.section-toggle {
    font-size: 0.75rem;
    transition: transform 0.3s ease;
}

.section-group.collapsed .section-toggle {
    transform: rotate(-90deg);
}

.section-group.collapsed .subsection-list {
    max-height: 0;
    overflow: hidden;
}

.subsection-list {
    max-height: 1000px;
    transition: max-height 0.3s ease;
}

.subsection-link {
    display: block;
    padding: 0.625rem 1.5rem 0.625rem 2.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
}

.subsection-link::before {
    content: '';
    position: absolute;
    left: 1.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition);
}

.subsection-link:hover {
    color: var(--primary-color);
    background: rgba(124, 58, 237, 0.05);
}

.subsection-link:hover::before {
    background: var(--primary-color);
    transform: translateY(-50%) scale(1.5);
}

.subsection-link.active {
    color: var(--primary-color);
    background: rgba(124, 58, 237, 0.1);
    font-weight: 600;
}

.subsection-link.active::before {
    background: var(--primary-color);
    width: 3px;
    height: 20px;
    border-radius: 2px;
}

/* ==================== MAIN CONTENT ==================== */
.docs-main {
    margin-left: var(--sidebar-width);
    margin-right: var(--toc-width);
    flex: 1;
    padding: 2rem 3rem;
    max-width: calc(100% - var(--sidebar-width) - var(--toc-width));
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: var(--text-secondary);
    transition: var(--transition);
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumbs a.active {
    color: var(--text-primary);
    font-weight: 600;
}

.breadcrumbs i {
    color: var(--text-muted);
    font-size: 0.7rem;
}

/* ==================== DOCS CONTENT ==================== */
.docs-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 3rem;
    min-height: 70vh;
}

/* Markdown Rendered Content */
.docs-content h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    line-height: 1.2;
}

.docs-content h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.docs-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.docs-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.docs-content h5 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

.docs-content h6 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.docs-content p {
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
}

.docs-content strong {
    color: var(--text-primary);
    font-weight: 700;
}

.docs-content em {
    color: var(--text-secondary);
    font-style: italic;
}

.docs-content code {
    background: var(--bg-code);
    color: var(--text-code);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    border: 1px solid var(--border-color);
}

.docs-content pre {
    background: var(--bg-code);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    overflow-x: auto;
    position: relative;
}

.docs-content pre code {
    background: transparent;
    border: none;
    padding: 0;
    color: #e4e4e7;
    display: block;
    line-height: 1.6;
}

.docs-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-color: rgba(124, 58, 237, 0.3);
    text-underline-offset: 3px;
    transition: var(--transition);
}

.docs-content a:hover {
    text-decoration-color: var(--primary-color);
    color: var(--primary-light);
}

.docs-content ul,
.docs-content ol {
    margin: 1.25rem 0;
    padding-left: 2rem;
    color: var(--text-secondary);
}

.docs-content ul {
    list-style-type: disc;
}

.docs-content ol {
    list-style-type: decimal;
}

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

.docs-content li::marker {
    color: var(--primary-color);
}

.docs-content blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: rgba(124, 58, 237, 0.05);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
}

.docs-content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.docs-content thead {
    background: rgba(124, 58, 237, 0.1);
}

.docs-content th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.docs-content td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

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

.docs-content tr:hover {
    background: rgba(124, 58, 237, 0.03);
}

.docs-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
}

.docs-content hr {
    margin: 2rem 0;
    border: none;
    height: 1px;
    background: var(--border-color);
}

/* ==================== TABLE OF CONTENTS ==================== */
.toc-sidebar {
    width: var(--toc-width);
    position: fixed;
    right: 0;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    overflow-y: auto;
    padding: 2rem 1.5rem;
    border-left: 1px solid var(--border-color);
}

.toc-header {
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.toc-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toc-link {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    border-left: 2px solid var(--border-color);
    transition: var(--transition);
}

.toc-link:hover {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    background: rgba(124, 58, 237, 0.05);
}

.toc-link.active {
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.toc-link.level-2 {
    padding-left: 1rem;
}

.toc-link.level-3 {
    padding-left: 1.5rem;
    font-size: 0.85rem;
}

/* ==================== CALLOUTS / ALERTS ==================== */
.callout {
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
    border-radius: 8px;
    border-left: 4px solid;
    display: flex;
    gap: 1rem;
}

.callout-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.callout-content p:last-child {
    margin-bottom: 0;
}

.callout.info {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
}

.callout.info .callout-icon {
    color: #3b82f6;
}

.callout.warning {
    background: rgba(245, 158, 11, 0.1);
    border-color: #f59e0b;
}

.callout.warning .callout-icon {
    color: #f59e0b;
}

.callout.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.callout.error .callout-icon {
    color: #ef4444;
}

.callout.success {
    background: rgba(16, 185, 129, 0.1);
    border-color: #10b981;
}

.callout.success .callout-icon {
    color: #10b981;
}

/* ==================== COPY BUTTON FOR CODE BLOCKS ==================== */
.code-block-wrapper {
    position: relative;
}

.copy-code-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.5rem 1rem;
    background: rgba(124, 58, 237, 0.2);
    border: 1px solid var(--primary-color);
    border-radius: 6px;
    color: var(--primary-color);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-code-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1200px) {
    .toc-sidebar {
        display: none;
    }
    
    .docs-main {
        margin-right: 0;
        max-width: calc(100% - var(--sidebar-width));
    }
}

@media (max-width: 968px) {
    .sidebar-toggle {
        display: flex;
    }
    
    .search-box input {
        width: 200px;
    }
    
    .docs-sidebar {
        transform: translateX(-100%);
    }
    
    .docs-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
        z-index: 999;
    }
    
    .docs-main {
        margin-left: 0;
        max-width: 100%;
        padding: 2rem 1.5rem;
    }
    
    .docs-content {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 640px) {
    .header-container {
        padding: 0 1rem;
    }
    
    .search-box {
        display: none;
    }
    
    .docs-content {
        padding: 1.5rem 1rem;
    }
    
    .docs-content h1 {
        font-size: 2rem;
    }
    
    .docs-content h2 {
        font-size: 1.5rem;
    }
    
    .docs-content pre {
        padding: 1rem;
        font-size: 0.85rem;
    }
}

/* ==================== SCROLLBAR STYLING ==================== */
.docs-sidebar::-webkit-scrollbar,
.toc-sidebar::-webkit-scrollbar {
    width: 6px;
}

.docs-sidebar::-webkit-scrollbar-track,
.toc-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb,
.toc-sidebar::-webkit-scrollbar-thumb {
    background: rgba(124, 58, 237, 0.3);
    border-radius: 3px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover,
.toc-sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(124, 58, 237, 0.5);
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.docs-content {
    animation: fadeIn 0.4s ease;
}
