/* 
 * Professional Modal Design System
 * Stunning, modern design with brand colors and gradients
 * Applied to all modals across the application
 */

:root {
    --modal-primary-gradient: #959794;
    --modal-secondary-gradient: linear-gradient(135deg, #D79C00 0%, #ED7E2C 100%);
    --modal-accent-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --modal-success-gradient: linear-gradient(135deg, #43A047 0%, #66BB6A 100%);
    --modal-dark: #1A1919;
    --modal-grey: #767676;
    --modal-light-grey: #F7F7F7;
    --modal-border: #EBEBEB;
    --modal-white: #ffffff;
    --modal-shadow: 0 20px 60px rgba(26, 25, 25, 0.15), 0 0 1px rgba(26, 25, 25, 0.1);
    --modal-shadow-lg: 0 25px 80px rgba(26, 25, 25, 0.2), 0 0 1px rgba(26, 25, 25, 0.15);
}

/* Backdrop - COMPLETELY TRANSPARENT - no dark overlay */
/* The backdrop-filter property blurs everything behind it, including modal dialogs */
/* This causes the entire screen including modal content to appear blurred */
/* CRITICAL: backdrop must NOT block clicks - modal content should be clickable */
/* UPDATED: Don't use display:none - let backdrop exist for proper modal behavior */
.modal-backdrop {
    background: transparent !important;
    opacity: 0 !important;
    pointer-events: none !important;
    /* Allow clicks to pass through to modal */
    /* REMOVED: backdrop-filter: blur(8px); */
    /* REMOVED: -webkit-backdrop-filter: blur(8px); */
    /* REMOVED: display: none - let backdrop exist in DOM */
}

/* When backdrop is shown, it should still not block clicks */
.modal-backdrop.show {
    pointer-events: none !important;
}

/* COMPLETE OVERRIDE - Remove ALL blur for pitch deck modal backdrop */
/* This MUST come after the general .modal-backdrop rule to override it */
.pitch-deck-modal-backdrop,
.pitch-deck-modal-backdrop.show,
.pitch-deck-modal-backdrop.fade,
body:has(#pitchDeckUpgradeModal.show) .modal-backdrop,
body:has(#pitchDeckUpgradeModal.show) .modal-backdrop.show,
#pitchDeckUpgradeModal.show~.modal-backdrop,
#pitchDeckUpgradeModal.show+.modal-backdrop {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    background: rgba(0, 0, 0, 0.6) !important;
    /* Simple solid overlay */
}

.modal-backdrop.show {
    opacity: 1;
    pointer-events: none !important;
    /* Ensure clicks pass through */
}

/* Ensure modal content itself is clickable and NOT blurred */
.modal {
    pointer-events: auto !important;
    /* Modal container MUST allow clicks */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
}

.modal.show {
    pointer-events: auto !important;
    /* When shown, container MUST allow clicks */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
}

.modal-dialog {
    pointer-events: auto !important;
    /* But modal dialog IS clickable */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    position: relative !important;
    z-index: 100000 !important;
    /* MUST be higher than backdrop z-index 99999 */
    background-color: transparent !important;
    /* Remove white background from dialog container */
    background: transparent !important;
    padding: 0 !important;
    /* Remove padding that creates white space */
}

.modal-content {
    pointer-events: auto !important;
    /* And modal content IS clickable */
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    background: #ffffff !important;
    /* Solid white background */
    opacity: 1 !important;
}

/* Remove white background from modal container itself */
.modal {
    background-color: transparent !important;
    background: transparent !important;
}

/* Remove any blur from modal children */
.modal *,
.modal-dialog *,
.modal-content *,
.modal-header *,
.modal-body *,
.modal-footer * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
}

/* ============================================
   NUCLEAR FIX: Remove ALL blur from ALL modals - GLOBAL OVERRIDE
   This must be at the END of the file to override everything
   ============================================ */

/* Remove blur from ALL modals and their children */
.modal,
.modal.show,
.modal.fade,
.modal.fade.show,
.modal-dialog,
.modal-content,
.modal-header,
.modal-body,
.modal-footer,
.modal *,
.modal.show *,
.modal-dialog *,
.modal-content *,
.modal-header *,
.modal-body *,
.modal-footer * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
}

/* Ensure modal content has solid white background and is fully visible */
.modal-content {
    background: #ffffff !important;
    opacity: 1 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
}

/* Ensure backdrop is COMPLETELY TRANSPARENT but exists in DOM */
.modal-backdrop,
.modal-backdrop.show,
.modal-backdrop.fade,
.modal-backdrop.fade.show {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    background: transparent !important;
    opacity: 0 !important;
    /* Transparent, no display:none */
}

/* Remove blur from body when modal is open */
body.modal-open,
body.modal-open *:not(.modal):not(.modal-backdrop):not(.modal-dialog):not(.modal-content) {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
}

/* Ensure "Choose an Image" button formatting and padding - END OF FILE */
.custom-file-label,
label[for="file"],
label.custom-file-label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 13px 24px !important;
    background: #959794 !important;
    border: none !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    text-align: center !important;
    margin: 0 auto !important;
    width: auto !important;
    min-width: 200px !important;
    transition: all 0.3s ease !important;
}

.custom-file-label:hover,
label[for="file"]:hover {
    background: #767676 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.custom-file-label b,
label[for="file"] b {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

#file-label-text {
    display: inline !important;
    margin-left: 8px !important;
    color: #ffffff !important;
    font-weight: 500 !important;
}

/* Modal Dialog Container */
.modal-dialog {
    max-width: 600px;
    margin: 1.75rem auto;
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-dialog.modal-lg {
    max-width: 900px;
}

.modal-dialog.modal-xl {
    max-width: 1200px;
}

/* Modal Content - Stunning Card Design */
.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: var(--modal-shadow-lg);
    overflow: hidden;
    background: var(--modal-white);
    position: relative;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--modal-primary-gradient);
    z-index: 1;
}

/* Modal Header - Gradient Background */
.modal-header {
    padding: 28px 30px 24px;
    border-bottom: none;
    background: var(--modal-primary-gradient);
    position: relative;
    border-radius: 20px 20px 0 0;
}

.modal-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 30px;
    right: 30px;
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
}

.modal-header.text-white {
    background: var(--modal-primary-gradient);
}

/* Standard header (non-gradient) - Used for some modals */
.modal-header:not(.text-white):not([style*="gradient"]) {
    background: var(--modal-white);
    border-bottom: 1px solid var(--modal-border);
}

.modal-header:not(.text-white):not([style*="gradient"]) .modal-title {
    color: var(--modal-dark);
}

/* Modal Title */
.modal-title {
    font-weight: 700;
    font-size: 22px;
    line-height: 28px;
    color: var(--modal-white);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-header:not(.text-white) .modal-title,
.modal-header:not(.text-white):not([style*="gradient"]) .modal-title {
    color: var(--modal-dark);
}

.modal-title i,
.modal-title .icon {
    font-size: 24px;
    opacity: 0.95;
}

/* Close Button - Enhanced */
.modal-header .close,
.modal-header .btn-close {
    position: absolute !important;
    top: 20px !important;
    right: 20px !important;
    left: auto !important;
    bottom: auto !important;
    opacity: 1;
    color: var(--modal-white);
    font-size: 28px;
    font-weight: 300;
    padding: 0;
    margin: 0;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    /* REMOVED: backdrop-filter: blur(10px); */
    z-index: 1000 !important;
    float: none !important;
    transform: none !important;
}

.modal-header:not(.text-white) .close,
.modal-header:not(.text-white) .btn-close {
    color: #1A1919;
    background: transparent !important;
    /* Custom black X icon - not transparent */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") !important;
    background-size: 16px !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    filter: none !important;
    opacity: 1 !important;
}

.modal-header .close:hover,
.modal-header .btn-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
    color: var(--modal-white);
}

.modal-header:not(.text-white) .close:hover,
.modal-header:not(.text-white) .btn-close:hover {
    background: transparent !important;
    opacity: 1 !important;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23000000'%3e%3cpath d='M.293.293a1 1 0 0 1 1.414 0L8 6.586 14.293.293a1 1 0 1 1 1.414 1.414L9.414 8l6.293 6.293a1 1 0 0 1-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 0 1-1.414-1.414L6.586 8 .293 1.707a1 1 0 0 1 0-1.414z'/%3e%3c/svg%3e") !important;
}

.modal-header .btn-close-white {
    color: var(--modal-white);
    background: rgba(255, 255, 255, 0.15);
}

.modal-header .btn-close-white:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Modal Body */
.modal-body {
    padding: 30px;
    color: var(--modal-dark);
    background: var(--modal-white);
    position: relative;
}

.modal-body p {
    font-weight: 500;
    font-size: 16px;
    line-height: 26px;
    color: var(--modal-dark);
    margin-bottom: 18px;
}

.modal-body p:last-child {
    margin-bottom: 0;
}

.modal-body .text-muted,
.modal-body small,
.modal-body .form-text.text-muted {
    font-weight: 500;
    font-size: 14px;
    line-height: 20px;
    color: var(--modal-grey);
}

.modal-body h6 {
    font-weight: 700;
    font-size: 18px;
    line-height: 24px;
    color: var(--modal-dark);
    margin-bottom: 14px;
}

.modal-body ul,
.modal-body ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.modal-body ul li,
.modal-body ol li {
    font-weight: 500;
    font-size: 16px;
    line-height: 26px;
    color: var(--modal-dark);
    margin-bottom: 10px;
}

/* Forms in Modals */
.modal-body .form-group {
    margin-bottom: 20px;
}

.modal-body .form-control {
    border: 2px solid var(--modal-border);
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.modal-body .form-control:focus {
    border-color: #959794;
    box-shadow: 0 0 0 3px rgba(149, 151, 148, 0.1);
    outline: none;
}

.modal-body label {
    font-weight: 600;
    font-size: 14px;
    color: var(--modal-dark);
    margin-bottom: 8px;
    display: block;
}

/* Alert/Info Boxes */
.modal-body .alert {
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
    border: none;
    border-left: 4px solid;
}

.modal-body .alert-warning {
    background: rgba(237, 126, 44, 0.1);
    border-left-color: #ED7E2C;
    color: #8B4513;
}

.modal-body .alert-info {
    background: rgba(149, 151, 148, 0.1);
    border-left-color: #959794;
    color: #2C3E6B;
}

.modal-body .alert-success {
    background: rgba(67, 160, 71, 0.1);
    border-left-color: #43A047;
    color: #1B5E20;
}

/* Modal Footer */
.modal-footer {
    padding: 24px 30px 30px;
    border-top: 1px solid var(--modal-border);
    border-radius: 0 0 20px 20px;
    background: var(--modal-white);
    gap: 12px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.modal-footer .btns,
.modal-footer .btn {
    min-width: 120px;
    margin: 0;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    padding: 13px 24px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.modal-footer .btns:hover,
.modal-footer .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.modal-footer .btns-secondary {
    background: var(--modal-white);
    border: 2px solid var(--modal-border);
    color: var(--modal-dark);
    box-shadow: none;
}

.modal-footer .btns-secondary:hover {
    background: var(--modal-light-grey);
    border-color: var(--modal-grey);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Special Gradient Buttons */
.modal-footer .btns[style*="gradient"],
.modal-footer .btn[style*="gradient"] {
    background: var(--modal-primary-gradient) !important;
    border: none;
    color: var(--modal-white);
}

/* Upgrade Modals - Special Styling */
.modal-content[id*="upgrade"],
.modal-content[id*="Upgrade"] {
    border: 2px solid #D79C00;
}

.modal-content[id*="upgrade"] .modal-header,
.modal-content[id*="Upgrade"] .modal-header {
    background: var(--modal-secondary-gradient);
}

/* SPV Modals - Keep existing gradient */
/* Note: SPV modals maintain their existing gradient styling */

/* Verification Modal - Special Styling */
#toApply .modal-header {
    background: var(--modal-success-gradient);
}

/* Responsive Design */
@media (max-width: 576px) {
    .modal-dialog {
        margin: 16px;
        max-width: calc(100% - 32px);
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }

    .modal-header {
        padding-top: 24px;
        padding-bottom: 20px;
    }

    .modal-body {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .modal-footer {
        padding-top: 20px;
        padding-bottom: 24px;
        flex-direction: column-reverse;
    }

    .modal-footer .btns,
    .modal-footer .btn {
        width: 100%;
        margin-bottom: 12px;
    }

    .modal-footer .btns:last-child,
    .modal-footer .btn:last-child {
        margin-bottom: 0;
    }

    .modal-title {
        font-size: 20px;
        line-height: 26px;
    }
}

/* Smooth transitions */
.modal {
    transition: opacity 0.3s ease;
}

.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

/* Fix blur issue for pitch deck upgrade modal - remove backdrop-filter */
.pitch-deck-modal-backdrop,
#pitchDeckUpgradeModal.show~.modal-backdrop,
body:has(#pitchDeckUpgradeModal.show) .modal-backdrop,
#pitchDeckUpgradeModal.show+.modal-backdrop {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
}

/* Ensure pitch deck upgrade modal content is never blurred */
#pitchDeckUpgradeModal,
#pitchDeckUpgradeModal .modal-dialog,
#pitchDeckUpgradeModal .modal-content,
#pitchDeckUpgradeModal .modal-header,
#pitchDeckUpgradeModal .modal-body,
#pitchDeckUpgradeModal .modal-footer {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
}

/* ============================================
   NUCLEAR FIX: Remove ALL blur from ALL modals - GLOBAL OVERRIDE
   This must be at the END of the file to override everything
   ============================================ */

/* Remove blur from ALL modals and their children */
.modal,
.modal.show,
.modal.fade,
.modal.fade.show,
.modal-dialog,
.modal-content,
.modal-header,
.modal-body,
.modal-footer,
.modal *,
.modal.show *,
.modal-dialog *,
.modal-content *,
.modal-header *,
.modal-body *,
.modal-footer * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
}

/* Ensure modal content has solid white background and is fully visible */
.modal-content {
    background: #ffffff !important;
    opacity: 1 !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
}

/* Ensure backdrop is COMPLETELY TRANSPARENT but exists in DOM */
.modal-backdrop,
.modal-backdrop.show,
.modal-backdrop.fade,
.modal-backdrop.fade.show {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
    background: transparent !important;
    opacity: 0 !important;
    /* Transparent, no display:none */
}

/* Remove blur from body when modal is open */
body.modal-open,
body.modal-open *:not(.modal):not(.modal-backdrop):not(.modal-dialog):not(.modal-content) {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    filter: none !important;
}

/* Ensure "Choose an Image" button formatting and padding - END OF FILE */
.custom-file-label,
label[for="file"],
label.custom-file-label {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    padding: 13px 24px !important;
    background: #959794 !important;
    border: none !important;
    border-radius: 12px !important;
    font-weight: 700 !important;
    font-size: 16px !important;
    cursor: pointer !important;
    text-align: center !important;
    margin: 0 auto !important;
    width: auto !important;
    min-width: 200px !important;
    transition: all 0.3s ease !important;
}

.custom-file-label:hover,
label[for="file"]:hover {
    background: #767676 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.custom-file-label b,
label[for="file"] b {
    display: inline !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

#file-label-text {
    display: inline !important;
    margin-left: 8px !important;
    color: #ffffff !important;
    font-weight: 500 !important;
}

/* ============================================
   GLOBAL FIX: Remove white background from all modal dialog containers
   This removes the white space above and below modals
   ============================================ */
.modal,
.modal.fade,
.modal.show {
    background-color: transparent !important;
    background: transparent !important;
}

.modal-dialog,
.modal-dialog.modal-dialog-centered,
.modal-dialog.modal-lg,
.modal-dialog.modal-xl {
    background-color: transparent !important;
    background: transparent !important;
    padding: 0 !important;
}

/* ============================================
   MOBILE FIX: Prevent white background above/below modals
   ============================================ */
@media (max-width: 768px) {
    .modal {
        background-color: transparent !important;
        background: rgba(0, 0, 0, 0.5) !important;
    }

    .modal.show {
        background-color: transparent !important;
        background: rgba(0, 0, 0, 0.5) !important;
    }

    .modal-dialog {
        margin: 10px !important;
        max-width: calc(100% - 20px) !important;
        background: transparent !important;
        background-color: transparent !important;
        min-height: auto !important;
        height: auto !important;
    }

    .modal-dialog-centered {
        min-height: calc(100% - 20px) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: transparent !important;
        background-color: transparent !important;
    }

    .modal-dialog-centered .modal-content {
        margin: auto !important;
        max-height: calc(100vh - 40px) !important;
        overflow-y: auto !important;
    }

    /* Remove any white padding/margin around the modal */
    .modal-dialog::before,
    .modal-dialog::after {
        display: none !important;
        content: none !important;
    }

    /* Ensure the modal backdrop doesn't create white space */
    .modal-backdrop {
        background: transparent !important;
        opacity: 0 !important;
    }

    /* Verification modal specific fix */
    #toApply .modal-dialog,
    #verificationTrustModal .modal-dialog {
        background: transparent !important;
        background-color: transparent !important;
    }
}

/* Desktop fix for modal backgrounds */
@media (min-width: 769px) {
    .modal {
        background: rgba(0, 0, 0, 0.5) !important;
    }

    .modal-dialog {
        background: transparent !important;
        background-color: transparent !important;
    }
}

/* Remove white space from modal open body */
body.modal-open {
    overflow: hidden !important;
}

/* Ensure modal content is the only visible element with background */
.modal-content {
    background: #ffffff !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15) !important;
}

/* ============================================
   MOBILE MENU FIX: Force correct positioning
   This MUST be at the END of the file to override all other styles
   ============================================ */
@media only screen and (max-width: 991px) {

    /* Force header-menu to position from viewport top */
    .header-menu,
    div.header-menu,
    .d-flex.header-menu,
    .flex-lg-row.header-menu,
    .flex-column.header-menu,
    .header-inner .header-menu,
    .header-inner>.header-menu,
    .container .header-menu,
    header .header-menu,
    .site-header .header-menu {
        position: fixed !important;
        top: 68px !important;
        left: -270px !important;
        right: auto !important;
        bottom: 0 !important;
        width: 270px !important;
        height: calc(100vh - 68px) !important;
        margin: 0 !important;
        margin-top: 0 !important;
        padding: 15px !important;
        background-color: #fff !important;
        z-index: 9998 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        transform: none !important;
        transition: left 0.2s ease-in-out !important;
    }

    /* When menu is active, show it */
    .active-menu .header-menu,
    .active-menu div.header-menu,
    .active-menu .d-flex.header-menu,
    .active-menu .flex-lg-row.header-menu,
    .active-menu .flex-column.header-menu,
    .active-menu .header-inner .header-menu,
    .active-menu .header-inner>.header-menu,
    .active-menu .container .header-menu,
    .active-menu header .header-menu,
    .active-menu .site-header .header-menu,
    body.active-menu .header-menu {
        left: 0 !important;
        top: 68px !important;
        right: auto !important;
        margin: 0 !important;
        margin-top: 0 !important;
        transform: none !important;
    }
}
/* ============================================
   Z-INDEX FIX: Ensure modals appear above header
   Header is 99998, Dropdowns are 100000
   ============================================ */
.modal {
    z-index: 110000 !important;
}

.modal-backdrop {
    z-index: 109990 !important; /* Just below modal */
}

/* Ensure modal dialog is within the modal's stacking context but respects the high z-index */
.modal-dialog {
    z-index: 110010 !important; /* Higher than modal container just in case */
}
