/* ========================================
   SISTEMA DE TOAST NOTIFICATIONS
   ======================================== */

/* Container dos toasts (topo direito) */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    pointer-events: none;
}

/* Toast base */
.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 300px;
    max-width: 400px;
    pointer-events: auto;
    transform: translateX(120%);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    opacity: 0;
    border-left: 4px solid #ccc;
}

/* Animação de entrada */
.toast-show {
    transform: translateX(0);
    opacity: 1;
}

/* Animação de saída */
.toast-hide {
    transform: translateX(120%);
    opacity: 0;
}

/* Ícone do toast */
.toast-icon {
    flex-shrink: 0;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

/* Conteúdo do toast */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    word-wrap: break-word;
}

/* Botão de fechar */
.toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.toast-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

.toast-close:active {
    transform: scale(0.95);
}

/* ========================================
   TIPOS DE TOAST
   ======================================== */

/* Success (Verde) */
.toast-success {
    border-left-color: #10b981;
}

.toast-success .toast-icon {
    color: #10b981;
}

.toast-success .toast-message {
    color: #047857;
}

/* Error (Vermelho) */
.toast-error {
    border-left-color: #ef4444;
}

.toast-error .toast-icon {
    color: #ef4444;
}

.toast-error .toast-message {
    color: #b91c1c;
}

/* Warning (Amarelo) */
.toast-warning {
    border-left-color: #f59e0b;
}

.toast-warning .toast-icon {
    color: #f59e0b;
}

.toast-warning .toast-message {
    color: #d97706;
}

/* Info (Azul) */
.toast-info {
    border-left-color: #3b82f6;
}

.toast-info .toast-icon {
    color: #3b82f6;
}

.toast-info .toast-message {
    color: #1e40af;
}

/* Toast com loading */
.toast-loading .toast-icon {
    color: #3b82f6;
}

/* ========================================
   RESPONSIVIDADE
   ======================================== */

/* Mobile */
@media (max-width: 768px) {
    #toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
    
    .toast-message {
        font-size: 13px;
    }
    
    .toast-icon {
        font-size: 20px;
        width: 24px;
        height: 24px;
    }
}

/* Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    #toast-container {
        max-width: 350px;
    }
    
    .toast {
        min-width: 280px;
        max-width: 350px;
    }
}

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

/* Foco visível para navegação por teclado */
.toast-close:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Reduzir movimento para usuários com preferência */
@media (prefers-reduced-motion: reduce) {
    .toast {
        transition: opacity 0.2s;
    }
    
    .toast-show {
        animation: none;
    }
    
    .toast-hide {
        animation: none;
    }
}

/* ========================================
   MÚLTIPLOS TOASTS
   ======================================== */

/* Quando há muitos toasts, limitar altura e adicionar scroll */
#toast-container {
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

/* Estilizar scrollbar (webkit) */
#toast-container::-webkit-scrollbar {
    width: 6px;
}

#toast-container::-webkit-scrollbar-track {
    background: transparent;
}

#toast-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

#toast-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

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

/* Pausar auto-dismiss ao passar o mouse */
.toast:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2), 0 3px 6px rgba(0, 0, 0, 0.15);
}

/* Animação sutil ao passar o mouse */
.toast {
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55),
                box-shadow 0.2s ease;
}
