/**
 * Sistema Universal de Toasts/Notificações
 * MCE Eventos - 2025
 */

/* Container de toasts */
.toast-container {
    z-index: 9999 !important;
}

/* Estilos base dos toasts */
.toast {
    min-width: 350px;
    max-width: 450px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: none !important; /* Prevenir conflitos com Bootstrap */
    border: none !important;
}

/* Cores e gradientes dos toasts */
.toast.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: white !important;
}

.toast.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%) !important;
    color: white !important;
}

.toast.bg-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%) !important;
    color: #212529 !important;
}

.toast.bg-info {
    background: linear-gradient(135deg, #17a2b8 0%, #007bff 100%) !important;
    color: white !important;
}

/* Corpo do toast */
.toast-body {
    padding: 12px 16px;
    font-size: 0.9rem;
}

.toast .fw-bold {
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.toast .toast-message {
    font-size: 0.85rem;
    opacity: 0.95;
    line-height: 1.4;
}

/* Ícones dos toasts */
.toast .toast-icon {
    font-size: 1.2rem;
    margin-right: 8px;
    flex-shrink: 0;
}

/* Botão de fechar personalizado */
.toast .toast-close-btn {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.8;
    transition: all 0.2s ease;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    min-height: 24px;
    margin-left: auto;
}

.toast .toast-close-btn:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.1);
}

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

.toast .toast-close-btn span {
    font-size: 18px;
    line-height: 1;
}

/* Estilos para toasts com warning (texto escuro) */
.toast.bg-warning .toast-close-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Responsividade */
@media (max-width: 768px) {
    .toast {
        min-width: 300px;
        max-width: calc(100vw - 40px);
    }
    
    .toast-container {
        left: 20px !important;
        right: 20px !important;
        width: auto !important;
    }
}

/* Animações personalizadas */
.toast-slide-in {
    animation: slideInRight 0.3s ease-out forwards;
}

.toast-slide-out {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Loader para toasts de loading */
.toast-loader {
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 2px solid white;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Toast de loading especial */
.toast.toast-loading {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%) !important;
    color: white !important;
}

/* Contador de toasts múltiplos */
.toast-counter {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    min-width: 20px;
    height: 20px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    border: 2px solid white;
}

/* Estilos para modo escuro (se implementado no futuro) */
@media (prefers-color-scheme: dark) {
    .toast {
        box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    }
}
