/* Modern Loading Spinner - Transparent Background for Map Visibility */
#loader {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    pointer-events: none;
}

/* Spinner Container with Semi-transparent Background */
#loader::before {
    content: '';
    width: 80px;
    height: 80px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #363986;
    border-right-color: #4A90E2;
    border-bottom-color: #00C896;
    background-color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    animation: spin 0.8s cubic-bezier(0.65, 0.05, 0.36, 1) infinite;
    pointer-events: auto;
}

/* Loading Text with Background */
#loader::after {
    content: 'Loading...';
    position: absolute;
    top: 100%;
    margin-top: 15px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #363986, #4A90E2);
    border-radius: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(54, 57, 134, 0.3);
    pointer-events: auto;
}

/* Smooth Spin Animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@-webkit-keyframes spin {
    0% {
        -webkit-transform: rotate(0deg);
    }
    100% {
        -webkit-transform: rotate(360deg);
    }
}

/* Fade-in Animation for Content */
.animate-bottom {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@-webkit-keyframes fadeInUp {
    from {
        opacity: 0;
        -webkit-transform: translateY(20px);
    }
    to {
        opacity: 1;
        -webkit-transform: translateY(0);
    }
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    #loader::before {
        width: 50px;
        height: 50px;
        border-width: 3px;
    }

    #loader::after {
        font-size: 13px;
        margin-top: 16px;
    }
}

@media screen and (max-height: 600px) {
    #loader::before {
        width: 45px;
        height: 45px;
    }

    #loader::after {
        font-size: 12px;
    }
}

/* Accessibility - Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    #loader::before {
        animation: pulse 1.5s ease-in-out infinite;
    }

    .animate-bottom {
        animation: fadeIn 0.3s ease-out;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

#myDiv {
    display: none;
    text-align: center;
}
