/**
 * Toasty Notifications - Estilos CSS
 * Sistema moderno de notificações toast
 */

/* Container principal dos toasts */
.toasty-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    pointer-events: none;
    max-width: 400px;
}

/* Toast individual */
.toasty {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    margin-bottom: 12px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    pointer-events: auto;
    border-left: 4px solid #007bff;
    overflow: hidden;
    position: relative;
}

/* Estados de animação */
.toasty-show {
    opacity: 1;
    transform: translateX(0);
}

.toasty-hide {
    opacity: 0;
    transform: translateX(100%);
}

/* Conteúdo do toast */
.toasty-content {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    position: relative;
}

/* Ícone */
.toasty-icon {
    margin-right: 12px;
    font-size: 20px;
    flex-shrink: 0;
}

/* Mensagem */
.toasty-message {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    font-weight: 500;
}

/* Botão de fechar */
.toasty-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: color 0.2s ease;
}

.toasty-close:hover {
    color: #666;
}

/* Tipos de toast */

/* Sucesso */
.toasty-success {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #ffffff 100%);
}

.toasty-success .toasty-icon {
    color: #28a745;
}

.toasty-success .toasty-message {
    color: #155724;
}

/* Erro */
.toasty-error {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #ffffff 100%);
}

.toasty-error .toasty-icon {
    color: #dc3545;
}

.toasty-error .toasty-message {
    color: #721c24;
}

/* Aviso */
.toasty-warning {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd 0%, #ffffff 100%);
}

.toasty-warning .toasty-icon {
    color: #ffc107;
}

.toasty-warning .toasty-message {
    color: #856404;
}

/* Informação */
.toasty-info {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, #d1ecf1 0%, #ffffff 100%);
}

.toasty-info .toasty-icon {
    color: #17a2b8;
}

.toasty-info .toasty-message {
    color: #0c5460;
}

/* Efeitos hover */
.toasty:hover {
    transform: translateX(-5px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.2);
}

/* Barra de progresso (opcional) */
.toasty-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    width: 100%;
    overflow: hidden;
}

.toasty-progress::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: currentColor;
    width: 100%;
    animation: toasty-progress-animation linear;
}

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

/* Responsividade */
@media (max-width: 768px) {
    .toasty-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .toasty {
        transform: translateY(-100%);
    }
    
    .toasty-show {
        transform: translateY(0);
    }
    
    .toasty-hide {
        transform: translateY(-100%);
    }
    
    .toasty-content {
        padding: 14px 16px;
    }
    
    .toasty-message {
        font-size: 13px;
    }
}

/* Tema escuro */
@media (prefers-color-scheme: dark) {
    .toasty {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .toasty-message {
        color: #e2e8f0;
    }
    
    .toasty-close {
        color: #a0aec0;
    }
    
    .toasty-close:hover {
        color: #e2e8f0;
    }
    
    /* Ajustar cores dos tipos no tema escuro */
    .toasty-success {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
    
    .toasty-error {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
    
    .toasty-warning {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
    
    .toasty-info {
        background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
    }
}

/* Animações adicionais */
@keyframes toasty-bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

.toasty-bounce {
    animation: toasty-bounce 1s ease-in-out;
}

/* Efeito de empilhamento */
.toasty:nth-child(n+4) {
    opacity: 0.8;
    transform: scale(0.95) translateX(0);
}

.toasty:nth-child(n+5) {
    opacity: 0.6;
    transform: scale(0.9) translateX(0);
}

.toasty:nth-child(n+6) {
    display: none;
}