/*
 * theme-carbon.css  —  Dark Carbon
 * "Performance & focus" — deep backgrounds, high contrast, orange accent.
 *
 * Designed for dark mode only. The JS picker calls setColorTheme('carbon', true)
 * which automatically activates data-bs-theme="dark" alongside this file.
 *
 * Structure:
 *   [data-theme="carbon"]                     — orange primary (safe in light too)
 *   [data-bs-theme="dark"][data-theme="carbon"] — deep backgrounds, borders, text
 */

/* ── Primary orange — active in both light and dark ─────────────────────────── */
[data-theme="carbon"] {
    --tblr-primary:        #ff6b2b;
    --tblr-primary-rgb:    255, 107, 43;
    --tblr-primary-darken: #e55a1f;
    --tblr-primary-lt:     rgba(255, 107, 43, 0.12);
}

/* ── Full dark carbon ─────────────────────────────────────────────────────────
   Backgrounds, borders and text override Tabler's standard dark defaults.
   All DataTable + site-specific components that use these vars inherit
   automatically. Specific component overrides follow below.
   ─────────────────────────────────────────────────────────────────────────── */
[data-bs-theme="dark"][data-theme="carbon"] {
    /* Page / surface backgrounds */
    --tblr-body-bg:              #0f1117;
    --tblr-bg-surface:           #161b22;
    --tblr-bg-surface-secondary: #21262d;
    --tblr-bg-surface-tertiary:  #0f1117;

    /* Borders */
    --tblr-border-color:             #30363d;
    --tblr-border-color-translucent: rgba(48, 54, 61, 0.6);

    /* Text */
    --tblr-body-color:      #e6edf3;
    --tblr-secondary-color: #8b949e;
    --tblr-muted:           #6e7681;

    /* Status colours — shifted to match the carbon palette */
    --tblr-success:     #2ea043;
    --tblr-success-rgb: 46, 160, 67;
    --tblr-danger:      #f85149;
    --tblr-danger-rgb:  248, 81, 73;
    --tblr-warning:     #d29922;
    --tblr-warning-rgb: 210, 153, 34;
    --tblr-info:        #388bfd;
    --tblr-info-rgb:    56, 139, 253;
}

/* ── Body / page text (mirrors site.css dark override) ──────────────────────── */
[data-bs-theme="dark"][data-theme="carbon"] p,
[data-bs-theme="dark"][data-theme="carbon"] li,
[data-bs-theme="dark"][data-theme="carbon"] .card-text,
[data-bs-theme="dark"][data-theme="carbon"] .page-body,
[data-bs-theme="dark"][data-theme="carbon"] label:not(.form-check-label) {
    color: #e6edf3;
}

/* ── DataTables ──────────────────────────────────────────────────────────────── */
[data-bs-theme="dark"][data-theme="carbon"] table.dataTable thead th,
[data-bs-theme="dark"][data-theme="carbon"] table.dataTable thead td {
    background-color: #161b22;
    border-bottom-color: #30363d;
    color: #8b949e;
}
[data-bs-theme="dark"][data-theme="carbon"] table.dataTable tbody td {
    background-color: #21262d;
    color: #e6edf3;
}
[data-bs-theme="dark"][data-theme="carbon"] table.dataTable tbody tr {
    border-bottom-color: #30363d;
}
[data-bs-theme="dark"][data-theme="carbon"] table.dataTable tbody tr:hover > td {
    background-color: #2a3140 !important;
}
[data-bs-theme="dark"][data-theme="carbon"] table.dataTable tbody a {
    color: #ff8c55;
}
[data-bs-theme="dark"][data-theme="carbon"] table.dataTable tbody a:hover {
    color: #ffaa80;
}
[data-bs-theme="dark"][data-theme="carbon"] table.dataTable tbody tr.child td,
[data-bs-theme="dark"][data-theme="carbon"] table.dataTable tbody tr.dt-hasChild + tr td {
    background: rgba(255, 255, 255, 0.02);
    color: #e6edf3;
}
/* Sort arrows */
[data-bs-theme="dark"][data-theme="carbon"] table.dataTable thead .sorting::after {
    border-top-color: #6e7681;
}
[data-bs-theme="dark"][data-theme="carbon"] table.dataTable thead .sorting_asc::after {
    border-bottom-color: #ff6b2b;
}
[data-bs-theme="dark"][data-theme="carbon"] table.dataTable thead .sorting_desc::after {
    border-top-color: #ff6b2b;
}
/* DataTables controls */
[data-bs-theme="dark"][data-theme="carbon"] .dataTables_wrapper .dataTables_filter input,
[data-bs-theme="dark"][data-theme="carbon"] .dataTables_wrapper .dataTables_length select {
    background-color: #161b22;
    border-color: #30363d;
    color: #e6edf3;
}
[data-bs-theme="dark"][data-theme="carbon"] .dataTables_wrapper .dataTables_filter input:focus,
[data-bs-theme="dark"][data-theme="carbon"] .dataTables_wrapper .dataTables_length select:focus {
    border-color: #ff6b2b;
}
[data-bs-theme="dark"][data-theme="carbon"] .dataTables_wrapper .dataTables_filter label,
[data-bs-theme="dark"][data-theme="carbon"] .dataTables_wrapper .dataTables_length label,
[data-bs-theme="dark"][data-theme="carbon"] .dataTables_wrapper .dataTables_info {
    color: #8b949e;
}
[data-bs-theme="dark"][data-theme="carbon"] .dataTables_wrapper .dataTables_info,
[data-bs-theme="dark"][data-theme="carbon"] .dataTables_wrapper .dataTables_paginate {
    border-top-color: #30363d;
}
[data-bs-theme="dark"][data-theme="carbon"] .dataTables_wrapper .dataTables_paginate .paginate_button {
    color: #e6edf3 !important;
}
[data-bs-theme="dark"][data-theme="carbon"] .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: rgba(255, 107, 43, 0.1);
    border-color: #ff6b2b;
    color: #ff6b2b !important;
}
[data-bs-theme="dark"][data-theme="carbon"] .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: #ff6b2b;
    border-color: #ff6b2b;
    color: #fff !important;
}
[data-bs-theme="dark"][data-theme="carbon"] .dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    color: #30363d !important;
}

/* ── br_rides expanded child row ─────────────────────────────────────────────── */
[data-bs-theme="dark"][data-theme="carbon"] .ride-expand-body {
    background: #161b22;
    border-top-color: #30363d;
}
[data-bs-theme="dark"][data-theme="carbon"] .ride-expand-lbl { color: #6e7681; }
[data-bs-theme="dark"][data-theme="carbon"] .ride-expand-val { color: #c9d1d9; }

/* ── Cards ────────────────────────────────────────────────────────────────────── */
[data-bs-theme="dark"][data-theme="carbon"] .card {
    background-color: #161b22;
    border-color: #30363d;
}
[data-bs-theme="dark"][data-theme="carbon"] .card-header,
[data-bs-theme="dark"][data-theme="carbon"] .card-footer {
    border-color: #30363d;
    background-color: #161b22;
}

/* ── dt-admin-header border ──────────────────────────────────────────────────── */
[data-bs-theme="dark"][data-theme="carbon"] .dt-admin-header {
    border-bottom-color: #30363d;
}

/* ── Gradient card ─────────────────────────────────────────────────────────── */
[data-bs-theme="dark"][data-theme="carbon"] .card-gradient {
    background: linear-gradient(to bottom, rgba(255,107,43,.20) 0%, transparent 100%) !important;
    border-color: rgba(255,107,43,.32) !important;
}
