/* ============================================================
   LEADFLOW CRM — Documentation Page Styles
   ============================================================ */

:root {
    --docs-primary: #4f46e5;
    --docs-primary-light: #eef2ff;
    --docs-secondary: #0f172a;
    --docs-accent: #6366f1;
    --docs-success: #10b981;
    --docs-warning: #f59e0b;
    --docs-danger: #ef4444;
    --docs-bg: #f8fafc;
    --docs-card-bg: #ffffff;
    --docs-border: #e2e8f0;
    --docs-text: #334155;
    --docs-text-light: #64748b;
    --docs-sidebar-w: 280px;
}

/* ---- Layout ---- */
.docs-wrapper {
    display: flex;
    min-height: 100vh;
    background: var(--docs-bg);
}

/* ---- Sidebar Navigation ---- */
.docs-sidebar {
    width: var(--docs-sidebar-w);
    background: var(--docs-secondary);
    color: #fff;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1050;
    transition: transform 0.3s ease;
    padding-bottom: 30px;
}
.docs-sidebar::-webkit-scrollbar { width: 5px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }

.docs-sidebar-brand {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: #fff;
    text-decoration: none;
}
.docs-sidebar-brand i { color: var(--docs-accent); font-size: 22px; }
.docs-sidebar-brand span { color: var(--docs-accent); }

.docs-sidebar-category {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.35);
    padding: 20px 24px 8px;
}

.docs-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 24px;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    font-size: 13.5px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}
.docs-sidebar-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.04);
}
.docs-sidebar-link.active {
    color: #fff;
    background: rgba(99,102,241,0.12);
    border-left-color: var(--docs-accent);
}
.docs-sidebar-link i { font-size: 16px; width: 20px; text-align: center; }

/* ---- Main Content ---- */
.docs-main {
    flex: 1;
    margin-left: var(--docs-sidebar-w);
    min-height: 100vh;
}

.docs-topbar {
    background: #fff;
    border-bottom: 1px solid var(--docs-border);
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.docs-topbar-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--docs-secondary);
}
.docs-topbar-search {
    background: var(--docs-bg);
    border: 1px solid var(--docs-border);
    border-radius: 10px;
    padding: 8px 16px 8px 36px;
    font-size: 13px;
    width: 280px;
    outline: none;
    transition: all 0.2s;
}
.docs-topbar-search:focus {
    border-color: var(--docs-accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}

.docs-content {
    padding: 40px;
    max-width: 900px;
}

/* ---- Hero Banner ---- */
.docs-hero {
    background: linear-gradient(135deg, var(--docs-primary) 0%, #7c3aed 100%);
    border-radius: 20px;
    padding: 48px 44px;
    color: #fff;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
}
.docs-hero::after {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
    pointer-events: none;
}
.docs-hero::before {
    content: '';
    position: absolute;
    bottom: -80px;
    left: -40px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
}
.docs-hero h1 {
    font-family: 'Poppins', sans-serif;
    font-weight: 800;
    font-size: 32px;
    margin-bottom: 10px;
}
.docs-hero p {
    opacity: 0.85;
    font-size: 15px;
    max-width: 580px;
    line-height: 1.7;
}

/* ---- Section ---- */
.docs-section {
    margin-bottom: 48px;
    scroll-margin-top: 80px;
}
.docs-section-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 24px;
    color: var(--docs-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.docs-section-title .section-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #fff;
    flex-shrink: 0;
}
.docs-section-subtitle {
    color: var(--docs-text-light);
    font-size: 14px;
    margin-bottom: 24px;
}

/* ---- Step Cards ---- */
.docs-step-card {
    background: var(--docs-card-bg);
    border: 1px solid var(--docs-border);
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 16px;
    transition: all 0.25s;
    position: relative;
}
.docs-step-card:hover {
    border-color: var(--docs-accent);
    box-shadow: 0 8px 25px rgba(99,102,241,0.06);
    transform: translateY(-2px);
}

.docs-step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--docs-accent), #7c3aed);
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.docs-step-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--docs-secondary);
    margin-bottom: 6px;
}
.docs-step-desc {
    font-size: 13.5px;
    color: var(--docs-text);
    line-height: 1.7;
    margin: 0;
}

/* ---- Info Boxes ---- */
.docs-info-box {
    border-radius: 12px;
    padding: 16px 20px;
    margin: 16px 0;
    font-size: 13.5px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    line-height: 1.6;
}
.docs-info-box.tip {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}
.docs-info-box.warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}
.docs-info-box.info {
    background: var(--docs-primary-light);
    border: 1px solid #c7d2fe;
    color: #3730a3;
}

/* ---- Role Badges ---- */
.docs-role-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.docs-role-badge.owner { background: rgba(99,102,241,0.1); color: #4f46e5; }
.docs-role-badge.admin { background: rgba(16,185,129,0.1); color: #059669; }
.docs-role-badge.agent { background: rgba(245,158,11,0.1); color: #d97706; }

/* ---- Table of Contents ---- */
.docs-toc {
    background: var(--docs-card-bg);
    border: 1px solid var(--docs-border);
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 36px;
}
.docs-toc-title {
    font-weight: 700;
    font-size: 15px;
    color: var(--docs-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.docs-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 24px;
}
.docs-toc-list a {
    color: var(--docs-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}
.docs-toc-list a:hover { color: var(--docs-accent); }
.docs-toc-list a i { font-size: 14px; color: var(--docs-accent); }

/* ============ Keyboard shortcut badge ============ */
.docs-kbd {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 2px 8px;
    font-family: 'SF Mono', 'Cascadia Code', monospace;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

/* ---- Mobile Toggle ---- */
.docs-mobile-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--docs-accent);
    color: #fff;
    border: none;
    font-size: 20px;
    z-index: 1100;
    box-shadow: 0 6px 20px rgba(99,102,241,0.4);
    cursor: pointer;
}

/* ---- Responsive ---- */
@media (max-width: 992px) {
    .docs-sidebar {
        transform: translateX(-100%);
    }
    .docs-sidebar.show {
        transform: translateX(0);
    }
    .docs-main {
        margin-left: 0;
    }
    .docs-content {
        padding: 24px 20px;
    }
    .docs-topbar {
        padding: 14px 20px;
    }
    .docs-topbar-search { width: 180px; }
    .docs-hero {
        padding: 32px 24px;
    }
    .docs-hero h1 { font-size: 24px; }
    .docs-toc-list { grid-template-columns: 1fr; }
    .docs-mobile-toggle { display: flex; align-items: center; justify-content: center; }
}

/* ---- Sidebar overlay for mobile ---- */
.docs-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 1040;
}
.docs-overlay.show { display: block; }

/* ---- Smooth scroll ---- */
html { scroll-behavior: smooth; }
