/*
 * Omolah Network — new look (UI refresh). DESIGN_SYSTEM.md §7.
 *
 * Loaded after the Modernize template (public/dist/css/style.min.css or style-dark.min.css) by
 * resources/views/components/layout/ui-refresh.blade.php, only while App\Services\UiRefreshService::enabled().
 * Off (admin → Settings → Appearance, or UI_REFRESH=false) = this file is not loaded,
 * and every page looks exactly as before. So no page may depend on anything here.
 *
 * Only template variables (--bs-*) and template selectors. The font (Rubik, Arabic included) and the colors
 * of the identity are not changed (blue header, white sidebar, primary #5D87FF, yellow active link).
 */

/* 1. Shared values */
:root,
[data-bs-theme=light] {
    --bs-border-radius: 8px;
    --bs-border-radius-sm: 6px;
    --bs-border-radius-lg: 16px;
    --ui-shadow-card: 0 0 0 1px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .08);
    --ui-shadow-raised: 0 10px 30px rgba(16, 24, 40, .12), 0 2px 6px rgba(16, 24, 40, .06);
    --ui-focus-ring: 0 0 0 3px rgba(var(--bs-primary-rgb), .18);
}

/* 2. Page background (light only): white cards stand out from the page. Cards keep --bs-body-bg. */
body:not([data-theme]) {
    background-color: var(--bs-gray-100);
}

/* 3. Cards */
.card {
    --bs-card-border-radius: 12px;
    --bs-card-inner-border-radius: 12px;
}

body:not([data-theme]) .card {
    --bs-card-box-shadow: var(--ui-shadow-card);
}

/* 4. Buttons (.btn-sm and .btn-lg again after .btn, which would win otherwise) */
.btn {
    --bs-btn-border-radius: var(--bs-border-radius);
}

.btn-group-sm > .btn,
.btn-sm {
    --bs-btn-border-radius: var(--bs-border-radius-sm);
}

.btn-group-lg > .btn,
.btn-lg {
    --bs-btn-border-radius: 10px;
}

.btn-group {
    border-radius: var(--bs-border-radius);
}

/* 5. Fields */
.form-control,
.form-select,
.input-group-text {
    border-radius: var(--bs-border-radius);
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: rgba(var(--bs-primary-rgb), .55);
    box-shadow: var(--ui-focus-ring);
}

.select2-container--default .select2-selection--single,
.select2-container--default .select2-selection--multiple,
.select2-dropdown {
    border-radius: var(--bs-border-radius);
}

.table-responsive .dataTables_wrapper .dataTables_length select,
.table-responsive .dataTables_wrapper .dataTables_filter input {
    border-radius: var(--bs-border-radius);
}

/* 6. Sidebar links */
.sidebar-nav ul .sidebar-item .sidebar-link,
.sidebar-nav ul .sidebar-item .first-level .sidebar-item > .sidebar-link {
    border-radius: var(--bs-border-radius);
}

/* 7. Header: soft shadow under the fixed bar */
.app-header {
    box-shadow: 0 1px 4px rgba(16, 24, 40, .14);
}

/* 8. Menus, modals, badges, alerts */
.dropdown-menu {
    --bs-dropdown-border-radius: 10px;
}

body:not([data-theme]) .dropdown-menu {
    box-shadow: var(--ui-shadow-raised);
}

.modal {
    --bs-modal-border-radius: var(--bs-border-radius-lg);
    --bs-modal-inner-border-radius: calc(var(--bs-border-radius-lg) - 1px);
}

body:not([data-theme]) .modal {
    --bs-modal-box-shadow: var(--ui-shadow-raised);
}

.badge {
    --bs-badge-border-radius: 6px;
    --bs-badge-font-weight: 500;
}

.alert {
    --bs-alert-border-radius: 10px;
}

.swal2-popup {
    border-radius: var(--bs-border-radius-lg);
}

/* 9. Tables: light header row (light only) */
body:not([data-theme]) .table > thead {
    --bs-table-bg: var(--bs-gray-100);
}
