/* Loading Ajustado */
.ui-loading {
    /* Transparência com blur de fundo para um efeito de vidro (Glassmorphism) */
    background-color: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);

    position: fixed;
    margin: 0 !important;
    padding: 0 !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    /* Organiza o spinner e o texto verticalmente */
    justify-content: center;
    align-items: center;
    z-index: 9999;
    gap: 15px;
    /* Espaço entre o spinner e o texto */

    /* Transição suave para quando o loading sumir */
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

/* O Spinner Animado */
.ui-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #e0e0e0;
    border-top: 5px solid #00a2ff;
    /* Cor do destaque (substituindo o aqua antigo) */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Texto do Carregando */
.ui-loading-text {
    font-weight: 500;
    color: #333;
    font-size: 1.1rem;
    letter-spacing: 0.5px;
}

/* Classe que o JavaScript vai usar para sumir com o loading de forma suave */
.ui-loading-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Animação de Rotação */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}











/* CONTAINER: Posicionado no canto superior direito */
.toast-container {
    z-index: 1055;
    bottom: 20px !important;
    right: 2px !important;
    width: 100%;
    max-width: 420px;
}

/* TOAST PREMIUM BASE */
.custom-toast {
    border: none;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25);
    background: linear-gradient(135deg, #242238 0%, #191729 100%);
    overflow: hidden;
    position: relative;
}

/* Círculo do ícone base */
.toast-icon-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: bold;
    flex-shrink: 0;
}

/* Textos internos padrão */
.toast-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.toast-desc {
    color: #a5a3b9;
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.4;
}

/* CONTAINER: Posicionado bem no canto inferior direito acima de absolutamente TUDO */
.toast-container {
    /* z-index astronômico para cobrir modais (1060), loadings (9999) e overlays */
    z-index: 99999 !important; 
    
    top: auto !important;       /* Cancela o alinhamento superior padrão */
    bottom: 20px !important;    /* Distância elegante do rodapé */
    right: 2px !important;      /* Bem colado na borda direita da tela */
    width: 100%;
    max-width: 420px;
    pointer-events: none;       /* Evita que o container invisível bloqueie cliques na página */
}

/* Reativa os cliques apenas dentro do balão do Toast */
.custom-toast {
    pointer-events: auto;
}

/* Animação suave entrando de baixo para cima */
.custom-toast.showing {
    animation: slideInUp 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideInUp {
    from { transform: translateY(120%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}




/* Botão fechar customizado */
.btn-close-custom {
    background: none;
    border: none;
    color: #615f75;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
    line-height: 1;
}

.btn-close-custom:hover {
    color: #ffffff;
}

/* Animação suave entrando pela direita */
.custom-toast.showing {
    animation: slideInRight 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes slideInRight {
    from {
        transform: translateX(120%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==========================================================================
   VARIAÇÕES DE CASOS (Modificadores Dinâmicos)
   ========================================================================== */

/* CASO 1: ERRO (Vermelho) */
.custom-toast.toast-error::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #ff2a5f, #9a1a3a);
}

.custom-toast.toast-error .toast-icon-circle {
    background-color: rgba(255, 42, 95, 0.15);
    color: #ff2a5f;
}

.custom-toast.toast-error .toast-title {
    color: #ff2a5f;
}

/* CASO 2: SUCESSO (Verde) */
.custom-toast.toast-success::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #00e676, #00793b);
}

.custom-toast.toast-success .toast-icon-circle {
    background-color: rgba(0, 230, 118, 0.15);
    color: #00e676;
}

.custom-toast.toast-success .toast-title {
    color: #00e676;
}

/* CASO 3: INFORMAÇÃO (Azul / Ciano) */
.custom-toast.toast-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #00b0ff, #005b84);
}

.custom-toast.toast-info .toast-icon-circle {
    background-color: rgba(0, 176, 255, 0.15);
    color: #00b0ff;
}

.custom-toast.toast-info .toast-title {
    color: #00b0ff;
}



