/**
 * VALIDACAO_DUPLICADOS.CSS
 * Estilos para feedback visual de validação AJAX
 */

/* ===================================================================
   ESTADOS DO INPUT
   ================================================================= */

/* Input verificando (loading) */
input.checking {
    border-color: #17a2b8 !important;
    background-image: none !important;
    padding-right: 2.5rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2317a2b8'%3E%3Cpath d='M12 2a10 10 0 1 0 10 10A10 10 0 0 0 12 2zm0 18a8 8 0 1 1 8-8 8 8 0 0 1-8 8z'/%3E%3Cpath d='M12 6a1 1 0 0 1 1 1v4a1 1 0 0 1-2 0V7a1 1 0 0 1 1-1z'/%3E%3Cpath d='M12 15a1 1 0 1 0 0 2 1 1 0 0 0 0-2z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 1.5rem !important;
    animation: pulse-border 1.5s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% {
        border-color: #17a2b8;
    }
    50% {
        border-color: #5bc0de;
    }
}

/* Input válido (verde) */
input.is-valid {
    border-color: #28a745 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2328a745'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 1.5rem !important;
    padding-right: 2.5rem;
}

input.is-valid:focus {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
}

/* Input inválido (vermelho) */
input.is-invalid {
    border-color: #dc3545 !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23dc3545'%3E%3Cpath d='M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0.75rem center !important;
    background-size: 1.5rem !important;
    padding-right: 2.5rem;
}

input.is-invalid:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* ===================================================================
   MENSAGENS DE FEEDBACK
   ================================================================= */

.feedback-message {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sucesso (verde) */
.feedback-message.text-success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.feedback-message.text-success i {
    margin-right: 0.5rem;
    color: #28a745;
}

/* Erro (vermelho) */
.feedback-message.text-danger {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

.feedback-message.text-danger i {
    margin-right: 0.5rem;
    color: #dc3545;
}

/* Info/Verificando (azul) */
.feedback-message.text-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
}

.feedback-message.text-info i {
    margin-right: 0.5rem;
    color: #17a2b8;
}

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

/* Spinner girando */
.feedback-message i.fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* ===================================================================
   RESPONSIVO
   ================================================================= */

@media (max-width: 576px) {
    .feedback-message {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    input.is-valid,
    input.is-invalid,
    input.checking {
        background-size: 1.25rem !important;
        background-position: right 0.5rem center !important;
        padding-right: 2rem;
    }
}

/* ===================================================================
   ESTADOS HOVER
   ================================================================= */

.feedback-message:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* ===================================================================
   DARK MODE (opcional)
   ================================================================= */

@media (prefers-color-scheme: dark) {
    .feedback-message.text-success {
        color: #d4edda;
        background-color: #155724;
        border-color: #1e7e34;
    }
    
    .feedback-message.text-danger {
        color: #f8d7da;
        background-color: #721c24;
        border-color: #bd2130;
    }
    
    .feedback-message.text-info {
        color: #d1ecf1;
        background-color: #0c5460;
        border-color: #117a8b;
    }
}

/* ===================================================================
   ACESSIBILIDADE
   ================================================================= */

.feedback-message:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Alto contraste */
@media (prefers-contrast: high) {
    input.is-valid {
        border-width: 2px !important;
    }
    
    input.is-invalid {
        border-width: 2px !important;
    }
    
    .feedback-message {
        border-width: 2px;
    }
}