/**
 * Bootstrap 5.3 dark theme - Zephyr-inspired RepoLens (DASH branding)
 */
:root,
[data-bs-theme="dark"] {
    --bs-body-font-family: "Manrope", system-ui, sans-serif;
    --bs-body-bg: #050505;
    --bs-body-color: #ffffff;
    --bs-secondary-bg: #0a0a0a;
    --bs-tertiary-bg: #141414;
    --bs-border-color: rgba(255, 255, 255, 0.08);
    --bs-primary: #ffffff;
    --bs-primary-rgb: 255, 255, 255;
    --bs-link-color: #e5e5e5;
    --bs-link-hover-color: #ffffff;
}

html[data-bs-theme="dark"] .form-control,
html[data-bs-theme="dark"] .form-select {
    background-color: #0a0a0a;
    border-color: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}

html[data-bs-theme="dark"] .form-control:focus,
html[data-bs-theme="dark"] .form-select:focus {
    background-color: #0a0a0a;
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

/* Offcanvas sidebar: permanent column on lg+ (collapsible via body.sidebar-collapsed) */
@media (min-width: 992px) {
    .sidebar.offcanvas-lg {
        position: sticky;
        top: 0;
        transform: translate3d(0, 0, 0) !important;
        visibility: visible !important;
        display: flex !important;
        flex-direction: column;
        width: var(--sidebar-width, 280px);
        min-width: var(--sidebar-width, 280px);
        height: 100dvh;
        z-index: 100;
        border-right: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
        flex-shrink: 0;
        transition:
            transform var(--duration-slow, 0.38s) var(--ease-spring, ease),
            width var(--duration-slow, 0.38s) ease,
            min-width var(--duration-slow, 0.38s) ease,
            visibility var(--duration-slow, 0.38s) ease;
    }

    body.sidebar-collapsed .sidebar.offcanvas-lg {
        transform: translate3d(-100%, 0, 0) !important;
        visibility: hidden !important;
        pointer-events: none;
        width: 0 !important;
        min-width: 0 !important;
        border-right-width: 0;
        overflow: hidden;
    }

    .sidebar.offcanvas-lg .offcanvas-header {
        display: none !important;
    }

    .sidebar.offcanvas-lg .btn-close {
        display: none;
    }
}

@media (max-width: 991.98px) {
    .sidebar.offcanvas {
        width: min(88vw, 300px);
    }
}

.app-bootstrap {
    display: flex;
    min-height: 100dvh;
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
}

.app-bootstrap > .main {
    flex: 1;
    min-width: 0;
}

.task-status-download.btn {
    --bs-btn-font-weight: 600;
}

/* Zephyr pill buttons - white primary CTAs */
html[data-bs-theme="dark"] .btn {
    --bs-btn-border-radius: 999px;
    --bs-btn-box-shadow: none;
}

html[data-bs-theme="dark"] .btn-primary {
    --bs-btn-bg: #ffffff;
    --bs-btn-border-color: #ffffff;
    --bs-btn-color: #050505;
    --bs-btn-hover-bg: #e8e8e8;
    --bs-btn-hover-border-color: #e8e8e8;
    --bs-btn-hover-color: #050505;
    --bs-btn-active-bg: #d4d4d4;
    --bs-btn-active-border-color: #d4d4d4;
    --bs-btn-active-color: #050505;
    --bs-btn-disabled-bg: #262626;
    --bs-btn-disabled-border-color: #262626;
    --bs-btn-disabled-color: #737373;
}

html[data-bs-theme="dark"] .btn-secondary {
    --bs-btn-bg: rgba(255, 255, 255, 0.04);
    --bs-btn-border-color: rgba(255, 255, 255, 0.14);
    --bs-btn-color: #e5e5e5;
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.08);
    --bs-btn-hover-border-color: rgba(255, 255, 255, 0.22);
    --bs-btn-hover-color: #ffffff;
    --bs-btn-active-bg: rgba(255, 255, 255, 0.1);
    --bs-btn-active-border-color: rgba(255, 255, 255, 0.28);
    --bs-btn-disabled-bg: rgba(255, 255, 255, 0.02);
    --bs-btn-disabled-border-color: rgba(255, 255, 255, 0.08);
}

html[data-bs-theme="dark"] .btn-outline-primary {
    --bs-btn-color: #ffffff;
    --bs-btn-border-color: rgba(255, 255, 255, 0.22);
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.08);
    --bs-btn-hover-border-color: rgba(255, 255, 255, 0.35);
    --bs-btn-hover-color: #ffffff;
}

html[data-bs-theme="dark"] .btn-outline-secondary {
    --bs-btn-color: #a3a3a3;
    --bs-btn-border-color: rgba(255, 255, 255, 0.14);
    --bs-btn-hover-bg: rgba(255, 255, 255, 0.06);
    --bs-btn-hover-border-color: rgba(255, 255, 255, 0.22);
    --bs-btn-hover-color: #ffffff;
}

.org-stats-cards.row > .col {
    min-width: 0;
}

.table-responsive.repolens-table-scroll {
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    border-radius: var(--radius-md, 12px);
}
