/* ==============================================================
   K8labs — Documentation Page
   Dark theme matching main site design
   ============================================================== */

:root {
    --primary: #DC3545;
    --primary-dark: #B02A37;
    --bg-dark: #0a0a0a;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-border: rgba(255, 255, 255, 0.08);
    --text-white: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.5);
    --text-dim: rgba(255, 255, 255, 0.7);
    --font: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --radius-card: 16px;
    --transition: all 0.3s ease;
}

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: var(--font);
    margin: 0;
    padding: 0;
    background: #0a0a0a;
    color: var(--text-white);
    line-height: 1.6;
    min-height: 100vh;
}

/* ================================================
   NAVBAR (same as index)
   ================================================ */
.site-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    padding: 16px 0;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.nav-logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: #DC3545;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.nav-links-list {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
}

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

.nav-link-item {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 8px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.08);
}

/* ================================================
   HAMBURGER MENU (mobile only)
   ================================================ */
.hamburger-btn {
    display: none;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 1001;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.08);
}

.hamburger-line {
    position: absolute;
    left: 50%;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transform: translateX(-50%);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.hamburger-line:nth-child(1) { top: 14px; }
.hamburger-line:nth-child(2) { top: 21px; }
.hamburger-line:nth-child(3) { top: 28px; }

.hamburger-btn.active .hamburger-line:nth-child(1) {
    top: 21px;
    transform: translateX(-50%) rotate(45deg);
    background: #DC3545;
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: translateX(-50%) scaleX(0);
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    top: 21px;
    transform: translateX(-50%) rotate(-45deg);
    background: #DC3545;
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Menu Panel */
.mobile-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100%;
    background: linear-gradient(180deg, #0f0f0f 0%, #0a0a0a 100%);
    z-index: 1000;
    transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-menu.active {
    right: 0;
}

.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mobile-menu-close {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu-close:hover {
    background: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.3);
    color: #DC3545;
}

.mobile-menu-links {
    list-style: none;
    padding: 24px;
    margin: 0;
    flex: 1;
}

.mobile-menu-links li {
    margin-bottom: 8px;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.mobile-menu.active .mobile-menu-links li {
    opacity: 1;
    transform: translateX(0);
}

.mobile-menu.active .mobile-menu-links li:nth-child(1) { transition-delay: 0.1s; }
.mobile-menu.active .mobile-menu-links li:nth-child(2) { transition-delay: 0.15s; }
.mobile-menu.active .mobile-menu-links li:nth-child(3) { transition-delay: 0.2s; }
.mobile-menu.active .mobile-menu-links li:nth-child(4) { transition-delay: 0.25s; }

.mobile-menu-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 12px;
    transition: all 0.2s ease;
}

.mobile-menu-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: white;
}

/* ================================================
   DOCUMENTATION HERO
   ================================================ */
.doc-hero {
    padding: 140px 0 60px;
    text-align: center;
    background: #0a0a0a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.doc-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 32px;
}

.doc-hero-title {
    font-size: clamp(2.2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: white;
    margin: 0 0 16px;
    letter-spacing: -0.025em;
}

.doc-hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.7;
}

/* ================================================
   DOCUMENTATION MAIN CONTENT
   ================================================ */
.doc-main {
    padding: 60px 0 80px;
}

.doc-section {
    margin-bottom: 56px;
}

.doc-section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: white;
    margin: 0 0 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid #DC3545;
    display: flex;
    align-items: center;
    gap: 12px;
}

.doc-section-title i {
    color: #DC3545;
    font-size: 1.2rem;
}

.doc-section-body {
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.8;
}

.doc-section-body p {
    margin: 0 0 16px;
}

.doc-section-body h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    margin: 32px 0 14px;
}

.doc-section-body ul,
.doc-section-body ol {
    padding-left: 24px;
    margin: 0 0 20px;
}

.doc-section-body li {
    margin-bottom: 8px;
}

.doc-section-body code {
    background: rgba(220, 53, 69, 0.12);
    color: #DC3545;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Highlight Box */
.doc-highlight-box {
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    border-left: 3px solid #DC3545;
    border-radius: var(--radius-card);
    padding: 24px 28px;
    margin: 20px 0;
}

.doc-highlight-box h4 {
    color: white;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-highlight-box h4 i {
    color: #DC3545;
}

.doc-highlight-box ul {
    margin-bottom: 0;
}

/* Steps */
.doc-steps {
    counter-reset: step;
    padding-left: 0;
    list-style: none;
}

.doc-steps li {
    counter-increment: step;
    position: relative;
    padding-left: 48px;
    margin-bottom: 20px;
}

.doc-steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #DC3545;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Features Grid */
.doc-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.doc-feature {
    padding: 24px;
    border-radius: var(--radius-card);
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    transition: var(--transition);
}

.doc-feature:hover {
    border-color: rgba(255, 255, 255, 0.15);
}

.doc-feature h4 {
    color: white;
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.doc-feature h4 i {
    color: #DC3545;
}

.doc-feature p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.6;
}

/* Code Blocks */
.doc-code-block {
    margin: 20px 0;
    border-radius: var(--radius-card);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--bg-card-border);
    overflow: hidden;
}

.doc-code-block h4 {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid var(--bg-card-border);
}

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

.doc-code-block code {
    background: none;
    color: var(--text-dim);
    padding: 0;
    font-size: 0.85rem;
    line-height: 1.7;
}

/* Resources Grid */
.doc-resources-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.doc-resource-link {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 24px;
    border-radius: var(--radius-card);
    background: var(--bg-card);
    border: 1px solid var(--bg-card-border);
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

.doc-resource-link:hover {
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.doc-resource-link > i:first-child {
    font-size: 1.4rem;
    color: #DC3545;
    width: 36px;
    text-align: center;
    flex-shrink: 0;
}

.doc-resource-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
    flex-shrink: 0;
}

.doc-resource-link div {
    flex: 1;
}

.doc-resource-link strong {
    display: block;
    color: white;
    font-size: 1rem;
    margin-bottom: 2px;
}

.doc-resource-link span {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.doc-resource-link > i:last-child {
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* ================================================
   FOOTER (same as index)
   ================================================ */
.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 40px 0;
    background: transparent;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.footer-copy {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.35);
    margin: 0;
}

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

.footer-links a {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.4);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: rgba(255, 255, 255, 0.8);
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
    .nav-inner {
        padding: 0 20px;
    }

    .nav-links-list {
        display: none;
    }

    .hamburger-btn {
        display: block;
    }

    .doc-container {
        padding: 0 20px;
    }

    .doc-hero {
        padding: 120px 0 40px;
    }

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

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

    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .nav-links-list {
        gap: 2px;
    }

    .nav-link-item {
        padding: 6px 10px;
        font-size: 0.78rem;
    }

    .doc-hero-title {
        font-size: 1.8rem;
    }

    .doc-section-title {
        font-size: 1.3rem;
    }

    .doc-steps li {
        padding-left: 40px;
    }
}
