/* ================================================
   Global Loader Component
   ================================================ */

.global-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loader-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

.loader-content {
    position: relative;
    z-index: 10000;
    text-align: center;
    background: #fff;
    padding: 2rem 3rem;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.loader-text {
    font-size: 1rem;
    font-weight: 600;
    color: #344054;
    letter-spacing: 0.5px;
}

/* Animación de puntos suspensivos */
.dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

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

/* Bootstrap spinner personalizado (más grande y suave) */
.global-loader .spinner-border {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

/* Fade in/out animations */
.global-loader.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.global-loader.fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

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

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

/* Dark mode support */
[data-bs-theme="dark"] .loader-content {
    background: #1c1f26;
}

[data-bs-theme="dark"] .loader-text {
    color: #cbd5e1;
}

/* Prevent body scroll when loader is active */
body.loader-active {
    overflow: hidden;
}

