/* ============================================================================
   vg-select2-theme.css
   ----------------------------------------------------------------------------
   Canonical Select2 theme for the whole app. Loaded by Views/Shared/_VgThemeHead
   (which every layout + auth page includes), layered on top of the Select2 base
   stylesheet (select2.min.css, pulled in by the dashboard layouts).

   Every <select> enhanced with Select2 becomes a searchable, rounded dropdown
   that follows the active --vg-* theme variables (defined in vg-dashboard-theme.css),
   so it recolours automatically when the theme changes.

   NOTE: this file MUST exist. A dangling ~/css/vg-select2-theme.css reference in
   _VgThemeHead previously 404'd on every page; on the post-login role picker that
   404 was routed to /Auth/Login, whose action clears the pending-role session,
   which silently broke "Choose your role -> Continue" (it bounced back to login).
   ========================================================================== */

.select2-container { width: 100% !important; }

/* ── Single-select control ── */
.select2-container--default .select2-selection--single {
    background-color: var(--vg-card-bg, #f8f9fc);
    border: 1px solid var(--vg-card-border, #e0e3eb);
    border-radius: 10px;
    height: 44px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--single {
    border-color: var(--vg-hero-bg, #534ab7) !important;
    box-shadow: 0 0 0 .14rem rgba(var(--vg-hero-rgb, 83,74,183), .18) !important;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
    color: var(--vg-text-primary, #0f172a);
    font-size: .9rem;
    line-height: 42px;
    padding-left: 6px;
}
.select2-container--default .select2-selection--single .select2-selection__placeholder { color: var(--vg-text-muted, #94a3b8); }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 42px; right: 12px; }
.select2-container--default .select2-selection--single .select2-selection__arrow b { border-color: var(--vg-hero-bg, #534ab7) transparent transparent; }

/* ── Multi-select control ── */
.select2-container--default .select2-selection--multiple {
    background-color: var(--vg-card-bg, #f8f9fc);
    border: 1px solid var(--vg-card-border, #e0e3eb);
    border-radius: 10px;
    min-height: 44px;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: rgba(var(--vg-hero-rgb, 83,74,183), .12);
    border: none;
    color: var(--vg-hero-bg, #534ab7);
    border-radius: 7px;
    padding: 2px 8px;
}

/* ── Open dropdown panel ── */
.select2-container--open { z-index: 99999; }
.select2-dropdown {
    background: var(--vg-card-bg, #fff) !important;
    border: 1px solid var(--vg-card-border, #e8eaf2);
    border-radius: 12px;
    box-shadow: var(--vg-shadow-md, 0 14px 34px rgba(83,74,183,.16));
    overflow: hidden;
    margin-top: 4px;
    z-index: 99999;
}
.select2-search--dropdown .select2-search__field {
    border: 1px solid var(--vg-card-border, #e0e3eb);
    border-radius: 8px;
    padding: 8px 10px;
    outline: none;
    background: var(--vg-card-bg, #fff);
    color: var(--vg-text-primary, #0f172a);
}

/* ── Result options: always opaque + readable (kill any inherited fade/grey). ── */
.select2-container--default .select2-results__option {
    padding: 11px 14px;
    font-size: .88rem;
    color: var(--vg-text-primary, #334155) !important;
    background-color: transparent !important;
    opacity: 1 !important;
}
/* Hover / keyboard highlight — force the theme colour over Select2's default grey/blue. */
.select2-container--default .select2-results__option--highlighted,
.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: var(--vg-hero-bg, #534ab7) !important;
    color: #fff !important;
}
/* Currently-selected option — light theme tint, still readable. */
.select2-container--default .select2-results__option[aria-selected=true] {
    background-color: rgba(var(--vg-hero-rgb, 83,74,183), .10) !important;
    color: var(--vg-hero-bg, #534ab7) !important;
}

/* Keep DataTables' own page-length menu as the native control. */
.dataTables_length select { height: auto; }
