/* =================================================================
   LOADING SCREEN PROFISSIONAL - Better Tech
   Arquivo: /oxy_auth/static/oxy_auth/loading.css
   ================================================================= */

/* ========== LOADING OVERLAY ========== */
.better-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0d2238 0%, #1a3a52 50%, #27526d 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.6s ease-out, visibility 0.6s ease-out;
}

/* Estado oculto */
.better-loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ========== CONTAINER DO LOADING ========== */
.better-loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    animation: fadeInScale 0.8s ease-out;
}

/* ========== LOGO ========== */
.better-loading-logo {
    position: relative;
    width: 280px;
    height: auto;
    animation: logoFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 8px 24px rgba(255, 255, 255, 0.15))
           drop-shadow(0 4px 12px rgba(183, 31, 115, 0.3));
}

.better-loading-logo img {
    width: 100%;
    height: auto;
    display: block;
}

/* ========== SPINNER ========== */
.better-loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
}

/* Círculo externo */
.spinner-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: #B71F73;
    border-right-color: #d4287f;
    animation: spinRotate 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.spinner-ring:nth-child(2) {
    animation-delay: -0.3s;
    border-top-color: #d4287f;
    border-right-color: #B71F73;
}

.spinner-ring:nth-child(3) {
    animation-delay: -0.6s;
    border-top-color: rgba(183, 31, 115, 0.5);
    border-right-color: rgba(212, 40, 127, 0.5);
}

/* Círculo interno pulsante */
.spinner-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    background: linear-gradient(135deg, #B71F73, #d4287f);
    border-radius: 50%;
    animation: dotPulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(183, 31, 115, 0.6);
}

/* ========== TEXTO DE CARREGAMENTO ========== */
.better-loading-text {
    color: white;
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-align: center;
    animation: textFade 2s ease-in-out infinite;
}

.better-loading-subtext {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 400;
    margin-top: 0.5rem;
    animation: textFade 2s ease-in-out infinite 0.5s;
}

/* ========== BARRA DE PROGRESSO (OPCIONAL) ========== */
.better-loading-progress {
    width: 280px;
    height: 3px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.better-loading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #B71F73, #d4287f, #B71F73);
    background-size: 200% 100%;
    animation: progressSlide 1.5s ease-in-out infinite;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(183, 31, 115, 0.5);
}

/* ========== ANIMAÇÕES ========== */

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes spinRotate {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.7;
    }
}

@keyframes textFade {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes progressSlide {
    0% {
        background-position: 0% 0%;
    }
    100% {
        background-position: 200% 0%;
    }
}

/* ========== RESPONSIVE ========== */
@media (max-width: 767px) {
    .better-loading-logo {
        width: 200px;
    }

    .better-loading-spinner {
        width: 60px;
        height: 60px;
    }

    .better-loading-text {
        font-size: 1rem;
    }

    .better-loading-progress {
        width: 200px;
    }
}

/* ========== PREFERS REDUCED MOTION ========== */
@media (prefers-reduced-motion: reduce) {
    .better-loading-overlay,
    .better-loading-container,
    .better-loading-logo,
    .spinner-ring,
    .spinner-dot,
    .better-loading-text,
    .better-loading-subtext,
    .better-loading-progress-bar {
        animation: none !important;
        transition: none !important;
    }
}
