/* MapSamurai Preloader CSS */

.mpfy-preloader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    font-family: 'Montserrat', sans-serif;
    transition: opacity 0.5s ease-out;
}

.mpfy-preloader.mpfy-preloader-hidden {
    opacity: 0;
    pointer-events: none;
}

.mpfy-preloader-content {
    text-align: center;
    max-width: 300px;
}

.mpfy-preloader-text {
    color: #666;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 10px;
}

.mpfy-preloader-subtext {
    color: #999;
    font-size: 12px;
    margin-bottom: 20px;
}

.mpfy-preloader-progress {
    width: 200px;
    height: 4px;
    background-color: #e3e3e3;
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.mpfy-preloader-progress-bar {
    height: 100%;
    background-color: #5ca7bb;
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.mpfy-preloader-stage {
    color: #888;
    font-size: 11px;
    margin-top: 10px;
    min-height: 14px;
}

/* Loading state for map container */
.mpfy-container.mpfy-loading .mpfy-map-canvas-shell-outer {
    opacity: 0.3;
    pointer-events: none;
}

.mpfy-container.mpfy-loading .mpfy-controls-wrap {
    opacity: 0.3;
    pointer-events: none;
}

/* Dark theme variant */
.mpfy-preloader.mpfy-preloader-dark {
    background-color: rgba(0, 0, 0, 0.8);
    color: #fff;
}

.mpfy-preloader.mpfy-preloader-dark .mpfy-preloader-text {
    color: #fff;
}

.mpfy-preloader.mpfy-preloader-dark .mpfy-preloader-subtext {
    color: #ccc;
}

.mpfy-preloader.mpfy-preloader-dark .mpfy-preloader-stage {
    color: #aaa;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .mpfy-preloader-spinner {
        width: 50px;
        height: 50px;
    }
    
    .mpfy-preloader-text {
        font-size: 14px;
    }
    
    .mpfy-preloader-progress {
        width: 150px;
    }
}


/* Error state */
.mpfy-preloader-error {
    color: #e74c3c;
}

.mpfy-preloader-error .mpfy-preloader-spinner::before {
    border-top-color: #e74c3c;
    animation: none;
}

.mpfy-preloader-retry {
    background: #5ca7bb;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 10px;
    transition: background-color 0.3s ease;
}

.mpfy-preloader-retry:hover {
    background: #4a96a9;
}

/* Smooth fade-in for loaded content */
.mpfy-container.mpfy-loaded .mpfy-map-canvas-shell-outer,
.mpfy-container.mpfy-loaded .mpfy-controls-wrap {
    opacity: 1;
    transition: opacity 0.5s ease-in;
}