/* ==========================================
   OVREX DOCS — Main Stylesheet
   ========================================== */

:root {
    --primary: #6c5ce7;
    --primary-light: #a29bfe;
    --accent: #00cec9;
    --accent-light: #81ecec;
    --glow: #6c5ce7;
    --glow-accent: #00cec9;

    --bg-body: #08080d;
    --bg-card: #111118;
    --bg-card-hover: #16161f;
    --bg-sidebar: #0b0b12;
    --bg-header: rgba(8, 8, 13, 0.85);
    --bg-code: #0d0d14;
    --bg-code-header: #151520;
    --bg-input: #111118;

    --border: #1e1e2a;
    --border-light: #2a2a3a;

    --text: #e2e2ea;
    --text-secondary: #7a7a8e;
    --text-muted: #4a4a5e;

    --radius: 12px;
    --radius-sm: 8px;
    --radius-xs: 6px;

    --header-height: 64px;
    --sidebar-width: 280px;

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html {
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-body);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 3px;
}

::selection {
    background: rgba(108, 92, 231, 0.3);
    color: #fff;
}

a {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent);
}

/* ==========================================
   GLOW EFFECTS
   ========================================== */

.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.15;
}

.glow-orb-1 {
    width: 600px;
    height: 600px;
    background: var(--primary);
    top: -200px;
    left: -200px;
    animation: glowFloat1 20s ease-in-out infinite;
}

.glow-orb-2 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    bottom: -150px;
    right: -150px;
    animation: glowFloat2 25s ease-in-out infinite;
}

.glow-orb-3 {
    width: 400px;
    height: 400px;
    background: var(--primary-light);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: glowFloat3 30s ease-in-out infinite;
    opacity: 0.08;
}

@keyframes glowFloat1 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(100px, 50px); }
    50% { transform: translate(50px, 100px); }
    75% { transform: translate(-50px, 50px); }
}

@keyframes glowFloat2 {
    0%, 100% { transform: translate(0, 0); }
    25% { transform: translate(-80px, -40px); }
    50% { transform: translate(-40px, -80px); }
    75% { transform: translate(40px, -40px); }
}

@keyframes glowFloat3 {
    0%, 100% { transform: translate(-50%, -50%) scale(1); }
    50% { transform: translate(-50%, -50%) scale(1.3); }
}

.glow-card {
    position: relative;
    overflow: hidden;
}

.glow-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg,
        rgba(108, 92, 231, 0.3),
        rgba(0, 206, 201, 0.1),
        rgba(108, 92, 231, 0.3));
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: opacity 0.3s;
    opacity: 0;
}

.glow-card:hover::before {
    opacity: 1;
}

.glow-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
        rgba(108, 92, 231, 0.06) 0%,
        transparent 50%
    );
    pointer-events: none;
    transition: opacity 0.3s;
    opacity: 0;
}

.glow-card:hover::after {
    opacity: 1;
}

/* ==========================================
   HEADER
   ========================================== */

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    flex-shrink: 0;
}

.logo:hover {
    color: var(--text);
}

.logo-icon {
    display: flex;
    filter: drop-shadow(0 0 8px rgba(108, 92, 231, 0.5));
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo-badge {
    font-size: 11px;
    font-weight: 500;
    color: var(--primary-light);
    background: rgba(108, 92, 231, 0.15);
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid rgba(108, 92, 231, 0.2);
}

.header-search {
    flex: 1;
    max-width: 480px;
    position: relative;
}

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

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

#searchInput {
    width: 100%;
    padding: 8px 12px 8px 38px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#searchInput:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

#searchInput::placeholder {
    color: var(--text-muted);
}

.search-kbd {
    position: absolute;
    right: 8px;
    padding: 2px 6px;
    font-size: 11px;
    font-family: var(--font-sans);
    color: var(--text-muted);
    background: var(--bg-code);
    border: 1px solid var(--border);
    border-radius: 4px;
    pointer-events: none;
}

/* SEARCH RESULTS */

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #13131d;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
    display: none;
    max-height: 420px;
    overflow-y: auto;
    z-index: 1001;
    padding: 6px;
}

.search-results.visible {
    display: block;
}

.search-result-item {
    display: block;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.15s;
    color: var(--text);
    text-decoration: none;
    margin-bottom: 2px;
}

.search-result-item:hover {
    background: rgba(108, 92, 231, 0.1);
    color: var(--text);
}

.search-result-item:last-child {
    margin-bottom: 0;
}

.search-result-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 6px;
    color: var(--primary-light);
}

.search-result-item:hover .search-result-title {
    color: var(--accent-light);
}

.search-result-snippet {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    word-break: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.search-result-empty {
    padding: 20px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.search-highlight {
    background: rgba(108, 92, 231, 0.25);
    color: #fff;
    border-radius: 3px;
    padding: 1px 4px;
    font-weight: 500;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--text);
}

.github-link {
    display: flex;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.github-link:hover {
    opacity: 1;
    color: var(--text);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    padding: 4px;
}

/* ==========================================
   SIDEBAR
   ========================================== */

.main-wrapper {
    display: flex;
    padding-top: var(--header-height);
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 100;
}

.sidebar-inner {
    padding: 24px 16px;
}

.sidebar-section {
    margin-bottom: 28px;
}

.sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 8px;
}

.sidebar-icon {
    font-size: 14px;
}

.sidebar-list {
    list-style: none;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: var(--radius-xs);
    transition: all 0.15s;
}

.sidebar-link:hover {
    color: var(--text);
    background: rgba(108, 92, 231, 0.08);
}

.sidebar-link.active {
    color: var(--primary-light);
    background: rgba(108, 92, 231, 0.12);
    font-weight: 500;
    box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-page-icon {
    font-size: 13px;
    opacity: 0.7;
}

/* ==========================================
   CONTENT
   ========================================== */

.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
}

.doc-article {
    max-width: 820px;
    margin: 0 auto;
    padding: 48px 48px 120px;
}

.doc-heading {
    position: relative;
    margin: 2em 0 0.8em;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.3;
}

.doc-heading:first-child {
    margin-top: 0;
}

h1.doc-heading {
    font-size: 2.2em;
    background: linear-gradient(135deg, var(--text), var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2.doc-heading {
    font-size: 1.6em;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

h3.doc-heading { font-size: 1.3em; }
h4.doc-heading { font-size: 1.1em; }

.heading-anchor {
    position: absolute;
    left: -24px;
    color: var(--text-muted);
    font-weight: 400;
    opacity: 0;
    transition: opacity 0.2s;
}

.doc-heading:hover .heading-anchor {
    opacity: 1;
}

.doc-article p {
    margin: 0 0 1em;
    color: var(--text-secondary);
    font-size: 15.5px;
}

.doc-article strong {
    color: var(--text);
    font-weight: 600;
}

.doc-article ul,
.doc-article ol {
    margin: 0 0 1em;
    padding-left: 24px;
    color: var(--text-secondary);
}

.doc-article li {
    margin-bottom: 6px;
    font-size: 15px;
}

.doc-article code {
    font-family: var(--font-mono);
    font-size: 0.88em;
    background: var(--bg-code);
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid var(--border);
    color: var(--primary-light);
}

/* ==========================================
   CODE BLOCKS
   ========================================== */

.code-block {
    margin: 1.5em 0;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--bg-code);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: var(--bg-code-header);
    border-bottom: 1px solid var(--border);
}

.code-lang {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-copy {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-family: var(--font-sans);
    font-size: 12px;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all 0.2s;
}

.code-copy:hover {
    color: var(--text);
    border-color: var(--border-light);
    background: rgba(255, 255, 255, 0.03);
}

.code-copy.copied {
    color: var(--accent);
    border-color: var(--accent);
}

.code-block pre {
    margin: 0;
    padding: 16px;
    overflow-x: auto;
}

.code-block code {
    font-family: var(--font-mono);
    font-size: 13.5px;
    line-height: 1.6;
    background: none;
    padding: 0;
    border: none;
    color: var(--text);
}

/* ==========================================
   TABLES
   ========================================== */

.table-wrapper {
    margin: 1.5em 0;
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: var(--bg-code-header);
}

th {
    padding: 10px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

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

tr:hover td {
    background: rgba(108, 92, 231, 0.04);
}

/* ==========================================
   CALLOUTS
   ========================================== */

.callout {
    margin: 1.5em 0;
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--primary);
    background: rgba(108, 92, 231, 0.06);
}

.callout-warning {
    border-left-color: #fdcb6e;
    background: rgba(253, 203, 110, 0.06);
}

.callout-info {
    border-left-color: var(--accent);
    background: rgba(0, 206, 201, 0.06);
}

.callout-tip {
    border-left-color: #55efc4;
    background: rgba(85, 239, 196, 0.06);
}

.callout p {
    margin: 0;
}

/* ==========================================
   HERO (HOME)
   ========================================== */

.home {
    width: 100%;
}

.hero {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--header-height));
    padding: 80px 24px;
    text-align: center;
}

.hero-glow {
    position: absolute;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle,
        rgba(108, 92, 231, 0.15) 0%,
        rgba(0, 206, 201, 0.05) 40%,
        transparent 70%);
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
}

.hero-content {
    position: relative;
    max-width: 700px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-light);
    background: rgba(108, 92, 231, 0.1);
    border: 1px solid rgba(108, 92, 231, 0.2);
    border-radius: 24px;
    margin-bottom: 24px;
}

.badge-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.hero-title {
    font-size: 4em;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1.1;
    margin-bottom: 20px;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 36px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 48px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: all 0.25s;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #5a4bd1);
    box-shadow: 0 4px 20px rgba(108, 92, 231, 0.3);
}

.btn-primary:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(108, 92, 231, 0.4);
}

.btn-secondary {
    color: var(--text);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    color: var(--text);
    border-color: var(--border-light);
    background: var(--bg-card-hover);
}

.hero-install {
    max-width: 520px;
    margin: 0 auto;
    text-align: left;
}

.code-block-hero {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

/* ==========================================
   FEATURES
   ========================================== */

.features {
    padding: 40px 24px 100px;
}

.features-grid {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    padding: 28px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-light);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    font-size: 28px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 17px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.feature-card p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ==========================================
   FOOTER
   ========================================== */

.doc-footer {
    border-top: 1px solid var(--border);
    margin-top: 60px;
}

.footer-inner {
    max-width: 820px;
    margin: 0 auto;
    padding: 24px 48px;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
}

.footer-sep {
    margin: 0 8px;
    opacity: 0.3;
}

/* ==========================================
   ERROR PAGE
   ========================================== */

.error-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - var(--header-height));
    text-align: center;
    width: 100%;
}

.error-code {
    font-size: 8em;
    font-weight: 900;
    letter-spacing: -4px;
    line-height: 1;
    margin-bottom: 16px;
}

.error-message {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.error-hint {
    color: var(--text-muted);
    margin-bottom: 32px;
}

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }

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

    .content {
        margin-left: 0;
    }

    .doc-article {
        padding: 24px 20px 80px;
    }

    .mobile-menu-btn {
        display: block;
    }

    .header-nav {
        display: none;
    }

    .header-search {
        display: none;
    }

    .hero-title {
        font-size: 2.5em;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding: 24px 20px;
    }
}

.hljs {
    background: transparent !important;
}

.hljs-keyword,
.hljs-selector-tag,
.hljs-literal,
.hljs-section,
.hljs-link {
    color: #c792ea;
}

.hljs-function .hljs-keyword {
    color: #c792ea;
}

.hljs-string,
.hljs-attr,
.hljs-addition {
    color: #c3e88d;
}

.hljs-number,
.hljs-literal {
    color: #f78c6c;
}

.hljs-built_in,
.hljs-builtin-name,
.hljs-type,
.hljs-params {
    color: #ffcb6b;
}

.hljs-title,
.hljs-title.class_,
.hljs-title.function_ {
    color: #82aaff;
}

.hljs-comment,
.hljs-quote,
.hljs-deletion,
.hljs-meta {
    color: #546e7a;
    font-style: italic;
}

.hljs-variable,
.hljs-template-variable {
    color: #f07178;
}

.hljs-tag {
    color: #f07178;
}

.hljs-name {
    color: #f07178;
}

.hljs-tag .hljs-attr {
    color: #c792ea;
}

.hljs-tag .hljs-string {
    color: #c3e88d;
}

.hljs-attribute {
    color: #c792ea;
}

.hljs-symbol,
.hljs-bullet {
    color: #89ddff;
}

.hljs-subst {
    color: #e2e2ea;
}

.hljs-regexp {
    color: #89ddff;
}

.hljs-selector-class {
    color: #ffcb6b;
}

.hljs-selector-id {
    color: #82aaff;
}

.hljs-property {
    color: #f07178;
}

.hljs-punctuation {
    color: #89ddff;
}

.hljs-operator {
    color: #89ddff;
}