:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #48bb78;
    --dark: #1a202c;
    --light: #f7fafc;
    --gray-100: #f7fafc;
    --gray-200: #edf2f7;
    --gray-300: #e2e8f0;
    --gray-600: #718096;
    --gray-800: #2d3748;
    --sidebar-width: 280px;
    --toc-width: 220px;
}

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

html {
    overflow-x: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--dark);
    line-height: 1.6;
    background: var(--light);
    overflow-x: hidden;
}

/* Top Navigation */
.top-nav {
    background: white;
    border-bottom: 1px solid var(--gray-300);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.top-nav .container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem 1rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    width: var(--sidebar-width);
    padding-left: 1rem;
}

.logo {
    height: 60px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.btn-signup {
    display: inline-block;
    padding: 0.55rem 1.4rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 8px;
    letter-spacing: 0.01em;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.35);
    transition: opacity 0.2s, box-shadow 0.2s, transform 0.2s;
}

.btn-signup:hover {
    opacity: 0.9;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.45);
    transform: translateY(-1px);
}

/* Docs Container */
.docs-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--gray-300);
    height: calc(100vh - 65px);
    position: sticky;
    top: 65px;
    overflow-y: auto;
}

.sidebar-content {
    padding: 2rem 1rem;
}

.search-box {
    position: relative;
    margin-bottom: 2rem;
}

.search-box i {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-600);
}

.search-box input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.nav-section {
    margin-bottom: 2rem;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    margin-bottom: 0.75rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.75rem;
    color: var(--gray-800);
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s;
    margin-bottom: 0.25rem;
}

.nav-link i {
    width: 20px;
    text-align: center;
    color: var(--gray-600);
}

.nav-link:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.nav-link:hover i {
    color: var(--primary);
}

.nav-link.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-weight: 600;
}

.nav-link.active i {
    color: white;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    min-height: calc(100vh - 65px);
}

.content-wrapper {
    flex: 1;
    padding: 3rem;
    max-width: 900px;
}

/* Hero */
.hero {
    margin-bottom: 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    -moz-background-clip: text;
    -moz-text-fill-color: transparent;
    color: transparent;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
}

/* Quick Links */
.quick-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.quick-link {
    padding: 1.5rem;
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s;
}

.quick-link:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.quick-link-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.quick-link-icon i {
    font-size: 1.5rem;
    color: white;
}

.quick-link h3 {
    font-size: 1.1rem;
    color: var(--dark);
    margin-bottom: 0.5rem;
}

.quick-link p {
    font-size: 0.9rem;
    color: var(--gray-600);
}

/* Doc Sections */
.doc-section {
    margin-bottom: 3rem;
    padding: 50px;
}

.doc-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark);
}

.doc-section p {
    color: var(--gray-800);
    margin-bottom: 1rem;
}
.doc-section ol li {
    margin: 10px;
}

.doc-section ul li {
    margin: 10px;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.feature-card {
    padding: 1.5rem;
    background: var(--gray-100);
    border-radius: 10px;
}

.feature-card i {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--gray-600);
}

/* Code Examples */
.code-example {
    background: var(--gray-800);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: var(--gray-900);
    border-bottom: 1px solid #4a5568;
}

.code-header span {
    color: var(--gray-300);
    font-size: 0.85rem;
    font-weight: 600;
}

.copy-btn {
    background: transparent;
    border: 1px solid var(--gray-600);
    color: var(--gray-300);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.code-example pre {
    margin: 0;
    padding: 1.25rem;
    overflow-x: auto;
}

.code-example code {
    color: #e2e8f0;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Doc Footer */
.doc-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-300);
}

.footer-nav {
    display: flex;
    justify-content: space-between;
}

.footer-nav-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    padding: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    transition: all 0.2s;
}

.footer-nav-link:hover {
    border-color: var(--primary);
    background: var(--gray-100);
}

.footer-nav-link span {
    font-size: 0.8rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.footer-nav-link strong {
    color: var(--dark);
}

.footer-nav-link.next {
    margin-left: auto;
    text-align: right;
}

/* Table of Contents */
.toc {
    width: var(--toc-width);
    padding: 3rem 1.5rem;
    position: sticky;
    top: 65px;
    height: calc(100vh - 65px);
    overflow-y: auto;
}

.toc h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--gray-600);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.toc nav a {
    display: block;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 0;
    border-left: 2px solid transparent;
    padding-left: 1rem;
    transition: all 0.2s;
}

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

/* Workflow Diagram */
.workflow-diagram {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 2rem 0;
    padding: 2rem;
    background: var(--gray-100);
    border-radius: 12px;
    overflow-x: auto;
}

.workflow-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 150px;
}

.step-number {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.step-content h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    text-align: center;
}

.step-content p {
    font-size: 0.85rem;
    color: var(--gray-600);
    text-align: center;
}

.workflow-arrow {
    font-size: 2rem;
    color: var(--gray-400);
    margin: 0 1rem;
}

/* Step Lists */
.step-list {
    counter-reset: step-counter;
    list-style: none;
    padding-left: 0;
}

.step-list li {
    counter-increment: step-counter;
    margin-bottom: 2rem;
    position: relative;
    padding-left: 4rem;
}

.step-list li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.step-list li strong {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.step-list li p {
    color: var(--gray-600);
    margin: 0;
}

/* Requirements List */
.requirements-list {
    list-style: none;
    padding: 0;
}

.requirements-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.requirements-list li:last-child {
    border-bottom: none;
}

.requirements-list li i {
    color: var(--success);
    margin-right: 0.75rem;
}

/* Alerts */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.alert i {
    font-size: 1.25rem;
    margin-top: 0.125rem;
}

.alert-info {
    background: #ebf8ff;
    border-left: 4px solid #4299e1;
    color: #2c5282;
}

.alert-success {
    background: #f0fff4;
    border-left: 4px solid #48bb78;
    color: #22543d;
}

.alert-warning {
    background: #fffaf0;
    border-left: 4px solid #ed8936;
    color: #7c2d12;
}

.alert strong {
    display: block;
    margin-bottom: 0.25rem;
}

.alert a {
    color: inherit;
    text-decoration: underline;
}

/* Practice Items */
.practice-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--gray-100);
    border-radius: 10px;
}

.practice-item h3 {
    color: var(--success);
    margin-bottom: 1rem;
}

.practice-item h3 i {
    margin-right: 0.5rem;
}

.practice-item ul {
    margin-top: 1rem;
}

/* Troubleshooting Items */
.troubleshooting-item {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #fff5f5;
    border-left: 4px solid #fc8181;
    border-radius: 8px;
}

.troubleshooting-item strong {
    display: block;
    color: #c53030;
    margin-bottom: 0.75rem;
}

.troubleshooting-item ul {
    margin-top: 0.75rem;
}

/* Breadcrumb */
.breadcrumb {
    font-size: 0.9rem;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

.breadcrumb a {
    color: var(--gray-600);
    text-decoration: none;
}

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

.breadcrumb span {
    color: var(--dark);
}

/* Lead Text */
.lead {
    font-size: 1.25rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
}

/* Command Cards */
.command-card {
    background: var(--gray-100);
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.command-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.command-card h3 code {
    background: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.command-card p {
    margin-bottom: 1rem;
    color: var(--gray-600);
}

.command-card .code-example {
    margin-bottom: 0;
}

/* Hamburger button — hidden on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    margin-right: 0.5rem;
}

.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gray-800);
    border-radius: 2px;
    transition: all 0.3s;
}

/* Sidebar overlay — hidden by default */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 149;
}

.sidebar-overlay.active {
    display: block;
}

/* Responsive */
@media (max-width: 1200px) {
    body {
        width: 100%;
    }

    .toc {
        display: none;
    }
    .top-nav {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    /* Show hamburger */
    .hamburger {
        display: flex;
    }

    /* Sidebar becomes a slide-in drawer */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 150;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.15);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Nav container */
    .top-nav .container {
        padding: 0.75rem 1rem;
    }

    /* Reset desktop sidebar-alignment width on mobile */
    .nav-brand {
        width: auto;
        padding-left: 0;
    }

    /* Logo size */
    .logo {
        height: 60px;
    }

    /* Nav links */
    .nav-links {
        gap: 0.75rem;
        font-size: 0.85rem;
    }

    /* Content — min-width: 0 prevents flex children from overflowing */
    .docs-container,
    .main-content {
        width: 100%;
        min-width: 0;
    }

    .content-wrapper {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: 1.5rem 1rem;
    }

    /* Doc section — reduce the 50px padding */
    .doc-section {
        padding: 1.5rem 0;
    }

    /* Grids to single column */
    .quick-links,
    .features-grid {
        grid-template-columns: 1fr;
    }

    /* Hero heading */
    .hero h1 {
        font-size: 1.75rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .lead {
        font-size: 1rem;
    }

    /* Workflow — stack vertically */
    .workflow-diagram {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .workflow-step {
        flex-direction: row;
        align-items: flex-start;
        gap: 1rem;
        min-width: unset;
    }

    .step-number {
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .step-content h3,
    .step-content p {
        text-align: left;
    }

    .workflow-arrow {
        transform: rotate(90deg);
        align-self: center;
        margin: 0;
        font-size: 1.25rem;
    }

    /* Step list */
    .step-list li {
        padding-left: 3rem;
    }

    /* Footer nav — stack vertically */
    .footer-nav {
        flex-direction: column;
        gap: 1rem;
    }

    .footer-nav-link.next {
        margin-left: 0;
        text-align: left;
    }

    /* Code blocks — ensure scroll on narrow screens */
    .code-example pre {
        font-size: 0.8rem;
    }

    /* Alerts */
    .alert {
        gap: 0.75rem;
    }
}

/* Back to top button — mobile only */
.back-to-top {
    display: none;
}

@media (max-width: 768px) {
    .back-to-top {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: 1.5rem;
        right: 1.25rem;
        width: 44px;
        height: 44px;
        background: linear-gradient(135deg, var(--primary), var(--secondary));
        color: white;
        border: none;
        border-radius: 50%;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
        cursor: pointer;
        font-size: 1rem;
        opacity: 0;
        pointer-events: none;
        transform: translateY(8px);
        transition: opacity 0.25s, transform 0.25s;
        z-index: 200;
    }

    .back-to-top.visible {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }
}

@media (max-width: 400px) {
    .nav-links {
        gap: 0.5rem;
        font-size: 0.8rem;
    }

    .hero h1 {
        font-size: 1.5rem;
    }
}