/* =====================================================
   Loader Manager Styles - Sistema Unificado de Loading
   ===================================================== */

.app-loader {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    width: 100vw;
    height: 100vh;
}

.app-loader.is-visible {
    opacity: 1;
    visibility: visible;
}

.app-loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* ===== SPINNER LOADER ===== */
.app-loader-spinner-circle {
    width: 60px;
    height: 60px;
    border: 4px solid #e8e8e8;
    border-top-color: #003399;
    border-radius: 50%;
    animation: app-loader-spin 1s linear infinite;
}

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

/* ===== IMAGE LOADER COM SKELETON ===== */
.app-loader-image {
    position: relative;
    max-width: 300px;
    width: 90%;
}

.app-loader-img {
    width: 100%;
    height: auto;
    max-height: 300px;
    display: block;
    border-radius: 8px;
    position: relative;
    z-index: 1;
}

.app-loader-skeleton {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: app-loader-skeleton-shine 1.5s infinite;
    border-radius: 8px;
    pointer-events: none;
    z-index: 2;
}

@keyframes app-loader-skeleton-shine {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===== MENSAGENS ===== */
.app-loader p {
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    letter-spacing: 0.5px;
    opacity: 0.8;
    text-align: center;
    margin: 0;
}

/* ===== COMPATIBILIDADE COM LOADING ANTIGO ===== */
/* Esconde o loading antigo quando o novo está ativo */
.router-view-loading {
    display: none !important;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    .app-loader-spinner-circle {
        width: 50px;
        height: 50px;
        border-width: 3px;
    }

    .app-loader p {
        font-size: 0.9rem;
    }

    .app-loader-image {
        max-width: 250px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-loader-spinner-circle,
    .app-loader-skeleton {
        animation: none;
        opacity: 0.7;
    }
}
