/**
 * Sistema de Toast Unificado
 * CSS personalizado para toasts do Bootstrap com cores do projeto
 * Baseado no estilo original do stylePerfilUser.css
 */

/* === ESTILOS BASE ORIGINAIS === */

/* Container para toasts */
.toast-container {
    z-index: 1060 !important;
    max-width: 350px;
}

.toast {
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.toast-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem; /* Espaçamento entre header e body */
}

.toast-body {
    padding: 0.5rem 1rem 1rem 1rem; /* Reduzido padding-top para compensar o margin do header */
    font-size: 0.9rem;
    line-height: 1.4;
}

/* === CORES PERSONALIZADAS ORIGINAIS DO PROJETO === */

/* Toast de Sucesso */
.toast.text-bg-success {
    background-color: #142661 !important;
    color: #fff!important;
}

.toast.text-bg-success .toast-header {
    background-color: #f79633;
    color: #fff;
}

.toast.text-bg-success .toast-body {
    background-color: #142661;
    color: #fff;
}

/* Toast de Erro - cores especiais para alertas */
.toast.text-bg-danger {
    background-color: #842029 !important;
    color: #fff !important;
}

.toast.text-bg-danger .toast-header {
    background-color: #f79633;
    color: #fff;
}

.toast.text-bg-danger .toast-body {
    background-color: #842029;
    color: #fff;
}

/* Toast de Aviso */
.toast.text-bg-warning {
    background-color: #142661 !important;
    color: #fff!important;
}

.toast.text-bg-warning .toast-header {
    background-color: #f79633;
    color: #fff;
}

.toast.text-bg-warning .toast-body {
    background-color: #142661;
    color: #fff;
}

/* Toast de Informação */
.toast.text-bg-info {
    background-color: #142661 !important;
    color: #fff!important;
}

.toast.text-bg-info .toast-header {
    background-color: #f79633;
    color: #fff;
}

.toast.text-bg-info .toast-body {
    background-color: #142661;
    color: #fff;
}

/* === ANIMAÇÕES ORIGINAIS === */

/* Animações suaves */
.toast {
    transition: all 0.3s ease-in-out;
}

.toast.showing {
    opacity: 1;
    transform: translateX(0);
}

.toast.hide {
    opacity: 0;
    transform: translateX(100%);
}

/* === RESPONSIVIDADE ORIGINAL === */

/* Responsividade para mobile */
@media (max-width: 576px) {
    .toast-container {
        position: fixed !important;
        top: 1rem !important;
        right: 1rem !important;
        left: 1rem !important;
        max-width: none;
    }
    
    .toast {
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* === ESTILOS ADICIONAIS PARA API UNIFICADA === */

/* Botão de fechar */
.toast .btn-close {
    margin-right: 0.25rem;
    margin-top: 0.25rem;
}

/* Toast de Sessão Expirada - usando estilo padrão */
.toast.session-expired {
    background-color: #142661 !important;
    color: #fff!important;
}

.toast.session-expired .toast-header {
    background-color: #f79633;
    color: #fff;
    font-weight: bold;
}

.toast.session-expired .toast-body {
    background-color: #142661;
    color: #fff !important;
    font-size: 0.9rem;
}

.toast.session-expired .countdown {
    font-weight: bold;
    color: #ffc107;
}

/* Toast de Confirmação - usando estilo padrão */
.toast.confirmation {
    background-color: #142661 !important;
    color: #fff !important;
}

.toast.confirmation .toast-header {
    background-color: #f79633 !important;
    color: white !important;
}

.toast.confirmation .toast-body {
    background-color: #142661;
    color: #fff !important;
    padding-bottom: 0.5rem;
}

.toast.confirmation .toast-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    padding: 0 1rem 1rem 1rem;
    background-color: #142661; /* Manter fundo consistente */
}

.toast.confirmation .btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 0.375rem;
    min-width: 60px;
}

.toast.confirmation .btn-primary {
    background-color: #f79633; /* Usar cor de destaque do projeto */
    border-color: #f79633;
}

.toast.confirmation .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

/* === CLASSES UTILITÁRIAS === */

/* Classe para toasts persistentes (não se fecham automaticamente) */
.toast.persistent .toast-header .btn-close {
    display: none;
}

/* Classe para toasts com prioridade alta */
.toast.priority-high {
    z-index: 1070;
    box-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.25);
}

/* Classe para toasts compactos */
.toast.compact {
    max-width: 280px;
    min-width: 250px;
}

.toast.compact .toast-header {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    margin-bottom: 0.25rem; /* Menor espaçamento para versão compacta */
}

.toast.compact .toast-body {
    padding: 0.25rem 0.75rem 0.75rem 0.75rem; /* Ajustado para compensar o margin menor */
    font-size: 0.8rem;
}

/* === TEMA ESCURO === */
@media (prefers-color-scheme: dark) {
    .toast {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    
    /* Ajustar cores para tema escuro se necessário */
    .toast.text-bg-success {
        background-color: #1e3a28 !important;
        color: #b8e6c1 !important;
    }
    
    .toast.text-bg-danger {
        background-color: #3a1e22 !important;
        color: #f5b7b7 !important;
    }
    
    .toast.text-bg-warning {
        background-color: #3a3520 !important;
        color: #f5e6b8 !important;
    }
    
    .toast.text-bg-info {
        background-color: #1e3135 !important;
        color: #b8e2e8 !important;
    }
}

/* === PRINT === */
@media print {
    .toast-container,
    .toast {
        display: none !important;
    }
}
