/**
 * SynX Documentation Navigation System
 * Dark Crimson Cyberpunk Theme
 * Professional SEO-Optimized Structure
 */

/* ====== CSS VARIABLES ====== */
:root {
    --docs-primary: #ff0033;
    --docs-primary-dark: #cc0033;
    --docs-primary-glow: rgba(255, 0, 51, 0.4);
    --docs-bg-dark: #0a0a0f;
    --docs-bg-sidebar: #0d0d14;
    --docs-bg-card: rgba(255, 0, 51, 0.03);
    --docs-text: #d8d8e8;
    --docs-text-muted: #8888a0;
    --docs-text-bright: #f0f0f8;
    --docs-border: rgba(255, 0, 51, 0.15);
    --docs-link: #ff6688;
    --docs-link-hover: #ff0033;
    --docs-success: #00cc66;
    --docs-warning: #ff9944;
    --docs-sidebar-width: 280px;
    --docs-header-height: 56px;
    --velvet-gradient: radial-gradient(ellipse at 30% 20%, #0a0812 0%, #050508 40%, #020204 100%);
}

/* ====== BODY & HTML RESET ====== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    background: #020204;
}

body, .docs-body {
    background: var(--velvet-gradient);
    background-attachment: fixed;
    color: var(--docs-text);
    font-family: 'Segoe UI', system-ui, sans-serif;
    line-height: 1.7;
    min-height: 100vh;
}

/* ====== TOP NAVIGATION HEADER ====== */
.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--docs-header-height);
    background: linear-gradient(180deg, #0d0d14 0%, #0a0a0f 100%);
    border-bottom: 1px solid var(--docs-border);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
}

.docs-header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-right: 40px;
}

.docs-header-logo .logo-symbol {
    font-size: 28px;
    color: var(--docs-primary);
    text-shadow: 0 0 15px var(--docs-primary-glow);
}

.docs-header-logo .logo-text {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--docs-text-bright);
    letter-spacing: 2px;
}

.docs-header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.docs-header-nav a {
    color: var(--docs-text-muted);
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.2s ease;
    letter-spacing: 0.5px;
}

.docs-header-nav a:hover {
    color: var(--docs-text-bright);
    background: var(--docs-bg-card);
}

.docs-header-nav a.active {
    color: var(--docs-primary);
    background: rgba(255, 0, 51, 0.1);
    text-shadow: 0 0 8px var(--docs-primary-glow);
}

.docs-header-search {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.docs-header-search input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--docs-border);
    border-radius: 4px;
    padding: 8px 14px;
    color: var(--docs-text);
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    width: 220px;
    transition: all 0.2s ease;
}

.docs-header-search input:focus {
    outline: none;
    border-color: var(--docs-primary);
    box-shadow: 0 0 10px var(--docs-primary-glow);
    width: 280px;
}

.docs-header-search input::placeholder {
    color: var(--docs-text-muted);
}

.docs-header-cta {
    margin-left: 20px;
}

.docs-header-cta a {
    display: inline-block;
    background: linear-gradient(135deg, var(--docs-primary), var(--docs-primary-dark));
    color: white;
    padding: 8px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    box-shadow: 0 0 15px var(--docs-primary-glow);
    transition: all 0.2s ease;
}

.docs-header-cta a:hover {
    box-shadow: 0 0 25px var(--docs-primary-glow);
    transform: translateY(-1px);
}

/* ====== LEFT SIDEBAR ====== */
.docs-sidebar {
    position: fixed;
    top: var(--docs-header-height);
    left: 0;
    width: var(--docs-sidebar-width);
    height: calc(100vh - var(--docs-header-height));
    background: var(--docs-bg-sidebar);
    border-right: 1px solid var(--docs-border);
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 999;
    transform: translateX(-240px);
    transition: transform 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--docs-primary) var(--docs-bg-dark);
}

.docs-sidebar::-webkit-scrollbar {
    width: 6px;
}

.docs-sidebar::-webkit-scrollbar-track {
    background: var(--docs-bg-dark);
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: var(--docs-primary);
    border-radius: 3px;
}

/* Expand on hover near left edge */
.docs-sidebar-trigger {
    position: fixed;
    top: var(--docs-header-height);
    left: 0;
    width: 50px;
    height: calc(100vh - var(--docs-header-height));
    z-index: 998;
}

.docs-sidebar-trigger:hover + .docs-sidebar,
.docs-sidebar:hover {
    transform: translateX(0);
}

/* Sidebar peek indicator */
.docs-sidebar-peek {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 40px;
    height: 80px;
    background: linear-gradient(90deg, rgba(255, 0, 51, 0.15), transparent);
    border-radius: 0 8px 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 997;
    cursor: pointer;
    transition: all 0.3s ease;
}

.docs-sidebar-peek::after {
    content: '›';
    font-size: 24px;
    color: var(--docs-primary);
    text-shadow: 0 0 10px var(--docs-primary-glow);
    animation: peekPulse 2s infinite;
}

@keyframes peekPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.docs-sidebar-trigger:hover ~ .docs-sidebar-peek,
.docs-sidebar:hover ~ .docs-sidebar-peek {
    opacity: 0;
    pointer-events: none;
}

/* Sidebar content */
.docs-sidebar-content {
    padding: 20px 15px;
}

.docs-sidebar-section {
    margin-bottom: 25px;
}

.docs-sidebar-section-title {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--docs-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 8px 12px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.docs-sidebar-section-title:hover {
    text-shadow: 0 0 8px var(--docs-primary-glow);
}

.docs-sidebar-section-title .toggle-icon {
    margin-left: auto;
    transition: transform 0.2s ease;
}

.docs-sidebar-section.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.docs-sidebar-section.collapsed .docs-sidebar-links {
    display: none;
}

.docs-sidebar-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-sidebar-links li {
    margin: 2px 0;
}

.docs-sidebar-links a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    color: var(--docs-text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 4px;
    transition: all 0.15s ease;
    border-left: 2px solid transparent;
}

.docs-sidebar-links a:hover {
    color: var(--docs-text-bright);
    background: var(--docs-bg-card);
    border-left-color: var(--docs-primary);
}

.docs-sidebar-links a.active {
    color: var(--docs-primary);
    background: rgba(255, 0, 51, 0.08);
    border-left-color: var(--docs-primary);
    font-weight: 600;
}

.docs-sidebar-links a .icon {
    margin-right: 10px;
    font-size: 14px;
    opacity: 0.7;
}

/* Whitepaper link - emphasized */
.docs-sidebar-links a.whitepaper-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--docs-text-bright);
}

/* Nested links (subcategories) */
.docs-sidebar-sublinks {
    list-style: none;
    padding: 0 0 0 20px;
    margin: 5px 0;
}

.docs-sidebar-sublinks a {
    font-size: 0.8rem;
    padding: 6px 12px;
}

/* Article count badge */
.docs-article-count {
    font-size: 0.65rem;
    background: rgba(255, 0, 51, 0.15);
    color: var(--docs-primary);
    padding: 2px 6px;
    border-radius: 10px;
    margin-left: auto;
}

/* ====== MAIN CONTENT AREA ====== */
.docs-main {
    margin-left: 50px;
    margin-top: var(--docs-header-height);
    padding: 40px;
    min-height: calc(100vh - var(--docs-header-height));
    transition: margin-left 0.3s ease;
    background: transparent;
}

.docs-article-wrapper {
    max-width: 900px;
    margin: 0 auto;
    background: rgba(10, 10, 15, 0.85);
    border: 1px solid var(--docs-border);
    border-radius: 12px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5), 0 0 80px rgba(255, 0, 51, 0.05);
    padding: 2.5rem 3rem;
}

.docs-sidebar:hover ~ .docs-main,
.docs-sidebar-trigger:hover ~ .docs-sidebar ~ .docs-main {
    margin-left: var(--docs-sidebar-width);
}

/* ====== BREADCRUMBS ====== */
.docs-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: var(--docs-text-muted);
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--docs-border);
}

.docs-breadcrumbs a {
    color: var(--docs-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

.docs-breadcrumbs a:hover {
    color: var(--docs-primary);
    text-shadow: 0 0 8px var(--docs-primary-glow);
}

.docs-breadcrumbs .separator {
    color: var(--docs-text-muted);
    opacity: 0.5;
}

.docs-breadcrumbs .current {
    color: var(--docs-text-bright);
}

/* ====== RIGHT SIDEBAR (ON THIS PAGE) ====== */
.docs-toc {
    position: fixed;
    top: calc(var(--docs-header-height) + 40px);
    right: 30px;
    width: 200px;
    font-size: 0.8rem;
}

.docs-toc-title {
    font-family: 'Courier New', monospace;
    font-size: 0.7rem;
    font-weight: bold;
    color: var(--docs-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--docs-border);
}

.docs-toc-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-toc-links li {
    margin: 6px 0;
}

.docs-toc-links a {
    color: var(--docs-text-muted);
    text-decoration: none;
    transition: all 0.15s ease;
    display: block;
    padding: 4px 0;
    border-left: 2px solid transparent;
    padding-left: 10px;
}

.docs-toc-links a:hover,
.docs-toc-links a.active {
    color: var(--docs-primary);
    border-left-color: var(--docs-primary);
}

/* ====== DOCS LANDING PAGE ====== */
.docs-hero {
    text-align: center;
    padding: 60px 40px;
    margin-bottom: 50px;
    background: var(--docs-bg-card);
    border: 1px solid var(--docs-border);
    border-radius: 12px;
}

.docs-hero h1 {
    font-family: 'Courier New', monospace;
    font-size: 2.5rem;
    color: var(--docs-text-bright);
    margin-bottom: 15px;
    text-shadow: 0 0 20px var(--docs-primary-glow);
}

.docs-hero .subtitle {
    font-size: 1.1rem;
    color: var(--docs-text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.docs-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin: 40px 0;
}

.docs-category-card {
    background: var(--docs-bg-card);
    border: 1px solid var(--docs-border);
    border-radius: 10px;
    padding: 25px;
    transition: all 0.2s ease;
}

.docs-category-card:hover {
    border-color: var(--docs-primary);
    box-shadow: 0 0 20px rgba(255, 0, 51, 0.1);
    transform: translateY(-2px);
}

.docs-category-card .card-icon {
    font-size: 32px;
    margin-bottom: 15px;
}

.docs-category-card h3 {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    color: var(--docs-text-bright);
    margin-bottom: 10px;
}

.docs-category-card p {
    font-size: 0.9rem;
    color: var(--docs-text-muted);
    line-height: 1.5;
    margin-bottom: 15px;
}

.docs-category-card .card-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.docs-category-card .card-links li {
    margin: 8px 0;
}

.docs-category-card .card-links a {
    color: var(--docs-link);
    text-decoration: none;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.15s ease;
}

.docs-category-card .card-links a:hover {
    color: var(--docs-primary);
}

.docs-category-card .card-links a::before {
    content: '→';
    font-size: 12px;
    opacity: 0.5;
}

/* ====== ARTICLE LISTING ====== */
.docs-article-list {
    list-style: none;
    padding: 0;
    margin: 30px 0;
}

.docs-article-item {
    display: flex;
    align-items: flex-start;
    padding: 20px;
    background: var(--docs-bg-card);
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    margin-bottom: 15px;
    transition: all 0.2s ease;
}

.docs-article-item:hover {
    border-color: var(--docs-primary);
    box-shadow: 0 0 15px rgba(255, 0, 51, 0.08);
}

.docs-article-item .article-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--docs-primary), var(--docs-primary-dark));
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 0.9rem;
    margin-right: 20px;
    flex-shrink: 0;
}

.docs-article-item .article-content h4 {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    color: var(--docs-text-bright);
    margin-bottom: 6px;
}

.docs-article-item .article-content h4 a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.docs-article-item .article-content h4 a:hover {
    color: var(--docs-primary);
}

.docs-article-item .article-content p {
    color: var(--docs-text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 0;
}

.docs-article-item .article-meta {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--docs-text-muted);
}

.docs-article-item .article-tag {
    background: rgba(255, 0, 51, 0.1);
    color: var(--docs-primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ====== SEARCH RESULTS ====== */
.docs-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--docs-bg-sidebar);
    border: 1px solid var(--docs-border);
    border-radius: 0 0 8px 8px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 1001;
}

.docs-search-results.active {
    display: block;
}

.docs-search-results a {
    display: block;
    padding: 12px 16px;
    color: var(--docs-text);
    text-decoration: none;
    border-bottom: 1px solid var(--docs-border);
    font-size: 0.85rem;
}

.docs-search-results a:hover {
    background: var(--docs-bg-card);
    color: var(--docs-primary);
}

.docs-search-results .result-category {
    font-size: 0.7rem;
    color: var(--docs-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ====== MOBILE RESPONSIVE ====== */
@media (max-width: 1200px) {
    .docs-toc {
        display: none;
    }
}

@media (max-width: 992px) {
    .docs-header-nav {
        display: none;
    }
    
    .docs-sidebar {
        transform: translateX(-100%);
    }
    
    .docs-sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .docs-main {
        margin-left: 0;
        padding: 20px;
    }

    .footer {
        margin-left: 0;
    }
    
    .docs-mobile-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background: none;
        border: 1px solid var(--docs-border);
        border-radius: 4px;
        color: var(--docs-text);
        cursor: pointer;
        margin-right: 15px;
    }
}

@media (max-width: 768px) {
    .docs-header-search {
        display: none;
    }
    
    .docs-hero {
        padding: 40px 20px;
    }
    
    .docs-hero h1 {
        font-size: 1.8rem;
    }
    
    .docs-categories {
        grid-template-columns: 1fr;
    }
}

/* ====== FOOTER (centered, clears sidebar) ====== */
.footer {
    margin-left: 50px;
    transition: margin-left 0.3s ease;
    text-align: center;
    padding: 25px 40px;
    position: relative;
    z-index: 1;
}

.docs-sidebar:hover ~ .footer,
.docs-sidebar-trigger:hover ~ .docs-sidebar ~ .footer {
    margin-left: var(--docs-sidebar-width);
}

/* ====== PRINT STYLES ====== */
@media print {
    .docs-header,
    .docs-sidebar,
    .docs-sidebar-trigger,
    .docs-sidebar-peek,
    .docs-toc {
        display: none !important;
    }
    
    .docs-main {
        margin: 0 !important;
        padding: 20px !important;
    }
}
