/* ============================================================
   Front-End Dark Mode — Base Overrides
   Applied to ALL front themes via [data-bs-theme="dark"]
   ============================================================ */

/* ---------- Bootstrap core resets ---------- */
[data-bs-theme="dark"] body {
    color-scheme: dark;
}

/* ---------- Cookie consent bar ---------- */
[data-bs-theme="dark"] .cookies-consent-bar,
[data-bs-theme="dark"] .cookie-preferences-panel {
    background: #1e2130 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255,255,255,0.1) !important;
}
[data-bs-theme="dark"] .cookies-consent-bar a {
    color: #93c5fd !important;
}

/* ---------- Form controls ---------- */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #1a1d2e !important;
    color: #e0e0e0 !important;
    border-color: rgba(255,255,255,0.12) !important;
}
[data-bs-theme="dark"] .form-control::placeholder {
    color: #888 !important;
}
/* Keep placeholder transparent inside form-floating to prevent duplicate text */
[data-bs-theme="dark"] .form-floating > .form-control::placeholder,
[data-bs-theme="dark"] .form-floating > .form-select::placeholder {
    color: transparent !important;
}
/* Ensure form-floating labels look correct */
[data-bs-theme="dark"] .form-floating > label {
    color: #94a3b8 !important;
}
[data-bs-theme="dark"] .form-floating > .form-control:focus ~ label,
[data-bs-theme="dark"] .form-floating > .form-control:not(:placeholder-shown) ~ label {
    opacity: .65 !important;
}
[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    border-color: rgba(99,132,255,0.5) !important;
    box-shadow: 0 0 0 0.2rem rgba(99,132,255,0.15) !important;
}

/* ---------- Bootstrap cards ---------- */
[data-bs-theme="dark"] .card {
    background: #1e2130 !important;
    border-color: rgba(255,255,255,0.08) !important;
    color: #e0e0e0 !important;
}

/* ---------- Dropdown menus ---------- */
[data-bs-theme="dark"] .dropdown-menu {
    background: #1e2130 !important;
    border-color: rgba(255,255,255,0.1) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4) !important;
}
[data-bs-theme="dark"] .dropdown-item {
    color: #d0d0d0 !important;
}
[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background: rgba(255,255,255,0.06) !important;
    color: #fff !important;
}

/* ---------- Tables ---------- */
[data-bs-theme="dark"] .table {
    color: #d0d0d0 !important;
    --bs-table-bg: transparent;
    --bs-table-striped-bg: rgba(255,255,255,0.03);
    --bs-table-hover-bg: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.08) !important;
}

/* ---------- Modals ---------- */
[data-bs-theme="dark"] .modal-content {
    background: #1e2130 !important;
    color: #e0e0e0 !important;
    border-color: rgba(255,255,255,0.1) !important;
}
[data-bs-theme="dark"] .modal-header {
    border-color: rgba(255,255,255,0.08) !important;
}

/* ---------- Alerts ---------- */
[data-bs-theme="dark"] .alert-info {
    background: rgba(56,189,248,0.1) !important;
    color: #93c5fd !important;
    border-color: rgba(56,189,248,0.15) !important;
}

/* ---------- Toggle button styling ---------- */
.front-theme-toggle {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    color: inherit;
    cursor: pointer;
    padding: 0.35rem 0.55rem;
    border-radius: 0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.25s ease;
    line-height: 1;
}
.front-theme-toggle:hover {
    background: rgba(255,255,255,0.1);
}
[data-bs-theme="dark"] .front-theme-toggle {
    border-color: rgba(255,255,255,0.15);
    color: #fbbf24;
}
[data-bs-theme="dark"] .front-theme-toggle:hover {
    background: rgba(255,255,255,0.08);
}

/* ---------- Text / link helpers ---------- */
[data-bs-theme="dark"] .text-dark {
    color: #e0e0e0 !important;
}
[data-bs-theme="dark"] .text-muted {
    color: #9ca3af !important;
}
[data-bs-theme="dark"] a:not(.btn):not(.nav-link):not(.dropdown-item) {
    color: #93c5fd;
}
[data-bs-theme="dark"] hr {
    border-color: rgba(255,255,255,0.1);
}

/* ---------- Scrollbar (Webkit) ---------- */
[data-bs-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: #111322;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #3a3d50;
    border-radius: 4px;
}
[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #4a4d60;
}
