/* ==================== DOCS DASHBOARD STYLES ==================== */
/* Minimalistic Sidebar Layout - Documentation Portal */

:root {
    /* Color Palette - Navy Blue Theme */
    --docs-bg-primary: #0a0e17;
    --docs-bg-secondary: #0f1624;
    --docs-bg-tertiary: #162033;
    --docs-bg-elevated: #1c2a42;

    /* Accent Colors - Steel/Navy Blue */
    --docs-accent: #3b82f6;
    --docs-accent-light: #60a5fa;
    --docs-accent-dim: rgba(59, 130, 246, 0.12);
    --docs-accent-rgb: 59, 130, 246;

    /* Text Colors */
    --docs-text-primary: #f1f5f9;
    --docs-text-secondary: #94a3b8;
    --docs-text-muted: #64748b;

    /* Border Colors */
    --docs-border: #1e3a5f;
    --docs-border-light: #2a4a6f;

    /* Category Colors */
    --docs-ai: #60a5fa;
    --docs-python: #3b82f6;
    --docs-quality: #fbbf24;
    --docs-gamification: #ec4899;
    --docs-payments: #10b981;
    --docs-database: #f97316;
    --docs-analytics: #5eead4;

    /* Layout */
    --docs-sidebar-width: 260px;
    --docs-header-height: 56px;

    /* Transitions */
    --docs-transition-fast: 0.15s ease;
    --docs-transition-normal: 0.25s ease;
}

/* ==================== BASE RESET ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background: var(--docs-bg-primary);
    color: var(--docs-text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden;
}

form, #form1 {
    display: block !important;
    width: 100%;
    height: 100%;
    max-width: none;
}

/* ==================== APP LAYOUT ==================== */
.docs-app {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* ==================== SIDEBAR OVERLAY (Mobile) ==================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 90;
    opacity: 0;
    transition: opacity var(--docs-transition-normal);
}

.sidebar-overlay.active {
    opacity: 1;
}

/* ==================== SIDEBAR ==================== */
.docs-sidebar {
    width: var(--docs-sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--docs-bg-secondary);
    border-right: 1px solid var(--docs-border);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--docs-transition-normal);
}

/* Sidebar Brand */
.sidebar-brand {
    padding: 16px 18px;
    border-bottom: 1px solid var(--docs-border);
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.sidebar-brand:hover {
    text-decoration: none;
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--docs-accent), var(--docs-accent-light));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.brand-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--docs-bg-primary);
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--docs-text-primary);
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 10px;
    color: var(--docs-accent-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Sidebar Search */
.sidebar-search {
    padding: 12px 16px;
    border-bottom: 1px solid var(--docs-border);
    position: relative;
}

.sidebar-search input {
    width: 100%;
    padding: 8px 12px 8px 36px;
    background: var(--docs-bg-tertiary);
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    color: var(--docs-text-primary);
    font-size: 13px;
    outline: none;
    transition: all var(--docs-transition-fast);
}

.sidebar-search input::placeholder {
    color: var(--docs-text-muted);
}

.sidebar-search input:focus {
    border-color: var(--docs-accent);
    background: var(--docs-bg-elevated);
}

.sidebar-search .search-icon {
    position: absolute;
    left: 26px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    fill: var(--docs-text-muted);
    pointer-events: none;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--docs-border-light);
    border-radius: 3px;
}

.nav-section {
    margin-bottom: 4px;
}

.nav-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--docs-text-muted);
    padding: 12px 18px 6px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: var(--docs-text-secondary);
    text-decoration: none;
    transition: all var(--docs-transition-fast);
    border-left: 2px solid transparent;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--docs-text-primary);
    text-decoration: none;
}

.nav-item.active {
    background: var(--docs-accent-dim);
    color: var(--docs-accent-light);
    border-left-color: var(--docs-accent);
}

.nav-item.active .nav-icon svg {
    fill: var(--docs-accent);
}

.nav-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-icon svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.nav-text {
    font-size: 13px;
    font-weight: 500;
}

/* Sidebar Footer */
.sidebar-footer {
    border-top: 1px solid var(--docs-border);
    padding: 8px 0;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    color: var(--docs-text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--docs-transition-fast);
}

.footer-link:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--docs-text-primary);
    text-decoration: none;
}

.footer-link svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ==================== MAIN CONTENT AREA ==================== */
.docs-main {
    flex: 1;
    margin-left: var(--docs-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.docs-topbar {
    height: var(--docs-header-height);
    background: var(--docs-bg-secondary);
    border-bottom: 1px solid var(--docs-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid var(--docs-border);
    border-radius: 8px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    color: var(--docs-text-secondary);
    transition: all var(--docs-transition-fast);
}

.mobile-menu-btn:hover {
    background: var(--docs-bg-tertiary);
    color: var(--docs-text-primary);
}

.mobile-menu-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.page-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--docs-text-primary);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.version-badge {
    padding: 4px 10px;
    background: var(--docs-accent-dim);
    color: var(--docs-accent-light);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

/* ==================== PAGE CONTENT ==================== */
.docs-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

/* Sections */
.doc-section {
    display: none;
}

.doc-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.section-intro {
    margin-bottom: 24px;
}

.section-intro h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--docs-text-primary);
    margin-bottom: 8px;
}

.section-intro p {
    font-size: 14px;
    color: var(--docs-text-secondary);
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* Doc Link Card */
.doc-link-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    background: var(--docs-bg-secondary);
    border: 1px solid var(--docs-border);
    border-radius: 12px;
    text-decoration: none;
    transition: all var(--docs-transition-fast);
}

.doc-link-card:hover {
    border-color: var(--docs-accent);
    background: var(--docs-bg-tertiary);
    transform: translateX(4px);
    text-decoration: none;
}

.card-icon {
    width: 40px;
    height: 40px;
    background: var(--docs-accent-dim);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.card-icon svg {
    width: 20px;
    height: 20px;
    fill: var(--docs-accent);
}

/* Icon color variants */
.card-icon.ai svg { fill: var(--docs-ai); }
.card-icon.ai { background: rgba(59, 130, 246, 0.12); }

.card-icon.python svg { fill: var(--docs-python); }
.card-icon.python { background: rgba(59, 130, 246, 0.12); }

.card-icon.quality svg { fill: var(--docs-quality); }
.card-icon.quality { background: rgba(251, 191, 36, 0.12); }

.card-icon.gamification svg { fill: var(--docs-gamification); }
.card-icon.gamification { background: rgba(236, 72, 153, 0.12); }

.card-icon.payments svg { fill: var(--docs-payments); }
.card-icon.payments { background: rgba(16, 185, 129, 0.12); }

.card-icon.database svg { fill: var(--docs-database); }
.card-icon.database { background: rgba(249, 115, 22, 0.12); }

.card-icon.analytics svg { fill: var(--docs-analytics); }
.card-icon.analytics { background: rgba(94, 234, 212, 0.12); }

.card-content {
    flex: 1;
    min-width: 0;
}

.card-content h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--docs-text-primary);
    margin-bottom: 2px;
}

.card-content p {
    font-size: 12px;
    color: var(--docs-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-arrow {
    width: 18px;
    height: 18px;
    fill: var(--docs-text-muted);
    flex-shrink: 0;
    transition: all var(--docs-transition-fast);
}

.doc-link-card:hover .card-arrow {
    fill: var(--docs-accent);
    transform: translateX(4px);
}

/* ==================== ARCHITECTURE OVERVIEW ==================== */
.architecture-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.arch-item {
    padding: 16px;
    background: var(--docs-bg-secondary);
    border: 1px solid var(--docs-border);
    border-radius: 10px;
    text-align: center;
}

.arch-item.current {
    border-color: var(--docs-accent);
    background: var(--docs-accent-dim);
}

.arch-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 8px;
}

.arch-badge.main { background: rgba(74, 222, 128, 0.15); color: #4ade80; }
.arch-badge.services { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.arch-badge.docs { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.arch-badge.admin { background: rgba(249, 115, 22, 0.15); color: #fb923c; }

.arch-item h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--docs-text-primary);
    margin-bottom: 4px;
}

.arch-item p {
    font-size: 11px;
    color: var(--docs-text-muted);
}

/* ==================== SIDEBAR USER INFO ==================== */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--docs-border);
    background: var(--docs-bg-tertiary);
}

.user-avatar {
    width: 36px;
    height: 36px;
    background: var(--docs-accent-dim);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-avatar svg {
    width: 20px;
    height: 20px;
    fill: var(--docs-accent);
}

.user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-email {
    font-size: 12px;
    font-weight: 500;
    color: var(--docs-text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.logout-link {
    font-size: 11px;
    color: var(--docs-text-muted);
    text-decoration: none;
    transition: color var(--docs-transition-fast);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
}

.logout-link:hover {
    color: var(--docs-accent-light);
    text-decoration: underline;
}

/* ==================== AUTH BADGE ==================== */
.auth-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.auth-badge svg {
    flex-shrink: 0;
}

/* Auth Required Badge (for locked content) */
.auth-required-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    color: var(--docs-text-muted);
    opacity: 0.7;
    transition: all var(--docs-transition-fast);
}

.nav-item:hover .auth-required-badge {
    opacity: 1;
    color: var(--docs-accent-light);
}

.dev-docs-link {
    position: relative;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
    .docs-sidebar {
        transform: translateX(-100%);
    }

    .docs-sidebar.active {
        transform: translateX(0);
    }

    .sidebar-overlay {
        display: block;
    }

    .docs-main {
        margin-left: 0;
    }

    .mobile-menu-btn {
        display: flex;
    }
}

@media (max-width: 600px) {
    .docs-content {
        padding: 16px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .architecture-overview {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-intro h2 {
        font-size: 20px;
    }

    .page-title {
        font-size: 16px;
    }
}

@media (max-width: 400px) {
    .architecture-overview {
        grid-template-columns: 1fr;
    }
}
