/* ==========================================================================
   Gerenciador de Loader Global (.app-loader)
   ========================================================================== */

.app-loader {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(
        255,
        255,
        255,
        0.4
    ); /* Levemente aumentado para destacar o efeito */
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(10px); /* Safari */

    /* Configuração para o comportamento do Flex */
    display: flex;
    justify-content: center;
    align-items: center;

    /* Configuração da Transição Suave */
    opacity: 0;
    visibility: hidden;
    transition:
        opacity 0.4s ease,
        visibility 0.4s ease; /* Transiciona em 400ms */
}

/* Quando o JS ativa o Loader */
.app-loader.is-visible {
    opacity: 1;
    visibility: visible;
}

/* Container do conteúdo do loader (Ring + Imagem) */
.app-loader-content {
    position: relative;
    width: 160px;
    height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

/* Customização da Imagem Centralizada (Sadcon) */
.app-loader-content img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 2;
    animation: logoPulse 2s ease-in-out infinite;
}

/* ==========================================================================
   Anéis de Carregamento (Loader Ring)
   ========================================================================== */

.loader-ring {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px solid var(--bgDivFenceGray, #e0e0e0);
    border-top-color: var(--primaryColor, #007bff);
    background: var(--whiteColor, #ffffff);
    animation: spin 1.4s linear infinite;
    z-index: 1;
}

.loader-ring::before {
    content: '';
    position: absolute;
    inset: 12px;
    border-radius: 50%;
    border: 2px solid transparent;
    border-right-color: var(--primaryColor-2, #0056b3);
    animation: spinReverse 2.5s linear infinite;
}

/* ==========================================================================
   Animações (Keyframes)
   ========================================================================== */

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

@keyframes spinReverse {
    from {
        transform: rotate(360deg);
    }
    to {
        transform: rotate(0deg);
    }
}

@keyframes logoPulse {
    0%,
    100% {
        transform: scale(0.95);
        opacity: 0.8;
        filter: drop-shadow(0 0 0 rgba(200, 135, 104, 0));
    }
    50% {
        transform: scale(1.05);
        opacity: 1;
        filter: drop-shadow(0 0 18px rgba(200, 135, 104, 0.45));
    }
}
