/* Loader Overlay Styles */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loader-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loader-container {
    text-align: center;
    position: relative;
}

/* SVG/Image in the center */
.loader-image {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    position: relative;
    z-index: 2;
}

.loader-image img,
.loader-image svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Spinning ring around the image */
.loader-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
    z-index: 1;
}

/* Alternative: CSS-only spinner (if you don't want to use image) */
.loader-spinner-css {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(255, 255, 255, 0.2);
    border-top-color: #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    display: none; /* Hidden when using image */
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-text {
    color: #ffffff;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.5px;
    animation: pulse 1.5s ease-in-out infinite;
}

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

/* Dots animation for loading text */
.loader-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Progress bar (optional) */
.loader-progress {
    width: 200px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    margin: 15px auto 0;
    overflow: hidden;
}

.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #0056b3);
    border-radius: 2px;
    animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
    0% {
        width: 0%;
        margin-left: 0;
    }
    50% {
        width: 70%;
        margin-left: 15%;
    }
    100% {
        width: 0%;
        margin-left: 100%;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .loader-image {
        width: 60px;
        height: 60px;
    }
    
    .loader-ring {
        width: 80px;
        height: 80px;
    }
    
    .loader-text {
        font-size: 14px;
    }
    
    .loader-progress {
        width: 150px;
    }
}