/* ==========================
   DOCS LAYOUT
   ========================== */
.docs-layout {
    display: flex;
    min-height: calc(100vh - 80px);
    max-width: 1400px;
    margin: 0 auto;
}

/* ==========================
   SIDEBAR
   ========================== */
.docs-sidebar {
    width: 280px;
    background: var(--light);
    border-right: 1px solid var(--border);
    padding: 30px 0;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.docs-nav {
    padding: 0 20px;
}

.nav-section {
    margin-bottom: 30px;
}

.nav-section h4 {
    font-size: 12px;
    font-weight: 700;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-left: 8px;
}

.nav-section ul {
    list-style: none;
}

.nav-section ul li {
    margin-bottom: 2px;
}

.nav-section ul a {
    display: block;
    padding: 8px 12px;
    color: var(--dark);
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
}

.nav-section ul a:hover {
    background: white;
    color: var(--primary);
}

.nav-section ul a.active {
    background: var(--primary);
    color: white;
    font-weight: 500;
}

/* ==========================
   MAIN CONTENT
   ========================== */
.docs-content {
    flex: 1;
    padding: 40px 60px;
    max-width: calc(100% - 280px);
    min-width: 0;
}

.sidebar-toggle {
    display: none;
    padding: 10px 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
}

.docs-section {
    padding-bottom: 60px;
    margin-bottom: 60px;
    border-bottom: 1px solid var(--border);
}

.docs-section:last-of-type {
    border-bottom: none;
}

.breadcrumb {
    display: inline-block;
    color: var(--primary);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.docs-content h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--dark);
    scroll-margin-top: 90px;
}

.docs-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 16px;
    color: var(--dark);
    scroll-margin-top: 90px;
}

.docs-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-top: 30px;
    margin-bottom: 12px;
    color: var(--dark);
}

.docs-content p {
    font-size: 16px;
    line-height: 1.7;
    color: var(--dark);
    margin-bottom: 16px;
}

.docs-content p.lead {
    font-size: 20px;
    color: var(--gray);
    margin-bottom: 30px;
}

.docs-content ul, .docs-content ol {
    margin: 16px 0 16px 30px;
}

.docs-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.docs-content code {
    background: #eef2ff;
    color: #4f46e5;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9em;
    font-weight: 500;
}

.docs-content a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.docs-content a:hover {
    text-decoration: underline;
}

/* ==========================
   CODE BLOCKS
   ========================== */
.code-header {
    background: #1e1e1e;
    color: #cbd5e1;
    padding: 10px 16px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
    border-bottom: 1px solid #333;
}

.code-header + pre {
    margin-top: 0 !important;
    border-radius: 0 0 8px 8px !important;
}

.copy-btn {
    background: transparent;
    color: #94a3b8;
    border: 1px solid #333;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    font-family: inherit;
}

.copy-btn:hover {
    background: #333;
    color: white;
}

.copy-btn.copied {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

pre {
    background: #1e1e1e !important;
    border-radius: 8px;
    padding: 20px !important;
    overflow-x: auto;
    margin: 16px 0 !important;
    font-size: 14px !important;
}

pre code {
    background: transparent !important;
    color: #e2e8f0 !important;
    padding: 0 !important;
    font-size: 14px !important;
}

/* ==========================
   BOXES
   ========================== */
.info-box,
.warning-box,
.success-box,
.error-box {
    padding: 20px 24px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid;
}

.info-box {
    background: #eef2ff;
    border-color: var(--primary);
}

.warning-box {
    background: #fef3c7;
    border-color: #f59e0b;
}

.success-box {
    background: #d1fae5;
    border-color: var(--success);
}

.error-box {
    background: #fee2e2;
    border-color: #ef4444;
}

.info-box strong,
.warning-box strong,
.success-box strong,
.error-box strong {
    display: block;
    margin-bottom: 8px;
    font-size: 15px;
}

.info-box ul,
.warning-box ul,
.success-box ul {
    margin-top: 10px;
    margin-bottom: 0;
}

/* ==========================
   FEATURE LIST
   ========================== */
.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.feature-item {
    display: flex;
    gap: 16px;
    padding: 20px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.feature-item .feature-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.feature-item strong {
    display: block;
    margin-bottom: 4px;
}

.feature-item p {
    margin: 0;
    font-size: 14px;
    color: var(--gray);
}

/* ==========================
   STEP LIST
   ========================== */
.step-list {
    counter-reset: step;
    list-style: none;
    margin-left: 0;
}

.step-list li {
    counter-increment: step;
    padding-left: 50px;
    position: relative;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

.step-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    background: var(--primary);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
}

/* ==========================
   CHECK LIST
   ========================== */
.check-list {
    list-style: none;
    margin-left: 0;
}

.check-list li {
    padding-left: 0;
    margin-bottom: 10px;
}

/* ==========================
   TABLES
   ========================== */
.specs-table,
.endpoints-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.specs-table th,
.endpoints-table th {
    background: var(--light);
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: var(--dark);
    border-bottom: 2px solid var(--border);
}

.specs-table td,
.endpoints-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.specs-table tr:last-child td,
.endpoints-table tr:last-child td {
    border-bottom: none;
}

.specs-table tr:hover,
.endpoints-table tr:hover {
    background: #fafafa;
}

/* ==========================
   METHOD BADGES
   ========================== */
.method {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    font-family: 'JetBrains Mono', monospace;
}

.method.post {
    background: #dbeafe;
    color: #1e40af;
}

.method.get {
    background: #dcfce7;
    color: #166534;
}

.method.put {
    background: #fef3c7;
    color: #92400e;
}

.method.delete {
    background: #fee2e2;
    color: #991b1b;
}

/* ==========================
   ENDPOINT HEADER
   ========================== */
.endpoint-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: #1e1e1e;
    border-radius: 8px;
    margin: 20px 0;
}

.endpoint-header code {
    background: transparent;
    color: #e2e8f0;
    font-size: 15px;
    padding: 0;
}

/* ==========================
   CODE BADGES
   ========================== */
.code-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 700;
}

.code-badge.success {
    background: #dcfce7;
    color: #166534;
}

.code-badge.error {
    background: #fee2e2;
    color: #991b1b;
}

/* ==========================
   ERROR CARDS
   ========================== */
.error-card {
    background: white;
    border: 1px solid var(--border);
    border-left: 4px solid #ef4444;
    padding: 20px 24px;
    border-radius: 8px;
    margin: 16px 0;
}

.error-card h3 {
    margin-top: 0 !important;
    margin-bottom: 12px !important;
    color: #ef4444 !important;
}

.error-card p {
    margin-bottom: 8px;
    font-size: 15px;
}

.error-card p:last-child {
    margin-bottom: 0;
}

/* ==========================
   SUPPORT GRID
   ========================== */
.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.support-card {
    background: white;
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s;
}

.support-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border-color: var(--primary);
}

.support-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.support-card h3 {
    margin-top: 0 !important;
    margin-bottom: 8px !important;
}

.support-card p {
    color: var(--gray);
    margin-bottom: 20px;
}

/* ==========================
   DOCS FOOTER NAV
   ========================== */
.docs-footer-nav {
    display: flex;
    justify-content: space-between;
    padding: 30px 0;
    border-top: 1px solid var(--border);
    margin-top: 40px;
}

.back-home,
.back-to-top {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.2s;
}

.back-home:hover,
.back-to-top:hover {
    background: var(--light);
}

.nav-links a.active {
    color: var(--primary);
    font-weight: 600;
}

/* ==========================
   RESPONSIVE
   ========================== */
@media (max-width: 1024px) {
    .docs-content {
        padding: 30px 30px;
    }
    
    .docs-content h1 {
        font-size: 32px;
    }
}

@media (max-width: 768px) {
    .docs-layout {
        flex-direction: column;
    }
    
    .docs-sidebar {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: calc(100vh - 70px);
        z-index: 999;
        transition: left 0.3s;
        box-shadow: 4px 0 20px rgba(0,0,0,0.1);
    }
    
    .docs-sidebar.active {
        left: 0;
    }
    
    .docs-content {
        max-width: 100%;
        padding: 20px;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .docs-content h1 {
        font-size: 28px;
    }
    
    .docs-content h2 {
        font-size: 22px;
    }
    
    pre {
        font-size: 12px !important;
    }
    
    .specs-table,
    .endpoints-table {
        font-size: 12px;
    }
    
    .specs-table th,
    .specs-table td,
    .endpoints-table th,
    .endpoints-table td {
        padding: 10px 12px;
    }
    
    .feature-list {
        grid-template-columns: 1fr;
    }
}

/* ==========================
   SCROLLBAR STYLING
   ========================== */
.docs-sidebar::-webkit-scrollbar {
    width: 6px;
}

.docs-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.docs-sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.docs-sidebar::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}