/**
 * AMSOFT Solutions - Toast Notifications
 * Sistema de notificaciones profesional
 */

/* Container de notificaciones */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: none;
}

/* Toast individual */
.toast {
    pointer-events: auto;
    min-width: 320px;
    max-width: 420px;
    padding: 1rem 1.25rem;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1), 
                0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid transparent;
    position: relative;
    overflow: hidden;
}

/* Animación de entrada */
.toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* Animación de salida */
.toast.hide {
    transform: translateX(450px);
    opacity: 0;
}

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

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

/* Icono del toast */
.toast-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Contenido del toast */
.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-family: var(--font-display, 'Space Grotesk', sans-serif);
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.4;
    margin: 0 0 0.25rem 0;
    color: var(--color-secondary, #454545);
}

.toast-message {
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-slate-600, #64748b);
    margin: 0;
}

/* Botón de cerrar */
.toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 0.375rem;
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-slate-400, #94a3b8);
    transition: all 0.2s ease;
    font-family: 'Material Symbols Outlined';
    font-size: 1.25rem;
}

.toast-close:hover {
    background: var(--color-slate-100, #f1f5f9);
    color: var(--color-slate-600, #64748b);
}

/* Variantes de toast */
.toast.success {
    border-left-color: #10b981;
}

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

.toast.error {
    border-left-color: #ef4444;
}

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

.toast.warning {
    border-left-color: #f59e0b;
}

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

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

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

.toast.loading {
    border-left-color: var(--color-primary, #FBC02D);
}

.toast.loading .toast-icon {
    background: #fef9c3;
    color: var(--color-primary, #FBC02D);
}

/* Spinner de carga */
.toast-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modo oscuro */
.dark .toast {
    background: var(--color-slate-800, #1e293b);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), 
                0 4px 12px rgba(0, 0, 0, 0.2);
}

.dark .toast-title {
    color: white;
}

.dark .toast-message {
    color: var(--color-slate-300, #cbd5e1);
}

.dark .toast-close {
    color: var(--color-slate-500, #64748b);
}

.dark .toast-close:hover {
    background: var(--color-slate-700, #334155);
    color: var(--color-slate-300, #cbd5e1);
}

/* Responsive */
@media (max-width: 640px) {
    .toast-container {
        top: auto;
        bottom: 1rem;
        right: 1rem;
        left: 1rem;
    }
    
    .toast {
        min-width: unset;
        max-width: unset;
        width: 100%;
        transform: translateY(100px);
    }
    
    .toast.show {
        transform: translateY(0);
    }
    
    .toast.hide {
        transform: translateY(150px);
    }
}
