/**
 * TOAST.CSS - Sistema de notificações moderno
 * Sistema de toast para feedback visual ao usuário
 */

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

/* Mobile: centralizar no topo */
@media (max-width: 768px) {
    .toast-container {
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

/* Toast individual */
.toast {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: all;
    animation: slideIn 0.3s ease-out;
    min-width: 300px;
    max-width: 100%;
}

/* Tipos de toast */
.toast.success {
    border-left: 4px solid var(--success-color, #10b981);
}

.toast.error {
    border-left: 4px solid var(--error-color, #ef4444);
}

.toast.info {
    border-left: 4px solid var(--primary-color, #3b82f6);
}

.toast.warning {
    border-left: 4px solid var(--warning-color, #f59e0b);
}

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

.toast.success .toast-icon {
    color: var(--success-color, #10b981);
}

.toast.error .toast-icon {
    color: var(--error-color, #ef4444);
}

.toast.info .toast-icon {
    color: var(--primary-color, #3b82f6);
}

.toast.warning .toast-icon {
    color: var(--warning-color, #f59e0b);
}

/* Mensagem do toast */
.toast-message {
    flex: 1;
    color: var(--gray-800, #1f2937);
    font-size: 14px;
    line-height: 1.5;
}

/* Botão fechar */
.toast-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    color: var(--gray-500, #6b7280);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
    padding: 0;
}

.toast-close:hover {
    color: var(--gray-700, #374151);
}

/* Barra de progresso */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: progress linear;
}

.toast.success .toast-progress {
    color: var(--success-color, #10b981);
}

.toast.error .toast-progress {
    color: var(--error-color, #ef4444);
}

.toast.info .toast-progress {
    color: var(--primary-color, #3b82f6);
}

.toast.warning .toast-progress {
    color: var(--warning-color, #f59e0b);
}

/* Animações */
@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

@keyframes progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Animação de saída */
.toast.fade-out {
    animation: slideOut 0.3s ease-in forwards;
}

/* Mobile: slide from top */
@media (max-width: 768px) {
    @keyframes slideIn {
        from {
            transform: translateY(-100px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }

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