/* Modal-specific styles */
#map-modal .modal-header {
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid #ddd;
    background-color: #f5f5f5;
}

#map-modal .modal-title {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
}

#map-modal .modal-header .close {
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #000;
    cursor: pointer;
}

#map-modal .modal-body {
    padding: 0;
    flex-grow: 1; /* Allow body to expand and take available space */
    display: flex;
    flex-direction: column; /* Stack children vertically */
    justify-content: center;
    align-items: center;
    overflow: hidden; /* Ensure content stays inside the modal */
}

#map {
    width: 100%;       /* Ensure it takes full width */
    height: 700px;     /* Adjust height to fit your design */
    position: relative;
}

.map-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 700px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(245, 245, 245, 0.7);
    z-index: 1000;
}

.map-loading-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 20px 40px;
    text-align: center;
}

.map-loading-spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

.map-loading-text {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


/* Button styles */
#showMapBtn {
    margin-left: 10px;
    cursor: not-allowed;
    background: #ddd;
    color: #656565;
    border: 1px solid #ccc;
    border-radius: 3px;
    float:right;
}

#showMapBtn.enabled {
    cursor: pointer;
    background: #007bff;
    color: white;
    border: none;
}

#closeMapModal {
    cursor: pointer;
    padding: 5px 10px;
    background: #d9534f;
    color: white;
    border: none;
    border-radius: 3px;
}
.disclaimer-link {
    font-size: 0.85em;
    color: #007bff;
    text-decoration: none;
}

.disclaimer-link:hover {
    text-decoration: underline;
}

#serviceAreaModal .modal-footer {
    justify-content: space-between;
}

#serviceAreaModal .modal-footer div {
    display: flex;
    gap: 8px;
}

#btn-save-description, #btn-save-label {
    display: none;
}

/* Service Area Popup Styling */
.service-area-popup-container {
    max-width: 300px !important;
}

.service-area-popup {
    font-family: inherit;
    color: #333;
}

.popup-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
    margin-bottom: 8px;
}

.popup-label {
    font-weight: bold;
    font-size: 14px;
    flex-grow: 1;
    margin-right: 10px;
}

.popup-toggle, .popup-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #656565;
    padding: 2px 5px;
    font-size: 12px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.popup-toggle:hover, .popup-close:hover {
    background-color: #f0f0f0;
    color: #333;
}

.popup-description {
    max-height: 150px;
    overflow-y: auto;
    transition: max-height 0.3s ease-in-out;
    margin-top: 5px;
    font-size: 13px;
    line-height: 1.4;
}

.popup-description.collapsed {
    max-height: 0;
    overflow: hidden;
    margin-top: 0;
}

.popup-description p {
    margin: 0 0 8px 0;
}



/* Responsive adjustments */
@media (max-width: 768px) {
    .popup-description {
        max-height: 100px;
    }
    
    .service-area-popup-container {
        max-width: 250px !important;
    }
    
    .popup-label {
        font-size: 13px;
    }
}

/* A clean style for the disclaimer link */
.disclaimer-link {
    font-size: 12px;
    color: #777;
    margin-left: 10px;
}


/* Updated CSS for clientMapBoundary Scope Selector */
#clientMapBoundaryScopeSelectorContainer {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 20;
    background: rgba(255,255,255,0.9);
    border-radius: 4px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    padding: 8px 12px 6px 12px; 
    min-width: auto;
    max-width: none; 
    font-size: 13px;
    border: 1px solid #ccc;
    pointer-events: auto; /* Allow interaction */
}
#clientMapBoundaryScopeSelector label {
    font-weight: 500;
    margin-right: 8px;
}
#clientMapBoundaryScopeSelector .form-check-inline {
    margin-right: 8px; 
}
@media (max-width: 768px) {
    #clientMapBoundaryScopeSelectorContainer {
        left: 5px;
        bottom: 5px;
        padding: 6px 8px 4px 8px;
        font-size: 12px;
    }
}