/* B2B SDK Documentation Styles */

:root {
    /* Heritage from Landing */
    --primary: #eb6703;
    --primary-hover: #d15c02;
    --primary-soft: rgba(235, 103, 3, 0.1);
    --black: #000000;
    --gray-dark: #333333;
    --gray-medium: #666666;
    --gray-light: #f4f4f4;
    --white: #ffffff;
    --sidebar-width: 300px;
    --sidebar-collapsed-width: 60px;
    --header-height: 70px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', sans-serif;
    color: var(--gray-dark);
    line-height: 1.6;
    background-color: var(--white);
    display: flex;
    overflow-x: hidden;
}

h1, h2, h3, h4 {
    font-family: 'Outfit', sans-serif;
    color: var(--black);
    margin-bottom: 1.5rem;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--black);
    color: var(--white);
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: var(--header-height);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--white);
}

.sidebar.collapsed .sidebar-logo span,
.sidebar.collapsed .logo-img {
    display: none;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

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

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

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

.nav-item {
    margin-bottom: 4px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    gap: 15px;
    border-left: 3px solid transparent;
}

.nav-link:hover, .nav-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.nav-link.active {
    border-left-color: var(--primary);
    background: rgba(255, 103, 3, 0.05);
}

.sidebar.collapsed .nav-text {
    display: none;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--black);
    color: var(--white);
    padding: 0 20px;
    z-index: 200;
    align-items: center;
    justify-content: space-between;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--white);
    font-weight: 600;
    font-size: 0.9rem;
}

.mobile-toggle {
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
}

/* Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: 100vh;
    transition: var(--transition);
    padding: 40px 60px;
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed-width);
}

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

/* Documentation Content Styling */
.doc-section {
    margin-bottom: 60px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--gray-light);
}

.doc-section:last-child {
    border-bottom: none;
}

.doc-section h2 {
    font-size: 2rem;
    border-left: 5px solid var(--primary);
    padding-left: 20px;
    margin-top: 40px;
}

.doc-section p {
    margin-bottom: 20px;
    color: var(--gray-dark);
    font-size: 1.1rem;
}

.screenshot {
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin: 30px 0;
    border: 1px solid var(--gray-light);
    cursor: zoom-in;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.screenshot:hover {
    transform: scale(1.01);
    box-shadow: 0 16px 40px rgba(0,0,0,0.18);
}

/* ─── Lightbox Modal ─── */
.lightbox-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: zoom-out;
    animation: lbFadeIn 0.22s ease;
}

.lightbox-overlay.active {
    display: flex;
}

@keyframes lbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lightbox-img-wrap {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lbZoomIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes lbZoomIn {
    from { transform: scale(0.88); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.lightbox-img {
    max-width: 100%;
    max-height: calc(100vh - 80px);
    border-radius: 10px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.6);
    cursor: default;
    display: block;
}

.lightbox-close {
    position: fixed;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    z-index: 10000;
}

.lightbox-close:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.caption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--gray-medium);
    margin-top: -20px;
    margin-bottom: 30px;
    font-style: italic;
}

/* Table of Contents */
.toc {
    background-color: var(--bg-light);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 40px;
}

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

.toc li {
    margin-bottom: 10px;
}

.toc a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.toc a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 968px) {
    .mobile-header {
        display: flex;
    }

    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
        width: 100%;
    }
    
    .sidebar.mobile-open .sidebar-header {
        justify-content: flex-end; /* Focus on the close action */
    }

    .sidebar.mobile-open .sidebar-logo {
        display: flex !important; /* Force show in mobile overlay */
        position: absolute;
        left: 20px;
    }

    .main-content {
        margin-left: 0 !important;
        padding: 80px 20px 30px; /* Increased top padding for mobile header */
    }
}
