/**
 * Orange Glass Design System
 * Aesthetic: Technical, Sharp, Glassy, Fancy & Simple
 * FIXED: Navbar rendering and horizontal scroll issues
 */

:root {
    /* Dimensions */
    --docs-sidebar-width: 260px;
    --docs-toc-width: 240px;
    --docs-max-width: 1440px;
    --header-height: 64px;

    /* Colors - Orange Theme */
    --primary: #FF6600;
    /* Vibrant Orange */
    --primary-dim: rgba(255, 102, 0, 0.15);
    --primary-glow: rgba(255, 102, 0, 0.4);

    --bg-body: #0a0a0a;
    --bg-glass: rgba(20, 20, 20, 0.7);
    --bg-card: rgba(255, 255, 255, 0.03);

    --border: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(255, 102, 0, 0.5);

    --text: #e5e5e5;
    --text-muted: #a3a3a3;

    --font-heading: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Space Mono', 'Fira Code', monospace;

    /* Effects */
    --blur: blur(12px);
    --radius: 0px;
    /* Sharp edges as requested */
    --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Light Mode Overrides (if toggled) */
[data-theme="light"] {
    --bg-body: #f5f5f5;
    --bg-glass: rgba(255, 255, 255, 0.8);
    --bg-card: rgba(0, 0, 0, 0.03);
    --border: rgba(0, 0, 0, 0.1);
    --text: #171717;
    --text-muted: #525252;
}

/* Theme-based logo visibility */
.light-only {
    display: block;
}

.dark-only {
    display: none;
}

[data-theme="light"] .light-only {
    display: block;
}

[data-theme="light"] .dark-only {
    display: none;
}

[data-theme="dark"] .light-only,
:root:not([data-theme="light"]) .light-only {
    display: none;
}

[data-theme="dark"] .dark-only,
:root:not([data-theme="light"]) .dark-only {
    display: block;
}

/* Global Reset & Typography */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 15px;
    /* Slightly compact */
}

body {
    background-color: var(--bg-body);
    color: var(--text);
    font-family: var(--font-heading);
    line-height: 1.6;
    letter-spacing: -0.01em;
    margin: 0;
    padding: 0;
}

code,
pre {
    font-family: var(--font-mono);
}

/* Layout Container */
.docs-container {
    max-width: var(--docs-max-width);
    margin: var(--header-height) auto 0;
    display: flex;
    min-height: calc(100vh - var(--header-height));
    width: 100%;
    /* NOTE: Do NOT use overflow-x: hidden here - it breaks position: sticky */
}

/* ===== GLASSY HEADER ===== */
.header.docs-header {
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--bg-glass) !important;
    backdrop-filter: var(--blur);
    border-bottom: 1px solid var(--border) !important;
    z-index: 1001 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    max-width: 100% !important;
    display: block !important;
}

.docs-header .container {
    height: 100%;
    max-width: var(--docs-max-width) !important;
    padding: 0 24px !important;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Navbar - FIXED */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    gap: 32px;
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.logo img {
    height: 32px;
    width: auto;
}

/* Navigation Links - Clean & Sharp - FIXED */
.nav-links {
    display: flex;
    list-style: none;
    gap: 4px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links li {
    list-style: none;
}

.nav-links a {
    display: inline-block;
    border-radius: var(--radius) !important;
    font-size: 0.85rem !important;
    padding: 8px 16px !important;
    color: var(--text-muted) !important;
    border: 1px solid transparent;
    font-weight: 500 !important;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    background: var(--primary-dim) !important;
    color: var(--primary) !important;
    border-color: var(--primary-glow) !important;
}

/* Header Actions - FIXED */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    background: var(--bg-card);
    color: var(--primary);
    border-color: var(--primary);
}

/* Buttons (Dashboard, Login) */
.btn-dashboard {
    background: var(--primary) !important;
    color: #fff !important;
    border-radius: var(--radius) !important;
    font-size: 0.85rem !important;
    padding: 8px 20px !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600 !important;
    box-shadow: none !important;
    border: 1px solid var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: var(--transition);
}

.btn-dashboard:hover {
    background: transparent !important;
    color: var(--primary) !important;
    transform: none !important;
    box-shadow: 0 0 15px var(--primary-glow) !important;
}

/* Icon Button (for mobile) */
.btn-icon {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    text-decoration: none;
}

.btn-icon:hover {
    background: var(--bg-card);
    color: var(--primary);
    border-color: var(--primary);
}

/* Mobile-only visibility */
.mobile-only {
    display: none;
}

/* ===== SIDEBAR (Sharp & Minimal) ===== */
.docs-sidebar {
    width: var(--docs-sidebar-width);
    position: sticky;
    top: var(--header-height);
    align-self: flex-start;
    /* Critical for sticky behavior */
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
    overflow-x: hidden;
    padding: 32px 16px;
    border-right: 1px solid var(--border);
    background: transparent !important;
    box-shadow: none !important;
    flex-shrink: 0;
}

/* Custom Scrollbar for Sidebar */
.docs-sidebar::-webkit-scrollbar {
    width: 6px;
}

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

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

.docs-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Override legacy .sidebar-nav if it exists in HTML */
.docs-sidebar .sidebar-nav {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    margin: 0 !important;
}

.nav-group-toggle {
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--radius);
    margin-bottom: 2px;
    transition: var(--transition);
}

.nav-group-toggle .nav-chevron {
    transition: transform 0.3s ease;
    font-size: 0.7rem;
}

.nav-group-toggle:hover {
    color: var(--text);
    background: var(--bg-card);
    border-color: var(--border);
}

.nav-group-pages {
    display: none;
    padding: 4px 0 12px 0;
    margin-left: 12px;
    border-left: 1px solid var(--border);
}

.nav-group-pages.expanded {
    display: block;
}

.nav-group-pages li {
    list-style: none;
}

.nav-group-pages li a {
    display: block;
    padding: 6px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-decoration: none;
    border-left: 2px solid transparent;
    margin-left: -1px;
    transition: var(--transition);
}

.nav-group-pages li a:hover {
    color: var(--primary);
    background: linear-gradient(90deg, var(--primary-dim) 0%, transparent 100%);
}

.nav-group-pages li a.active {
    color: var(--primary);
    border-left-color: var(--primary);
    background: linear-gradient(90deg, var(--primary-dim) 0%, transparent 100%);
    font-weight: 600;
}

/* Sub-navigation items for detailed endpoints */
.nav-sub-items {
    list-style: none;
    padding: 4px 0 4px 16px;
    margin: 4px 0 0 0;
    border-left: 1px dashed var(--border);
    margin-left: 15px;
}

.nav-sub-items li {
    margin: 0;
}

.nav-sub-items .nav-sub-link {
    display: block;
    padding: 4px 12px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: none;
    transition: var(--transition);
    opacity: 0.8;
}

.nav-sub-items .nav-sub-link:hover {
    color: var(--primary);
    opacity: 1;
    background: linear-gradient(90deg, rgba(255, 102, 0, 0.1) 0%, transparent 100%);
}

/* Sidebar Help (Minimal Techy) */
.sidebar-help {
    margin-top: 40px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.sidebar-help h4 {
    color: var(--primary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-help p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.sidebar-help a {
    font-size: 0.8rem;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--primary);
    padding-bottom: 2px;
    transition: var(--transition);
}

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

/* Sidebar Product Selector (Mobile) */
.sidebar-product-selector {
    display: none;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.sidebar-product-dropdown,
.product-dropdown {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23ff6600' stroke-width='2.5'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 44px;
}

.sidebar-product-dropdown:hover,
.product-dropdown:hover {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.sidebar-product-dropdown:focus,
.product-dropdown:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

[data-theme="dark"] .sidebar-product-dropdown,
[data-theme="dark"] .product-dropdown {
    background-color: rgba(30, 30, 30, 0.95);
}

[data-theme="dark"] .sidebar-product-dropdown option,
[data-theme="dark"] .product-dropdown option {
    background: #1a1a1a;
}

/* Coins logo icon styling */
.coins-logo-icon {
    width: 20px;
    height: 20px;
    display: block;
}

/* Style for option text with icons */
.sidebar-product-dropdown option,
.product-dropdown option {
    padding: 12px 16px;
    background: var(--bg-card);
    color: var(--text);
    font-weight: 500;
}

/* Product type badges/pills for visual enhancement */
.product-type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-type-badge.loyalty {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
}

.product-type-badge.stamps {
    background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
    color: #fff;
}

.product-type-badge.cashback {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
}

.product-type-badge.coins {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
    color: #fff;
}

/* Coins logo styling */
.coins-logo-small {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    display: inline-block;
}

/* ===== MAIN CONTENT ===== */
.docs-content-wrapper {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    /* NOTE: Do NOT use overflow-x: hidden here - it breaks position: sticky */
}

.docs-main {
    flex: 1;
    /* NOTE: Do NOT use overflow-x: hidden here - it breaks position: sticky */
}

.docs-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px;
    width: 100%;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    background: linear-gradient(90deg, #fff, #aaa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-theme="light"] .page-title {
    background: linear-gradient(90deg, #000, #555);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-description {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    font-weight: 300;
}

/* ===== CONTENT TYPOGRAPHY ===== */
.docs-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin: 48px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    scroll-margin-top: calc(var(--header-height) + 24px);
}

.docs-content h2:first-of-type {
    margin-top: 0;
}

.docs-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 32px 0 12px 0;
    scroll-margin-top: calc(var(--header-height) + 24px);
}

.docs-content h4 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    margin: 24px 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.docs-content p {
    margin-bottom: 16px;
    color: var(--text);
    line-height: 1.7;
}

.docs-content ul,
.docs-content ol {
    margin: 16px 0 24px 0;
    padding-left: 24px;
}

.docs-content li {
    margin-bottom: 8px;
    color: var(--text);
    line-height: 1.6;
}

.docs-content code {
    background: var(--primary-dim);
    color: var(--primary);
    padding: 2px 6px;
    font-size: 0.85rem;
    font-family: var(--font-mono);
}

.docs-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: var(--transition);
}

.docs-content a:hover {
    border-bottom-color: var(--primary);
}

/* Step Guides (Techy Line) */
.steps-container {
    margin: 32px 0 48px 0;
    position: relative;
    border-left: 2px solid var(--border);
    padding-left: 0;
}

.step-item {
    position: relative;
    margin-bottom: 32px;
    padding-left: 48px;
}

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

/* Step Number - Prominent Orange Circle/Square */
.step-number {
    position: absolute;
    left: -17px;
    top: 0;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--primary-glow);
    border: 2px solid var(--primary);
}

/* Step Title - Highlighted with Primary Color */
.step-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary);
    letter-spacing: -0.01em;
}

.step-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

/* endpoint Cards */
.endpoint-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
    transition: var(--transition);
}

.endpoint-header {
    background: var(--bg-glass);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.method-badge {
    border-radius: var(--radius);
    padding: 4px 10px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.method-badge.get {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.method-badge.post {
    background: var(--primary-dim);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.endpoint-path {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 8px;
    border-radius: var(--radius);
    word-break: break-all;
}

.endpoint-body {
    padding: 24px;
}

/* Code Blocks */
pre {
    background: #000 !important;
    border: 1px solid var(--border);
    border-radius: var(--radius) !important;
    padding: 24px !important;
    overflow-x: auto;
    max-width: 100%;
}

/* ===== TABLES ===== */
table,
.docs-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

table thead,
.docs-table thead {
    background: var(--bg-glass);
}

table th,
.docs-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

table td,
.docs-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    vertical-align: top;
}

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

table tr:hover,
.docs-table tr:hover {
    background: var(--primary-dim);
}

table code,
.docs-table code {
    background: var(--primary-dim);
    color: var(--primary);
    padding: 2px 6px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

/* Card Grid (Square, Glassy) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin: 32px 0;
}

.nav-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 32px;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-card:hover {
    border-color: var(--primary);
    background: var(--primary-dim);
}

.nav-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-card-description {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* TOC */
.docs-toc {
    width: var(--docs-toc-width);
    position: sticky;
    top: var(--header-height);
    align-self: flex-start;
    /* Critical for sticky behavior */
    max-height: calc(100vh - var(--header-height));
    padding: 40px 24px;
    border-left: 1px solid var(--border);
    font-size: 0.85rem;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
}

/* Custom Scrollbar for TOC */
.docs-toc::-webkit-scrollbar {
    width: 6px;
}

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

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

.docs-toc::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.toc-title {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 0.75rem;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin: 8px 0;
}

.toc-list a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
    display: block;
    padding-left: 12px;
    border-left: 2px solid transparent;
}

.toc-list a:hover,
.toc-list a.active {
    color: var(--primary);
    border-left-color: var(--primary);
}

/* Footer */
.docs-footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: auto;
    font-size: 0.9rem;
}

.footer-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 48px;
    width: 100%;
}

.footer-nav {
    display: flex;
    justify-content: space-between;
    margin-bottom: 32px;
}

.footer-prev a,
.footer-next a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 12px 24px;
    transition: var(--transition);
    background: var(--bg-card);
}

.footer-prev a:hover,
.footer-next a:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.footer-logo img {
    height: 24px;
    width: auto;
}

.footer-logo span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

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

/* ===== DIAGRAMS & IMAGES ===== */
.diagram-container {
    width: 100%;
    margin: 24px 0;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.docs-diagram {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* ===== MOBILE MENU TOGGLE ===== */
.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    border-radius: var(--radius);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    background: var(--bg-card);
    color: var(--primary);
    border-color: var(--primary);
}

/* Mobile Overlay for Sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
}

/* ===== TOC FAB (Mobile) ===== */
.toc-fab {
    display: none;
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 1002;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.toc-fab:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px var(--primary-glow);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== PRICING PAGE ===== */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 32px 0;
}

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.pricing-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 4px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    font-weight: 600;
    border: 1px solid var(--border);
}

.card-header {
    padding: 24px;
    border-bottom: 1px solid var(--border);
    text-align: center;
    background: linear-gradient(to bottom, var(--surface) 0%, transparent 100%);
}

.tier-name {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 700;
}

.tier-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    color: var(--primary);
}

.tier-price .currency {
    font-size: 1rem;
    margin-right: 2px;
}

.tier-price .amount {
    font-size: 2rem;
    font-weight: 700;
}

.tier-price .period {
    color: var(--text-muted);
    margin-left: 4px;
    font-size: 0.9rem;
}

.card-body {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.feature-list {
    margin-bottom: 24px;
    flex: 1;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.feature-item i {
    color: var(--primary);
    width: 20px;
    text-align: center;
}

.feature-item strong {
    color: var(--text);
}

.tier-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    margin: 0;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
}

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

/* Large screens: Hide TOC by default, show as modal when active */
@media (max-width: 1200px) {
    .docs-toc {
        display: none;
        /* Mobile Modal Styles */
        position: fixed;
        bottom: 90px;
        right: 24px;
        width: 260px;
        max-height: 50vh;
        top: auto;
        /* Reset sticky top */
        z-index: 1002;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
        padding: 24px;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        overflow-y: auto;
    }

    .docs-toc.active {
        display: block;
        animation: slideUp 0.3s ease forwards;
    }

    .toc-fab {
        display: flex;
    }
}

/* Medium screens: Narrow sidebar */
@media (max-width: 1024px) {
    .docs-sidebar {
        width: 220px;
    }

    .docs-content {
        padding: 40px 32px;
    }

    .footer-inner {
        padding: 0 32px;
    }
}

/* Tablet: Collapsible sidebar */
@media (max-width: 900px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .mobile-only {
        display: flex;
    }

    .nav-links {
        display: none;
    }

    .sidebar-product-selector {
        display: block;
    }

    .docs-container {
        display: block;
    }

    .docs-sidebar {
        position: fixed;
        top: var(--header-height);
        left: 0;
        width: 280px;
        height: calc(100% - var(--header-height));
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        background: var(--bg-body) !important;
        border-right: 1px solid var(--border);
    }

    .docs-sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block;
        pointer-events: none;
    }

    .sidebar-overlay.active {
        pointer-events: auto;
    }

    .docs-content-wrapper {
        width: 100%;
    }

    .docs-content {
        padding: 32px 24px;
        max-width: 100%;
    }

    .footer-inner {
        padding: 0 24px;
    }

    .page-title {
        font-size: 2rem;
    }
}

/* Mobile phones */
@media (max-width: 640px) {
    :root {
        --header-height: 56px;
    }

    .docs-header .container {
        padding: 0 16px !important;
    }

    .logo img {
        height: 26px;
    }

    .header-actions {
        gap: 8px;
    }

    .theme-toggle,
    .mobile-menu-toggle,
    .btn-icon {
        width: 36px;
        height: 36px;
    }

    /* Dashboard icon-only on mobile */
    .btn-dashboard {
        padding: 0 !important;
        width: 36px;
        height: 36px;
        justify-content: center;
    }

    .btn-dashboard span {
        display: none;
    }

    .docs-sidebar {
        width: 260px;
    }

    .docs-content {
        padding: 24px 16px;
    }

    .page-title {
        font-size: 1.6rem;
        margin-bottom: 12px;
    }

    .page-description {
        font-size: 1rem;
        margin-bottom: 24px;
    }

    .docs-content h2 {
        font-size: 1.3rem;
        margin: 32px 0 12px 0;
    }

    .docs-content h3 {
        font-size: 1rem;
    }

    /* Card Grid */
    .card-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .nav-card {
        padding: 20px;
    }

    /* Endpoint Cards */
    .endpoint-header {
        padding: 12px 16px;
        flex-direction: column;
        align-items: flex-start;
    }

    .endpoint-body {
        padding: 16px;
    }

    .endpoint-path {
        font-size: 0.8rem;
        word-break: break-all;
    }

    /* Code Blocks */
    pre {
        padding: 16px !important;
        font-size: 0.8rem;
    }

    /* Tables */
    table,
    .docs-table {
        font-size: 0.8rem;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    table th,
    .docs-table th,
    table td,
    .docs-table td {
        padding: 10px 12px;
        white-space: nowrap;
    }

    /* Steps */
    .step-item {
        padding-left: 36px;
    }

    .step-number {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
        left: -15px;
    }

    .step-title {
        font-size: 1.05rem;
    }

    /* Footer */
    .docs-footer {
        padding: 24px 0;
    }

    .footer-inner {
        padding: 0 16px;
    }

    .footer-nav {
        flex-direction: column;
        gap: 12px;
        margin-bottom: 24px;
    }

    .footer-prev,
    .footer-next {
        width: 100%;
    }

    .footer-prev a,
    .footer-next a {
        width: 100%;
        justify-content: center;
        padding: 10px 16px;
    }

    .footer-content {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .footer-logo {
        flex-direction: column;
        gap: 8px;
    }

    .footer-links {
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
    }
    
}
.plugins-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.plugin-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0;
    overflow: hidden;
    transition: var(--transition);
    position: relative;
}

.plugin-card:hover {
    border-color: var(--primary);
    box-shadow: 0 0 30px var(--primary-glow);
    transform: translateY(-4px);
}

.plugin-card-header {
    padding: 20px;
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
}

.plugin-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-dim);
    border: 1px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.plugin-icon i {
    font-size: 20px;
    color: var(--primary);
}

.plugin-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 4px 0;
}

.plugin-info .platform {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

.plugin-card-body {
    padding: 20px;
}

.plugin-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.plugin-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.meta-badge i {
    color: var(--primary);
    font-size: 0.7rem;
}

.version-badge {
    background: var(--primary-dim);
    border-color: var(--primary);
    color: var(--primary);
    font-weight: 600;
}

.plugin-requirements {
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    margin-bottom: 16px;
}

[data-theme="light"] .plugin-requirements {
    background: rgba(0, 0, 0, 0.03);
}

.plugin-requirements h4 {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin: 0 0 6px 0;
}

.plugin-requirements p {
    font-size: 0.8rem;
    color: var(--text);
    margin: 0;
    font-family: var(--font-mono);
}

.plugin-actions {
    display: flex;
    gap: 10px;
}

.btn-download {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--primary);
    color: #fff !important;
    border: 1px solid var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-download i {
    color: #fff !important;
}

.btn-download:hover {
    background: transparent;
    color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
}

.btn-docs {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
}

.btn-docs:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.unavailable-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.unavailable-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
    background: var(--bg-card);
    border: 1px dashed var(--border);
}

.empty-state i {
    font-size: 40px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 1.2rem;
    color: var(--text);
    margin-bottom: 10px;
}

.empty-state p {
    color: var(--text-muted);
}

.plugins-footer-note {
    text-align: center;
    padding: 30px;
    margin-top: 40px;
    border-top: 1px solid var(--border);
}

.plugins-footer-note p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.plugins-footer-note a {
    color: var(--primary);
    text-decoration: none;
}

.plugins-footer-note a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .plugins-grid {
        grid-template-columns: 1fr;
    }

    .plugin-actions {
        flex-direction: column;
    }
}
/* Extra small phones */
@media (max-width: 380px) {
    .docs-sidebar {
        width: 100%;
    }
}
/* =============================================
   SEARCH MODAL - Spotlight Style "Jump To"
   ============================================= */

.search-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 99999; /* Higher than docs header */
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.search-overlay.open {
    display: flex;
    opacity: 1;
}

.search-modal {
    width: 600px;
    max-width: 90vw;
    background: #121212;
    background: linear-gradient(145deg, rgba(20, 20, 20, 0.98), rgba(10, 10, 10, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 
                0 0 0 1px rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0.98);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.search-overlay.open .search-modal {
    transform: scale(1);
}

[data-theme="light"] .search-modal {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* Header & Input */
.search-header {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .search-header {
    border-bottom-color: rgba(0, 0, 0, 0.05);
}

.search-icon {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-right: 12px;
}

.search-header input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 1.1rem;
    outline: none;
    font-family: var(--font-heading);
}

.search-esc {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .search-esc {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}

/* Results List */
.search-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 8px 0;
}

.search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    cursor: pointer;
    border-left: 3px solid transparent;
    transition: background 0.1s ease;
    text-decoration: none;
    color: var(--text-muted);
}

.search-item:hover, 
.search-item.active {
    background: rgba(255, 255, 255, 0.03);
    border-left-color: var(--primary);
}

[data-theme="light"] .search-item:hover, 
[data-theme="light"] .search-item.active {
    background: rgba(0, 0, 0, 0.03);
}

.search-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    overflow: hidden;
}

.search-item-title {
    font-weight: 500;
    color: var(--text);
    font-size: 0.95rem;
}

.search-item-path {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item:hover .search-item-title,
.search-item.active .search-item-title {
    color: var(--primary);
}

/* Empty State */
.search-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.search-empty .empty-icon {
    font-size: 2rem;
    opacity: 0.5;
    margin-bottom: 8px;
}

/* Footer */
.search-footer {
    display: flex;
    justify-content: flex-end;
    gap: 16px;
    padding: 10px 20px;
    background: rgba(0,0,0,0.2);
    border-top: 1px solid rgba(255,255,255,0.05);
    font-size: 0.75rem;
    color: var(--text-muted);
}

[data-theme="light"] .search-footer {
    background: rgba(0,0,0,0.02);
    border-top-color: rgba(0,0,0,0.05);
}

.footer-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.footer-item kbd {
    background: rgba(255,255,255,0.1);
    padding: 1px 5px;
    border-radius: 3px;
    font-family: inherit;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 1px 0 rgba(0,0,0,0.2);
}

[data-theme="light"] .footer-item kbd {
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 1px 0 #ccc;
    color: #555;
}

/* Search History Styling */
.search-section-title {
    padding: 8px 20px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(255,255,255,0.02);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.history-item {
    color: var(--text);
}

.history-item i {
    margin-right: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.history-item.active i,
.history-item:hover i {
    color: var(--primary);
}
/* "Jump to" Button in Sidebar */
.jump-to-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.jump-to-btn:hover {
    background: var(--bg-glass);
    border-color: var(--primary);
    color: var(--text);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.jump-icon {
    margin-right: 8px;
    opacity: 0.7;
}

.jump-key {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-family: inherit;
}

[data-theme="light"] .jump-key {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-muted);
}