/* CAS Geolocation Loading Overlay */

.cas-geo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(2px);
    z-index: 999;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
    border-radius: 8px;
}

/* Container positioning for overlay */
.cas-toplist-container {
    position: relative;
}

.cas-geo-overlay.show {
    opacity: 1;
    visibility: visible;
}

.cas-geo-overlay.hide {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.cas-geo-overlay-content {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    max-width: 280px;
    width: 90%;
    margin: 0 auto;
}

.cas-geo-overlay-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007cba;
    border-radius: 50%;
    animation: cas-spin 1s linear infinite;
    margin: 0 auto 12px;
}

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

.cas-geo-overlay-message {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0;
    line-height: 1.3;
}

.cas-geo-overlay-submessage {
    font-size: 12px;
    color: #666;
    margin: 6px 0 0;
    line-height: 1.2;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .cas-geo-overlay-content {
        padding: 16px;
        max-width: 240px;
    }
    
    .cas-geo-overlay-message {
        font-size: 13px;
    }
    
    .cas-geo-overlay-submessage {
        font-size: 11px;
    }
    
    .cas-geo-overlay-spinner {
        width: 28px;
        height: 28px;
        margin-bottom: 10px;
    }
}

/* Ensure overlay appears above common WordPress elements */
.cas-geo-overlay {
    z-index: 999 !important;
}

/* Accessibility improvements */
.cas-geo-overlay[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.cas-geo-overlay[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .cas-geo-overlay {
        background-color: rgba(255, 255, 255, 0.98);
    }
    
    .cas-geo-overlay-content {
        border: 2px solid #000;
    }
    
    .cas-geo-overlay-spinner {
        border-top-color: #000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .cas-geo-overlay {
        transition: none;
    }
    
    .cas-geo-overlay-spinner {
        animation: none;
        border: 4px solid #007cba;
        border-radius: 50%;
    }
    
    .cas-geo-overlay-spinner::after {
        content: "⟳";
        display: block;
        text-align: center;
        line-height: 42px;
        font-size: 20px;
        color: #007cba;
    }
}
