/*
|--------------------------------------------------------------------------
| GLOBAL OVERRIDE – YNEX
| Primary Color : #a15adf (purple — warna asal tema Ynex)
|--------------------------------------------------------------------------
*/

/* ==================================================
   BUTTONS (Bootstrap)
   ================================================== */

.btn-primary {
    background-color: #a15adf !important;
    border-color: #a15adf !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active {
    background-color: #8a3dc4 !important;
    border-color: #8a3dc4 !important;
}

/* ===============================
   BUTTON - OUTLINE PRIMARY
   =============================== */

.btn-outline-primary {
    color: #a15adf !important;
    border-color: #a15adf !important;
    background-color: transparent !important;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    color: #ffffff !important;
    background-color: #a15adf !important;
    border-color: #a15adf !important;
}

.btn-outline-primary:active,
.btn-outline-primary.active {
    color: #ffffff !important;
    background-color: #8a3dc4 !important;
    border-color: #8a3dc4 !important;
}

.btn-outline-primary:disabled,
.btn-outline-primary.disabled {
    color: #a15adf !important;
    background-color: transparent !important;
    border-color: #a15adf !important;
    opacity: 0.5;
}

/* =================================
   SWEETALERT2 BUTTON - FULL OVERRIDE
   ================================= */

.swal2-confirm.swal2-styled {
    background-color: #a15adf !important;
    color: #ffffff !important;
    border: none !important;

    box-shadow: none !important;
    filter: none !important;
    outline: none !important;

    --swal2-action-button-focus-box-shadow: none;
}

.swal2-confirm.swal2-styled:hover {
    background-color: #8a3dc4 !important;
    box-shadow: none !important;
    filter: none !important;
}

.swal2-confirm.swal2-styled:focus,
.swal2-confirm.swal2-styled:focus-visible {
    background-color: #a15adf !important;
    box-shadow: none !important;
    filter: none !important;
    outline: none !important;
}

.swal2-confirm.swal2-styled:active {
    background-color: #7a2fb0 !important;
}

/* ==================================================
   PAGINATION (Bootstrap / DataTables)
   ================================================== */

.page-item .page-link {
    color: #a15adf !important;
}

.page-item .page-link:hover {
    color: #a15adf !important;
    background-color: rgba(161, 90, 223, 0.1) !important;
    border-color: #a15adf !important;
}

.page-item.active .page-link {
    color: #ffffff !important;
    background-color: #a15adf !important;
    border-color: #a15adf !important;
}

.page-item .page-link:focus {
    box-shadow: 0 0 0 0.15rem rgba(161, 90, 223, 0.35) !important;
}

/* ==================================================
   NAV LINKS (Underline Active Only)
   ================================================== */

.nav-link {
    position: relative;
    display: inline-block;
}

.nav-link.active {
    color: #a15adf !important;
    background-color: transparent !important;
    font-weight: 600;
}

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 100%;
    height: 2px;
    background-color: #a15adf;
    transform: translateX(-50%);
}

/* ==================================================
   FORM CONTROLS — Border lebih tegas
   ================================================== */

.form-control,
.form-select {
    border-color: #e9edf6 !important;
}

.form-check-input {
    border-color: #b0b8d0 !important;
}

.form-check-input:checked {
    background-color: #a15adf !important;
    border-color: #a15adf !important;
}

.form-check-input:focus {
    border-color: #a15adf !important;
    box-shadow: 0 0 0 0.18rem rgba(161, 90, 223, .2) !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #a15adf !important;
    box-shadow: 0 0 0 0.2rem rgba(161, 90, 223, 0.18) !important;
}

.form-control:disabled,
.form-select:disabled {
    border-color: #b0bec5 !important;
    opacity: 0.7;
}

/* ==================================================
   DROPDOWN LOGOUT BUTTON
   ================================================== */

.header-profile-dropdown .btn-logout:hover {
    background-color: rgba(220,53,69,.2) !important;
    color: #dc3545 !important;
}

/* Dark mode */
[data-theme-mode="dark"] .form-control,
[data-theme-mode="dark"] .form-select {
    border-color: #5a6a7e !important;
}

[data-theme-mode="dark"] .form-control:focus,
[data-theme-mode="dark"] .form-select:focus {
    border-color: #4a8fd4 !important;
    box-shadow: 0 0 0 0.2rem rgba(161, 90, 223, 0.2) !important;
}

/* ==================================================
   SELECT2 — Global border sesuai form control
   ================================================== */

/* Pindahkan border ke container luar, prefix body untuk specificity lebih tinggi */
body .select2-container--default .select2-selection--single,
body .select2-container--default .select2-selection--multiple {
    border: 1px solid var(--input-border) !important;
    border-radius: 6px !important;
}

/* Hapus border dari __rendered agar tidak dobel */
body .select2-container--default .select2-selection--single .select2-selection__rendered {
    border: none !important;
    border-radius: 0 !important;
}

body .select2-container--default.select2-container--focus .select2-selection--single,
body .select2-container--default.select2-container--focus .select2-selection--multiple,
body .select2-container--open .select2-selection--single,
body .select2-container--open .select2-selection--multiple {
    border-color: #a15adf !important;
    box-shadow: 0 0 0 0.18rem rgba(161, 90, 223, .18) !important;
    outline: none !important;
}

body .select2-dropdown {
    border: 1px solid var(--input-border) !important;
    border-radius: 6px !important;
}

.select2-container--default .select2-results__option--highlighted {
    background-color: #a15adf !important;
}

.select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #aaa;
}

body .select2-search--dropdown .select2-search__field {
    border-color: var(--input-border) !important;
    border-radius: 4px !important;
    outline: none !important;
}

body .select2-search--dropdown .select2-search__field:focus {
    border-color: #a15adf !important;
    box-shadow: 0 0 0 0.18rem rgba(161, 90, 223, .18) !important;
}
/* ED warning badge pulse animation — merah #dc3545 */
.pulse.pulse-danger,
#ed-warning-badge {
    animation: pulse-danger 2s infinite !important;
}
@-webkit-keyframes pulse-danger {
    0%   { -webkit-box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.5); }
    70%  { -webkit-box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { -webkit-box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}
@keyframes pulse-danger {
    0%   { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.5); }
    70%  { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}
