/* --- Common Modals --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(12px); /* Gorgeous high-end glassmorphism background */
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-backdrop-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    width: 720px;
    max-width: 92vw;
    max-height: 85vh;
    background: #FFFFFF;
    border-radius: 28px; /* Smooth extra-rounded corners */
    box-shadow: 0 30px 70px -10px rgba(15, 23, 42, 0.3);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.8);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease, visibility 0.3s ease;
}

.modal-container-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.modal-header {
    padding: 2rem 2.5rem 1.5rem 2.5rem;
    border-bottom: 1px solid var(--dash-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #FFFFFF;
}

.modal-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 1.35rem;
    color: var(--text-main);
    letter-spacing: -0.3px;
    margin: 0;
}

.modal-close-btn {
    background: #F1F5F9;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: all 0.25s ease;
}

.modal-close-btn:hover {
    background: var(--accent-coral);
    color: #FFFFFF;
    transform: rotate(90deg);
}

.modal-close-btn:focus-visible {
    outline: 2px solid var(--accent-coral, #F43F5E);
    outline-offset: 2px;
}

.modal-body {
    padding: 2.25rem 2.5rem;
    flex-grow: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* Custom Scrollbar for Modal Body */
.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.modal-body::-webkit-scrollbar-thumb {
    background: #E2E8F0;
    border-radius: 10px;
}
.modal-body::-webkit-scrollbar-thumb:hover {
    background: #CBD5E1;
}

/* Premium Floating Card Table Inside Centered Modal */
.modal-body .premium-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 12px; /* Breathing row gaps */
    margin-top: 0.5rem;
}

.modal-body .premium-table th {
    background: transparent;
    color: var(--text-sub);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.75px;
    padding: 0.25rem 1.25rem;
    border-bottom: none;
}

.modal-body .premium-table tr {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: default;
}

.modal-body .premium-table td {
    padding: 1.15rem 1.25rem;
    background: #F8FAFC;
    border-top: 1px solid #E2E8F0;
    border-bottom: 1px solid #E2E8F0;
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
}

.modal-body .premium-table td:first-child {
    border-left: 1px solid #E2E8F0;
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.modal-body .premium-table td:last-child {
    border-right: 1px solid #E2E8F0;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* Floating table row card lift and shadow expansion micro-interactions */
.modal-body .premium-table tr:hover td {
    background: #FFFFFF;
    border-color: rgba(124, 58, 237, 0.3);
}

.modal-body .premium-table tr:hover {
    transform: translateY(-2px);
}

.modal-body .premium-table tr:hover td:first-child {
    border-left: 1px solid rgba(124, 58, 237, 0.3);
}

.modal-body .premium-table tr:hover td:last-child {
    border-right: 1px solid rgba(124, 58, 237, 0.3);
}

/* --- Premium Unspecified Locations Floating Badge --- */
/* --- RESPONSIVE MODAL --- */
@media (max-width: 767px) {
    .modal-container {
        width: 100vw !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        border-radius: 20px 20px 0 0 !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        transform: translateY(100%) !important;
    }

    .modal-container-open {
        transform: translateY(0) !important;
    }

    .modal-header {
        padding: 1.25rem 1.5rem !important;
    }

    .modal-body {
        padding: 1.25rem 1.5rem !important;
    }

    .modal-title {
        font-size: 1.1rem !important;
    }

    .modal-body .premium-table td {
        padding: 0.85rem 0.85rem !important;
        font-size: 0.75rem !important;
    }

    .modal-body .premium-table th {
        padding: 0.25rem 0.85rem !important;
        font-size: 0.62rem !important;
    }
}

.unspecified-locations-badge {
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.unspecified-locations-badge:hover {
    transform: translateY(-2px);
    background: #FFFFFF !important;
    border-color: var(--accent-purple) !important;
    box-shadow: 0 12px 30px rgba(124, 58, 237, 0.16) !important;
}

.unspecified-locations-badge:active {
    transform: translateY(0px);
}
