/* ========================================
   DOCUMENTATION PAGE STYLES
   ======================================== */

/* === Page Header === */
.docs-hero {
    padding: 130px 0 48px;
    border-bottom: 1px solid var(--border);
    background-color: #f5f5f5;
    background-image: url('/hero-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-align: center;
}

html[data-theme="dark"] .docs-hero {
    background-color: #0a0a0a;
    background-image: url('/hero_section_darkmode.png');
}

.docs-breadcrumb {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-3);
    margin-bottom: 32px;
}

.docs-breadcrumb a {
    color: var(--text-3);
    transition: color 0.25s;
}

.docs-breadcrumb a:hover {
    color: var(--text);
}

.docs-breadcrumb span {
    color: var(--text);
    font-weight: 500;
}

.docs-title {
    font-family: var(--font);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -2px;
    margin-bottom: 16px;
}

.docs-subtitle {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-2);
    max-width: 520px;
    margin: 0 auto 32px;
}

/* Search Bar */
.docs-search-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 20px;
    max-width: 480px;
    margin-inline: auto;
    transition: all 0.25s var(--ease);
}

.docs-search-bar:focus-within {
    border-color: var(--text);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
}

.docs-search-bar svg {
    color: var(--text-3);
    flex-shrink: 0;
}

.docs-search-bar input {
    flex: 1;
    font-family: var(--font);
    font-size: 14px;
    font-weight: 450;
    color: var(--text);
    background: none;
    border: none;
    outline: none;
}

.docs-search-bar input::placeholder {
    color: var(--text-3);
}

.docs-search-bar kbd {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 3px 8px;
    border-radius: 6px;
    flex-shrink: 0;
}

/* === Layout === */
.docs-content {
    padding: 0 0 80px;
}

.docs-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 28px;
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 56px;
    align-items: start;
    position: relative;
}

/* === Sidebar === */
.docs-sidebar {
    position: sticky;
    top: 84px;
    padding: 32px 0;
    max-height: calc(100vh - 84px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

.docs-sidebar:hover {
    scrollbar-color: #ddd transparent;
}

.docs-nav-group {
    margin-bottom: 28px;
}

.docs-nav-group:last-child {
    margin-bottom: 0;
}

.docs-nav-group h5 {
    font-size: 11px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-3);
    margin-bottom: 10px;
    padding-left: 14px;
}

.docs-nav-link {
    display: block;
    font-size: 13px;
    font-weight: 450;
    color: var(--text-2);
    padding: 7px 14px;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    transition: all 0.2s var(--ease);
    line-height: 1.4;
}

.docs-nav-link:hover {
    color: var(--text);
    background: var(--bg-alt);
}

.docs-nav-link.active {
    color: var(--text);
    font-weight: 600;
    border-left-color: var(--text);
    background: var(--bg-alt);
}

/* Sidebar Toggle (mobile) */
.docs-sidebar-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    font-family: var(--font);
    font-size: 13px;
    font-weight: 550;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: 10px;
    cursor: pointer;
    position: sticky;
    top: 72px;
    z-index: 10;
    margin: 16px 28px;
    transition: all 0.25s var(--ease);
}

.docs-sidebar-toggle:hover {
    border-color: var(--border-hover);
}

/* === Main Content === */
.docs-main {
    padding: 32px 0;
    min-width: 0;
}

.docs-section {
    padding-bottom: 48px;
    margin-bottom: 48px;
    border-bottom: 1px solid var(--border);
}

.docs-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.docs-section h2 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 18px;
    padding-top: 4px;
}

.docs-section h3 {
    font-size: 19px;
    font-weight: 650;
    letter-spacing: -0.4px;
    margin-bottom: 12px;
    margin-top: 32px;
}

.docs-section h3:first-of-type {
    margin-top: 24px;
}

.docs-section p {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-2);
    margin-bottom: 16px;
    max-width: 680px;
}

.docs-section a {
    color: var(--text);
    font-weight: 550;
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--border);
    transition: text-decoration-color 0.25s;
}

.docs-section a:hover {
    text-decoration-color: var(--text);
}

.docs-section ul,
.docs-section ol {
    margin-bottom: 20px;
    padding-left: 22px;
    max-width: 680px;
}

.docs-section li {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-2);
    margin-bottom: 6px;
}

.docs-section li strong {
    color: var(--text);
}

.docs-section code {
    font-family: var(--font-mono);
    font-size: 13px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    padding: 2px 7px;
    border-radius: 6px;
    color: var(--text);
}

/* === Callouts === */
.docs-callout {
    display: flex;
    gap: 14px;
    padding: 20px 24px;
    border-radius: var(--radius);
    margin: 24px 0;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-2);
    max-width: 680px;
}

.docs-callout-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.docs-callout strong {
    display: block;
    color: var(--text);
    margin-bottom: 2px;
}

.docs-callout span {
    color: var(--text-2);
}

.docs-callout span a {
    font-weight: 550;
}

.docs-callout-info {
    background: #f0f4ff;
    border: 1px solid #d4deff;
}

.docs-callout-info .docs-callout-icon {
    color: #4f6df5;
}

.docs-callout-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
}

.docs-callout-warning .docs-callout-icon {
    color: #d97706;
}

.docs-callout-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}

.docs-callout-success .docs-callout-icon {
    color: #16a34a;
}

/* === Dark theme === */
html[data-theme="dark"] .docs-callout-info {
    background: rgba(79, 109, 245, 0.12);
    border-color: rgba(79, 109, 245, 0.32);
}

html[data-theme="dark"] .docs-callout-warning {
    background: rgba(217, 119, 6, 0.12);
    border-color: rgba(217, 119, 6, 0.32);
}

html[data-theme="dark"] .docs-callout-success {
    background: rgba(22, 163, 74, 0.12);
    border-color: rgba(22, 163, 74, 0.32);
}

html[data-theme="dark"] .docs-code pre {
    background: #161616;
}

/* === Code Blocks === */
.docs-code {
    margin: 24px 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    max-width: 680px;
}

.docs-code-header {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

.docs-code-header span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-3);
    letter-spacing: 0.3px;
}

.docs-code pre {
    padding: 20px 22px;
    overflow-x: auto;
    background: #fafafa;
    margin: 0;
}

.docs-code code {
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.7;
    color: var(--text);
    background: none;
    border: none;
    padding: 0;
    border-radius: 0;
}

/* === Steps === */
.docs-steps {
    margin: 24px 0;
    max-width: 680px;
}

.docs-step {
    display: flex;
    gap: 18px;
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.docs-step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.docs-step-num {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--text);
    color: var(--bg);
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    flex-shrink: 0;
}

.docs-step-content h4 {
    font-size: 16px;
    font-weight: 650;
    letter-spacing: -0.3px;
    margin-bottom: 6px;
}

.docs-step-content p {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-2);
    margin-bottom: 0;
}

/* === Tables === */
.docs-table-wrapper {
    margin: 20px 0;
    max-width: 680px;
    overflow-x: auto;
}

.docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.docs-table thead {
    border-bottom: 2px solid var(--border);
}

.docs-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-3);
    padding: 10px 16px 10px 0;
}

.docs-table td {
    padding: 12px 16px 12px 0;
    color: var(--text-2);
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.docs-table td code {
    font-size: 12px;
    white-space: nowrap;
}

.docs-table tr:last-child td {
    border-bottom: none;
}

/* === FAQ / Accordion === */
.docs-faq {
    max-width: 680px;
}

.docs-faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 8px;
    overflow: hidden;
    transition: all 0.25s var(--ease);
}

.docs-faq-item:hover {
    border-color: var(--border-hover);
}

.docs-faq-item[open] {
    border-color: var(--border-hover);
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.docs-faq-item summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.2px;
    cursor: pointer;
    list-style: none;
    transition: background 0.2s;
}

.docs-faq-item summary::-webkit-details-marker {
    display: none;
}

.docs-faq-item summary::after {
    content: '';
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-3);
    border-bottom: 2px solid var(--text-3);
    transform: rotate(45deg);
    flex-shrink: 0;
    transition: transform 0.25s var(--ease);
}

.docs-faq-item[open] summary::after {
    transform: rotate(-135deg);
}

.docs-faq-item summary:hover {
    background: var(--bg-alt);
}

.docs-faq-item p {
    padding: 0 20px 16px;
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-2);
    margin: 0;
    max-width: none;
}

/* === Responsive === */
@media (max-width: 1024px) {
    .docs-layout {
        grid-template-columns: 200px 1fr;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .docs-hero {
        padding: 110px 0 36px;
    }

    .docs-title {
        font-size: 32px;
        letter-spacing: -1.5px;
    }

    .docs-search-bar {
        max-width: 100%;
    }

    .docs-search-bar kbd {
        display: none;
    }

    .docs-layout {
        display: block;
    }

    .docs-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 280px;
        background: var(--bg);
        border-right: 1px solid var(--border);
        z-index: 100;
        padding: 80px 20px 32px;
        transform: translateX(-100%);
        transition: transform 0.35s var(--ease);
        max-height: 100vh;
    }

    .docs-sidebar.open {
        transform: translateX(0);
    }

    .docs-sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.3);
        z-index: 99;
        opacity: 0;
        visibility: hidden;
        transition: all 0.35s var(--ease);
    }

    .docs-sidebar-overlay.open {
        opacity: 1;
        visibility: visible;
    }

    .docs-sidebar-toggle {
        display: flex;
    }

    .docs-main {
        padding: 0 28px 0;
    }

    .docs-section h2 {
        font-size: 22px;
    }

    .docs-section h3 {
        font-size: 17px;
    }

    .docs-callout {
        flex-direction: column;
        gap: 10px;
    }

    .docs-step {
        flex-direction: column;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .docs-section p,
    .docs-section li {
        font-size: 14px;
    }

    .docs-code pre {
        padding: 16px;
    }

    .docs-code code {
        font-size: 12px;
    }

    .docs-table {
        font-size: 13px;
    }
}
