/**
 * Toast Notifications System - GlassOS 2.0 Premium
 * Sistema de notificaciones moderno con glassmorphism
 * Compatible con el tema Electric Blue de TankFuel SaaS
 */

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

/* Toast individual */
.toast {
    background: linear-gradient(135deg, rgba(21, 32, 68, 0.98), rgba(5, 8, 22, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(0, 212, 255, 0.2);
    display: flex;
    gap: 12px;
    align-items: flex-start;
    pointer-events: all;
    cursor: pointer;
    min-width: 300px;
    max-width: 400px;
    transform: translateX(450px);
    opacity: 0;
    animation: slideInRight 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
    position: relative;
    overflow: hidden;
}

/* Animaciones de entrada/salida */
@keyframes slideInRight {
    from {
        transform: translateX(450px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

@keyframes slideOutRight {
    from {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
    to {
        transform: translateX(450px) scale(0.9);
        opacity: 0;
    }
}

/* Progress bar en la parte inferior */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--toast-color, #00d4ff), transparent);
    animation: toastProgress var(--toast-duration, 3000ms) linear forwards;
    border-radius: 0 0 16px 0;
}

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

/* Icono del toast */
.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--toast-bg, rgba(0, 212, 255, 0.2));
    color: var(--toast-color, #00d4ff);
    font-size: 14px;
}

.toast-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

/* Contenido del toast */
.toast-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    color: #f4f7ff;
    line-height: 1.4;
}

.toast-message {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.5;
}

/* Botón de cerrar */
.toast-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

.toast-close svg {
    width: 14px;
    height: 14px;
}

/* Tipos de toast */
.toast-success {
    --toast-color: #10b981;
    --toast-bg: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(16, 185, 129, 0.3);
}

.toast-error {
    --toast-color: #ef4444;
    --toast-bg: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(239, 68, 68, 0.3);
}

.toast-warning {
    --toast-color: #f59e0b;
    --toast-bg: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.3);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(245, 158, 11, 0.3);
}

.toast-info {
    --toast-color: #00d4ff;
    --toast-bg: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.3);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 30px rgba(0, 212, 255, 0.3);
}

/* Toast de confirmación */
.toast-confirm {
    min-width: 350px;
}

.toast-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.toast-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toast-btn-confirm {
    background: var(--toast-color, #00d4ff);
    color: #0a0a1a;
}

.toast-btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.4);
}

.toast-btn-cancel {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

.toast-btn-cancel:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #f4f7ff;
}

/* Hover effect en toast */
.toast:hover {
    transform: translateX(-4px);
    box-shadow:
        0 15px 50px rgba(0, 0, 0, 0.5),
        0 0 40px var(--toast-color);
}

.toast:hover .toast-progress {
    animation-play-state: paused;
}

/* Responsive */
@media (max-width: 768px) {
    .toast-container {
        right: 12px;
        left: 12px;
        top: 70px;
        max-width: none;
    }

    .toast {
        min-width: auto;
        max-width: none;
    }

    .toast-confirm {
        min-width: auto;
    }
}

/* Loading toast especial */
.toast-loading .toast-icon {
    animation: spin 1s linear infinite;
}

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