/* ==========================================================================
   Learnix LMS — Modern Global SweetAlert2 Theme & Design System
   ========================================================================== */

/* 1. Backdrop Container */
.swal2-container {
    z-index: 999999 !important;
}

.swal2-container.swal2-backdrop-show:not(.swal2-top-end):not(.swal2-top-start):not(.swal2-bottom-end):not(.swal2-bottom-start) {
    background: rgba(15, 23, 42, 0.55) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    transition: background-color 0.25s ease-in-out;
}

/* 2. Main Popup Modal Box (Standard Dialogs) */
.swal2-popup:not(.swal2-toast) {
    border-radius: 22px !important;
    padding: 2.25rem 2rem 2rem !important;
    background: #ffffff !important;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.22), 
                0 0 0 1px rgba(226, 232, 240, 0.9) !important;
    font-family: inherit !important;
    border: none !important;
    overflow: hidden;
}

.swal2-popup.swal2-show:not(.swal2-toast) {
    animation: swal2-custom-show 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

.swal2-popup.swal2-hide:not(.swal2-toast) {
    animation: swal2-custom-hide 0.15s cubic-bezier(0.4, 0, 1, 1) forwards !important;
}

@keyframes swal2-custom-show {
    0% {
        opacity: 0;
        transform: scale(0.94) translateY(8px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes swal2-custom-hide {
    0% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.94) translateY(8px);
    }
}

/* 3. Toast Notifications (Sleek & Unobtrusive) */
.swal2-popup.swal2-toast {
    flex-direction: row !important;
    align-items: center !important;
    width: auto !important;
    min-width: 300px !important;
    max-width: 440px !important;
    padding: 12px 18px !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    box-shadow: 0 12px 35px -8px rgba(15, 23, 42, 0.2), 0 0 0 1px rgba(226, 232, 240, 0.9) !important;
    gap: 12px !important;
    border: none !important;
    margin: 12px !important;
}

.swal2-popup.swal2-toast .swal2-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
}

.swal2-popup.swal2-toast .swal2-html-container {
    font-size: 13px !important;
    color: #475569 !important;
    margin: 2px 0 0 !important;
    padding: 0 !important;
    text-align: left !important;
    line-height: 1.4 !important;
}

.swal2-popup.swal2-toast .swal2-icon {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    margin: 0 !important;
    border-width: 2px !important;
    font-size: 14px !important;
}

.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content {
    font-size: 14px !important;
    line-height: 26px !important;
    font-weight: 700 !important;
}

.swal2-popup.swal2-toast .swal2-actions {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 4. Modal Title */
.swal2-popup:not(.swal2-toast) .swal2-title {
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0.75rem 0 0.4rem !important;
    padding: 0 !important;
    line-height: 1.35 !important;
    letter-spacing: -0.015em !important;
    text-align: center !important;
}

/* 5. Text & HTML Container */
.swal2-popup:not(.swal2-toast) .swal2-html-container {
    font-size: 0.95rem !important;
    color: #475569 !important;
    margin: 0.4rem 0 1.5rem !important;
    padding: 0 12px !important;
    line-height: 1.6 !important;
    font-weight: 400 !important;
    text-align: center !important;
    overflow: visible !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

/* ==========================================================================
   SweetAlert Form Popups & Custom Modal Content — Premium Modern Design System
   ========================================================================== */

/* 1. CRITICAL: Strictly Hide SweetAlert2 Built-in Form Elements that Leak into Popups */
.swal2-popup > .swal2-checkbox,
.swal2-popup > .swal2-input,
.swal2-popup > .swal2-file,
.swal2-popup > .swal2-range,
.swal2-popup > .swal2-select,
.swal2-popup > .swal2-radio,
.swal2-popup > .swal2-textarea,
.swal2-popup > .swal2-validation-message,
.swal2-popup label.swal2-checkbox,
.swal2-popup .swal2-checkbox {
    display: none !important;
}

/* 2. Modal Window Container */
.swal2-popup:has(.custom-modal-body),
.swal2-popup:has(form),
.swal2-popup:has(.chapter-form),
.swal2-popup:has(.js-form),
.swal2-popup:has(.js-content-form),
.swal2-popup:has(#changeChapterModalHtml),
.swal2-popup:has(#webinarTicketModal),
.swal2-popup:has(#webinarFaqModal),
.swal2-popup:has(#webinarPrerequisitesModal),
.swal2-popup:has(#quizzesModal) {
    padding: 0 !important;
    border-radius: 20px !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(15, 23, 42, 0.05) !important;
    overflow: hidden !important;
}

.swal2-popup:not(.swal2-toast) .swal2-html-container.text-left,
.swal2-popup:not(.swal2-toast) .swal2-html-container:has(form),
.swal2-popup:not(.swal2-toast) .swal2-html-container:has(.form-group),
.swal2-popup:not(.swal2-toast) .swal2-html-container:has(.custom-modal-body),
.swal2-popup:not(.swal2-toast) .swal2-html-container:has(.js-form),
.swal2-popup:not(.swal2-toast) .swal2-html-container:has(.js-content-form),
.swal2-popup:not(.swal2-toast) .swal2-html-container:has(.chapter-form),
.swal2-popup .custom-modal-body,
.swal2-popup .modal-body,
.swal2-popup form,
.swal2-popup .js-form,
.swal2-popup .js-content-form,
.swal2-popup .chapter-form,
.swal2-popup .session-form,
.swal2-popup .file-form {
    text-align: left !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 3. Modal Header / Title */
.custom-modal-body .modal-header,
.swal2-popup .modal-header {
    padding: 18px 26px !important;
    border-bottom: 1px solid #f1f5f9 !important;
    background: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    border-top-left-radius: 20px !important;
    border-top-right-radius: 20px !important;
}

.custom-modal-body .modal-header .section-title,
.swal2-popup .modal-header .section-title {
    padding: 0 !important;
    border-bottom: none !important;
    margin: 0 !important;
    font-size: 1.18rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.02em !important;
    line-height: 1.3 !important;
}

.custom-modal-body > .section-title,
.swal2-popup > div > .section-title,
.swal2-popup form > .section-title,
.swal2-popup:has(form) .swal2-title,
.swal2-popup:has(.form-group) .swal2-title,
.swal2-popup:has(.custom-modal-body) .swal2-title {
    font-size: 1.18rem !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    letter-spacing: -0.02em !important;
    padding: 18px 26px !important;
    margin: 0 !important;
    background: #ffffff !important;
    border-bottom: 1px solid #f1f5f9 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    text-align: left !important;
    position: relative !important;
}

.custom-modal-body .section-title.after-line:after,
.swal2-popup .section-title.after-line:after {
    display: none !important;
}

.modal-header-close-btn,
.custom-modal-body .modal-header button.close-swl.modal-header-close-btn,
.swal2-popup .modal-header button.close-swl.modal-header-close-btn {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    max-width: 34px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    border: 1px solid #e2e8f0 !important;
    background: #f8fafc !important;
    color: #64748b !important;
    font-size: 13px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.15s ease-in-out !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.modal-header-close-btn:hover,
.custom-modal-body .modal-header button.close-swl.modal-header-close-btn:hover,
.swal2-popup .modal-header button.close-swl.modal-header-close-btn:hover {
    background: #fee2e2 !important;
    color: #ef4444 !important;
    border-color: #fecaca !important;
    transform: none !important;
}

/* 4. Modal Body Content & Form Groups */
.custom-modal-body .js-content-form,
.custom-modal-body .chapter-form,
.custom-modal-body .change-chapter-form,
.custom-modal-body .js-form,
.swal2-popup form,
.swal2-popup .js-content-form,
.swal2-popup .js-form,
.swal2-popup .js-faq-form,
.swal2-popup .js-prerequisites-form {
    padding: 24px 28px 16px 28px !important;
    margin-top: 0 !important;
}

.swal2-popup .form-group,
.custom-modal-body .form-group,
.modal-body .form-group {
    text-align: left !important;
    margin-bottom: 20px !important;
}

.swal2-popup .form-group > label.input-label,
.swal2-popup .form-group > label:not(.custom-control-label):not(.js-switch),
.custom-modal-body .form-group > label.input-label,
.custom-modal-body .form-group > label:not(.custom-control-label):not(.js-switch),
.modal-body .form-group > label.input-label,
.modal-body .form-group > label:not(.custom-control-label):not(.js-switch),
.input-label {
    text-align: left !important;
    display: block !important;
    width: 100% !important;
    margin-bottom: 8px !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    color: #334155 !important;
    letter-spacing: 0.01em !important;
    float: none !important;
}

/* 5. Inputs, Selects, and Textareas */
.swal2-popup .form-control,
.swal2-popup .custom-select,
.swal2-popup select.form-control,
.swal2-popup textarea.form-control,
.custom-modal-body .form-control,
.custom-modal-body .custom-select,
.custom-modal-body select.form-control,
.custom-modal-body textarea.form-control,
.modal-body .form-control,
.modal-body .custom-select,
.modal-body select.form-control,
.modal-body textarea.form-control {
    height: 46px !important;
    padding: 10px 16px !important;
    font-size: 14.5px !important;
    color: #0f172a !important;
    background-color: #f8fafc !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: none !important;
    text-align: left !important;
    text-align-last: left !important;
    direction: ltr !important;
}

.custom-modal-body textarea.form-control,
.swal2-popup textarea.form-control,
.modal-body textarea.form-control {
    height: auto !important;
    min-height: 110px !important;
}

.custom-modal-body .form-control:hover,
.custom-modal-body .custom-select:hover,
.swal2-popup .form-control:hover,
.swal2-popup .custom-select:hover {
    border-color: #cbd5e1 !important;
    background-color: #ffffff !important;
}

.custom-modal-body .form-control:focus,
.custom-modal-body .custom-select:focus,
.swal2-popup .form-control:focus,
.swal2-popup .custom-select:focus {
    background-color: #ffffff !important;
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12) !important;
    outline: none !important;
}

/* Select options */
.swal2-popup select option,
.custom-modal-body select option,
.modal-body select option {
    text-align: left !important;
    direction: ltr !important;
    padding: 8px 12px !important;
    font-size: 14px !important;
    color: #0f172a !important;
}

/* Select2 containers inside modals */
.swal2-popup .select2-container--default .select2-selection--single,
.custom-modal-body .select2-container--default .select2-selection--single,
.modal-body .select2-container--default .select2-selection--single {
    height: 46px !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 12px !important;
    background-color: #f8fafc !important;
    display: flex !important;
    align-items: center !important;
}

.swal2-popup .select2-container--default .select2-selection--single .select2-selection__rendered,
.custom-modal-body .select2-container--default .select2-selection--single .select2-selection__rendered,
.modal-body .select2-container--default .select2-selection--single .select2-selection__rendered {
    text-align: left !important;
    padding-left: 16px !important;
    color: #0f172a !important;
    font-size: 14.5px !important;
    line-height: 44px !important;
}

/* 6. Settings Switch Cards (Active & Passes) */
.custom-modal-body .form-group.js-switch-parent,
.custom-modal-body .form-group.d-flex.justify-content-between,
.swal2-popup .form-group.js-switch-parent,
.swal2-popup .form-group.d-flex.justify-content-between {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 14px 18px !important;
    margin-bottom: 16px !important;
    transition: all 0.2s ease !important;
}

.custom-modal-body .form-group.js-switch-parent:hover,
.swal2-popup .form-group.js-switch-parent:hover {
    background: #f1f5f9 !important;
    border-color: #cbd5e1 !important;
}

.custom-modal-body .form-group.js-switch-parent label.js-switch,
.swal2-popup .form-group.js-switch-parent label.js-switch {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #1e293b !important;
    margin: 0 !important;
    cursor: pointer !important;
    user-select: none !important;
}

/* Modern iOS-Style Toggle Switch */
.custom-switch {
    padding-left: 0 !important;
    margin: 0 !important;
    height: 24px !important;
    display: inline-flex !important;
    align-items: center !important;
}

.custom-switch .custom-control-input {
    display: none !important;
}

.custom-switch .custom-control-label {
    position: relative !important;
    display: inline-block !important;
    width: 44px !important;
    height: 24px !important;
    padding: 0 !important;
    margin: 0 !important;
    cursor: pointer !important;
}

.custom-switch .custom-control-label::before {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 44px !important;
    height: 24px !important;
    background-color: #cbd5e1 !important;
    border: none !important;
    border-radius: 24px !important;
    transition: background-color 0.25s ease !important;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08) !important;
}

.custom-switch .custom-control-label::after {
    position: absolute !important;
    top: 2px !important;
    left: 2px !important;
    width: 20px !important;
    height: 20px !important;
    background-color: #ffffff !important;
    border-radius: 50% !important;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2) !important;
    content: "" !important;
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::before {
    background-color: #2563eb !important;
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::after {
    transform: translateX(20px) !important;
    background-color: #ffffff !important;
}

/* 7. Modal Footer & Action Buttons */
.modal-footer-actions,
.custom-modal-body .modal-footer-actions,
.swal2-popup .modal-footer-actions,
.custom-modal-body .d-flex.justify-content-end.mt-3,
.custom-modal-body .mt-30.d-flex.justify-content-end,
.swal2-popup .d-flex.justify-content-end.mt-3,
.swal2-popup .mt-30.d-flex.justify-content-end,
.swal2-popup .modal-footer {
    margin: 24px -28px -16px -28px !important;
    padding: 14px 24px !important;
    background: #f8fafc !important;
    border-top: 1px solid #e2e8f0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 10px !important;
    border-bottom-left-radius: 20px !important;
    border-bottom-right-radius: 20px !important;
}

/* Primary Action Button (Save) */
.modal-footer-actions .save-chapter,
.modal-footer-actions .save-change-chapter,
.modal-footer-actions .btn-primary,
.custom-modal-body .save-chapter,
.custom-modal-body .save-change-chapter,
.custom-modal-body #saveTicket,
.custom-modal-body #saveFAQ,
.custom-modal-body #savePrerequisites,
.custom-modal-body #saveQuiz,
.custom-modal-body #saveExtraDescription,
.swal2-popup #saveChapter,
.swal2-popup #saveTicket,
.swal2-popup #saveFAQ,
.swal2-popup #savePrerequisites,
.swal2-popup #saveQuiz,
.swal2-popup #saveExtraDescription,
.swal2-popup .save-chapter,
.swal2-popup .save-change-chapter,
.swal2-popup .btn-primary:not(.swal2-styled) {
    background: #2563eb !important;
    border: 1px solid #2563eb !important;
    color: #ffffff !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    padding: 8px 22px !important;
    height: 38px !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25) !important;
    transition: all 0.15s ease-in-out !important;
    cursor: pointer !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal-footer-actions .save-chapter:hover,
.modal-footer-actions .save-change-chapter:hover,
.modal-footer-actions .btn-primary:hover,
.custom-modal-body .save-chapter:hover,
.custom-modal-body .save-change-chapter:hover,
.custom-modal-body #saveTicket:hover,
.custom-modal-body #saveFAQ:hover,
.custom-modal-body #savePrerequisites:hover,
.custom-modal-body #saveQuiz:hover,
.custom-modal-body #saveExtraDescription:hover,
.swal2-popup #saveChapter:hover,
.swal2-popup #saveTicket:hover,
.swal2-popup #saveFAQ:hover,
.swal2-popup #savePrerequisites:hover,
.swal2-popup #saveQuiz:hover,
.swal2-popup #saveExtraDescription:hover,
.swal2-popup .save-chapter:hover,
.swal2-popup .save-change-chapter:hover,
.swal2-popup .btn-primary:not(.swal2-styled):hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
}

/* Secondary Action Button (Close / Cancel) */
.modal-footer-actions .close-swl:not(.modal-header-close-btn),
.custom-modal-body .modal-footer-actions .close-swl:not(.modal-header-close-btn),
.swal2-popup .modal-footer-actions .close-swl:not(.modal-header-close-btn),
.custom-modal-body button.close-swl:not(.modal-header-close-btn),
.swal2-popup button.close-swl:not(.modal-header-close-btn),
.swal2-popup .close-swl.btn-danger,
.swal2-popup .close-swl.btn-outline-secondary,
.swal2-popup .modal-footer-actions button.btn-secondary {
    background: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #475569 !important;
    font-size: 13.5px !important;
    font-weight: 600 !important;
    padding: 8px 18px !important;
    height: 38px !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    transition: all 0.15s ease-in-out !important;
    cursor: pointer !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.modal-footer-actions .close-swl:not(.modal-header-close-btn):hover,
.custom-modal-body .modal-footer-actions .close-swl:not(.modal-header-close-btn):hover,
.swal2-popup .modal-footer-actions .close-swl:not(.modal-header-close-btn):hover,
.custom-modal-body button.close-swl:not(.modal-header-close-btn):hover,
.swal2-popup button.close-swl:not(.modal-header-close-btn):hover,
.swal2-popup .close-swl.btn-danger:hover,
.swal2-popup .close-swl.btn-outline-secondary:hover {
    background: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    transform: translateY(-1px) !important;
}

/* Prevent duplicate select2 containers if cloned or re-initialized */
.select2-container + .select2-container {
    display: none !important;
}

/* Accordion cancel / close buttons styling (never alarming red) */
.accordion-row .cancel-accordion.btn-danger,
.accordion-content-wrapper .cancel-accordion.btn-danger,
button.cancel-accordion.btn-danger {
    background-color: #ffffff !important;
    border: 1.5px solid #cbd5e1 !important;
    color: #475569 !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    font-weight: 600 !important;
    border-radius: 8px !important;
    transition: all 0.15s ease-in-out !important;
}

.accordion-row .cancel-accordion.btn-danger:hover,
.accordion-content-wrapper .cancel-accordion.btn-danger:hover,
button.cancel-accordion.btn-danger:hover {
    background-color: #f1f5f9 !important;
    border-color: #94a3b8 !important;
    color: #0f172a !important;
    transform: translateY(-1px) !important;
}

.accordion-row .js-save-file,
.accordion-row .js-save-session,
.accordion-row .js-save-text_lesson,
.accordion-row .js-save-assignment,
.accordion-row .js-save-test_series {
    background: #2563eb !important;
    border-color: #2563eb !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25) !important;
    transition: all 0.15s ease-in-out !important;
}

.accordion-row .js-save-file:hover,
.accordion-row .js-save-session:hover,
.accordion-row .js-save-text_lesson:hover,
.accordion-row .js-save-assignment:hover,
.accordion-row .js-save-test_series:hover {
    background: #1d4ed8 !important;
    border-color: #1d4ed8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35) !important;
}

/* Hints, error messages, and descriptions */
.swal2-popup .invalid-feedback,
.swal2-popup .text-small,
.swal2-popup .text-muted,
.custom-modal-body .invalid-feedback,
.custom-modal-body .text-small,
.custom-modal-body .text-muted {
    text-align: left !important;
    display: block !important;
    font-size: 12.5px !important;
    margin-top: 5px !important;
}

/* RTL Support */
[dir="rtl"] .swal2-popup:not(.swal2-toast) .swal2-html-container.text-left,
[dir="rtl"] .swal2-popup:not(.swal2-toast) .swal2-html-container:has(form),
[dir="rtl"] .swal2-popup:not(.swal2-toast) .swal2-html-container:has(.form-group),
[dir="rtl"] .swal2-popup:not(.swal2-toast) .swal2-html-container:has(.custom-modal-body),
[dir="rtl"] .swal2-popup .custom-modal-body,
[dir="rtl"] .swal2-popup form,
[dir="rtl"] .swal2-popup .form-group,
[dir="rtl"] .custom-modal-body .form-group,
[dir="rtl"] .modal-body .form-group,
[dir="rtl"] .swal2-popup .form-group > label,
[dir="rtl"] .swal2-popup .input-label,
[dir="rtl"] .custom-modal-body .form-group > label,
[dir="rtl"] .custom-modal-body .input-label,
[dir="rtl"] .modal-body .form-group > label,
[dir="rtl"] .modal-body .input-label,
[dir="rtl"] .input-label,
[dir="rtl"] .swal2-popup .form-control,
[dir="rtl"] .swal2-popup .custom-select,
[dir="rtl"] .swal2-popup select.form-control,
[dir="rtl"] .swal2-popup textarea.form-control,
[dir="rtl"] .custom-modal-body .form-control,
[dir="rtl"] .custom-modal-body .custom-select,
[dir="rtl"] .modal-body .form-control,
[dir="rtl"] .modal-body .custom-select,
[dir="rtl"] .swal2-popup select option,
[dir="rtl"] .custom-modal-body select option,
[dir="rtl"] .modal-body select option,
[dir="rtl"] .swal2-popup .select2-container--default .select2-selection--single .select2-selection__rendered,
[dir="rtl"] .custom-modal-body .select2-container--default .select2-selection--single .select2-selection__rendered,
[dir="rtl"] .modal-body .select2-container--default .select2-selection--single .select2-selection__rendered,
[dir="rtl"] .swal2-popup .invalid-feedback,
[dir="rtl"] .swal2-popup .text-small,
[dir="rtl"] .swal2-popup .section-title,
body.rtl .swal2-popup:not(.swal2-toast) .swal2-html-container.text-left,
body.rtl .swal2-popup:not(.swal2-toast) .swal2-html-container:has(form),
body.rtl .swal2-popup:not(.swal2-toast) .swal2-html-container:has(.form-group),
body.rtl .swal2-popup:not(.swal2-toast) .swal2-html-container:has(.custom-modal-body),
body.rtl .swal2-popup .custom-modal-body,
body.rtl .swal2-popup form,
body.rtl .swal2-popup .form-group,
body.rtl .custom-modal-body .form-group,
body.rtl .modal-body .form-group,
body.rtl .swal2-popup .form-group > label,
body.rtl .swal2-popup .input-label,
body.rtl .custom-modal-body .form-group > label,
body.rtl .custom-modal-body .input-label,
body.rtl .modal-body .form-group > label,
body.rtl .modal-body .input-label,
body.rtl .input-label,
body.rtl .swal2-popup .form-control,
body.rtl .swal2-popup .custom-select,
body.rtl .swal2-popup select.form-control,
body.rtl .swal2-popup textarea.form-control,
body.rtl .custom-modal-body .form-control,
body.rtl .custom-modal-body .custom-select,
body.rtl .modal-body .form-control,
body.rtl .modal-body .custom-select,
body.rtl .swal2-popup select option,
body.rtl .custom-modal-body select option,
body.rtl .modal-body select option,
body.rtl .swal2-popup .select2-container--default .select2-selection--single .select2-selection__rendered,
body.rtl .custom-modal-body .select2-container--default .select2-selection--single .select2-selection__rendered,
body.rtl .modal-body .select2-container--default .select2-selection--single .select2-selection__rendered,
body.rtl .swal2-popup .invalid-feedback,
body.rtl .swal2-popup .text-small,
body.rtl .swal2-popup .section-title {
    text-align: right !important;
    text-align-last: right !important;
    direction: rtl !important;
}

/* 6. Modern Icons */
.swal2-popup:not(.swal2-toast) .swal2-icon {
    width: 4.5rem !important;
    height: 4.5rem !important;
    margin: 0.25rem auto 1rem !important;
    border-width: 3px !important;
    border-style: solid !important;
    border-radius: 50% !important;
    box-sizing: content-box !important;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

.swal2-popup:not(.swal2-toast) .swal2-icon:hover {
    transform: scale(1.05);
}

/* Success Icon */
.swal2-icon.swal2-success {
    border-color: #10b981 !important;
    color: #10b981 !important;
    background: #ecfdf5 !important;
}
.swal2-icon.swal2-success [class^='swal2-success-line'] {
    background-color: #10b981 !important;
}
.swal2-icon.swal2-success .swal2-success-ring {
    border-color: rgba(16, 185, 129, 0.3) !important;
}

/* Info Icon */
.swal2-icon.swal2-info {
    border-color: #3b82f6 !important;
    color: #3b82f6 !important;
    background: #eff6ff !important;
}
.swal2-icon.swal2-info .swal2-icon-content {
    font-family: inherit !important;
    font-weight: 700 !important;
    font-size: 2.5rem !important;
    line-height: 4.5rem !important;
}

/* Warning Icon */
.swal2-icon.swal2-warning {
    border-color: #f59e0b !important;
    color: #f59e0b !important;
    background: #fffbeb !important;
}
.swal2-icon.swal2-warning .swal2-icon-content {
    font-family: inherit !important;
    font-weight: 700 !important;
    font-size: 2.5rem !important;
    line-height: 4.5rem !important;
}

/* Error Icon */
.swal2-icon.swal2-error {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    background: #fef2f2 !important;
}
.swal2-icon.swal2-error [class^='swal2-x-mark-line'] {
    background-color: #ef4444 !important;
}

/* Question Icon */
.swal2-icon.swal2-question {
    border-color: #6366f1 !important;
    color: #6366f1 !important;
    background: #eef2ff !important;
}
.swal2-icon.swal2-question .swal2-icon-content {
    font-family: inherit !important;
    font-weight: 700 !important;
    font-size: 2.5rem !important;
    line-height: 4.5rem !important;
}

/* 7. Buttons & Actions Row */
.swal2-popup:not(.swal2-toast) .swal2-actions {
    margin: 1.25rem 0 0 !important;
    gap: 0.75rem !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.swal2-styled {
    margin: 0 !important;
    padding: 0.65rem 1.6rem !important;
    font-size: 0.925rem !important;
    font-weight: 600 !important;
    border-radius: 10px !important;
    letter-spacing: 0.01em !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
    cursor: pointer !important;
    border: none !important;
    outline: none !important;
    min-width: 105px !important;
}

/* CRITICAL: Ensure hidden buttons are NEVER displayed */
.swal2-styled[style*="display: none"],
.swal2-styled[style*="display:none"],
.swal2-actions button[style*="display: none"],
.swal2-actions button[style*="display:none"],
.swal2-actions .swal2-hide,
.swal2-styled.swal2-hide,
.swal2-actions button.d-none,
.swal2-actions .swal2-deny:not([style*="display: inline-block"]):not([style*="display: block"]):not([style*="display: flex"]):not([style*="display:inline-block"]):not([style*="display:block"]):not([style*="display:flex"]),
.swal2-actions .swal2-cancel:not([style*="display: inline-block"]):not([style*="display: block"]):not([style*="display: flex"]):not([style*="display:inline-block"]):not([style*="display:block"]):not([style*="display:flex"]) {
    display: none !important;
}

.swal2-styled:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3) !important;
}

/* Confirm Button (Primary) */
.swal2-styled.swal2-confirm {
    background-color: #2563eb !important;
    color: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.25), 
                0 2px 4px -1px rgba(37, 99, 235, 0.15) !important;
}

.swal2-styled.swal2-confirm:hover {
    background-color: #1d4ed8 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 8px 12px -2px rgba(37, 99, 235, 0.35) !important;
}

.swal2-styled.swal2-confirm:active {
    transform: translateY(0) !important;
}

/* Cancel Button (Neutral Outline / Soft Slate) */
.swal2-styled.swal2-cancel {
    background-color: #f8fafc !important;
    color: #475569 !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

.swal2-styled.swal2-cancel:hover {
    background-color: #f1f5f9 !important;
    color: #1e293b !important;
    border-color: #94a3b8 !important;
    transform: translateY(-1px) !important;
}

.swal2-styled.swal2-cancel:active {
    transform: translateY(0) !important;
}

/* Deny Button */
.swal2-styled.swal2-deny {
    background-color: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.25) !important;
}

.swal2-styled.swal2-deny:hover {
    background-color: #dc2626 !important;
    transform: translateY(-1px) !important;
}

/* 8. Close Button */
.swal2-close {
    font-size: 1.5rem !important;
    color: #94a3b8 !important;
    transition: color 0.15s ease, transform 0.15s ease !important;
    border-radius: 8px !important;
    width: 2.25rem !important;
    height: 2.25rem !important;
    top: 1rem !important;
    right: 1rem !important;
}

.swal2-close:hover {
    color: #0f172a !important;
    background: #f1f5f9 !important;
    transform: rotate(90deg) !important;
}

/* 9. Modern Input / Textarea inside SweetAlert */
.swal2-input,
.swal2-file,
.swal2-textarea,
.swal2-select,
.swal2-radio {
    margin: 1rem auto !important;
    border-radius: 10px !important;
    border: 1.5px solid #cbd5e1 !important;
    font-size: 0.95rem !important;
    padding: 0.65rem 1rem !important;
    transition: border-color 0.2s, box-shadow 0.2s !important;
    color: #1e293b !important;
}

.swal2-checkbox {
    display: none !important;
}

.swal2-input:focus,
.swal2-textarea:focus,
.swal2-select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
    outline: none !important;
}

/* 10. Progress Bar */
.swal2-timer-progress-bar {
    background: #2563eb !important;
    height: 4px !important;
}
