/* ===== TOAST NOTIFICATIONS ===== */
#toastContainer {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out forwards;
    pointer-events: auto;
    max-width: 380px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    overflow: hidden;
    position: relative;
}

.toast-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    border-radius: 8px 0 0 8px;
}

.toast-item.toast-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.toast-item.toast-success::before {
    background-color: #06b6d4;
}

.toast-item.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.toast-item.toast-error::before {
    background-color: #f87171;
}

.toast-item.toast-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.toast-item.toast-warning::before {
    background-color: #fbbf24;
}

.toast-item.toast-info {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.toast-item.toast-info::before {
    background-color: #60a5fa;
}

.toast-item.toast-loading {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
}

.toast-item.toast-loading::before {
    background-color: #818cf8;
}

/* Icono del Toast */
.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 22px;
    height: 22px;
}

.toast-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Contenedor del mensaje */
.toast-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

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

.toast-message {
    font-weight: 400;
    font-size: 13px;
    opacity: 0.95;
    line-height: 1.4;
}

/* Botón de cerrar */
.toast-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

.toast-close:hover {
    opacity: 1;
}

.toast-close svg {
    width: 18px;
    height: 18px;
    stroke-width: 2;
}

/* Barra de progreso para auto-cierre */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 8px 0;
    animation: progressShrink 4s linear forwards;
}

/* Animaciones */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(400px) rotateZ(5deg);
        pointer-events: none;
    }
    to {
        opacity: 1;
        transform: translateX(0) rotateZ(0deg);
        pointer-events: auto;
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0) rotateZ(0deg);
    }
    to {
        opacity: 0;
        transform: translateX(400px) rotateZ(-5deg);
        pointer-events: none;
    }
}

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

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

.toast-spinner {
    animation: spin 1.2s linear infinite;
}

.toast-item.removing {
    animation: slideOut 0.3s ease-in forwards;
}

/* Media Queries para dispositivos móviles */
@media (max-width: 640px) {
    #toastContainer {
        top: 12px;
        right: 12px;
        left: 12px;
        gap: 10px;
    }

    .toast-item {
        max-width: 100%;
        padding: 12px 14px;
        font-size: 13px;
    }

    .toast-content {
        gap: 1px;
    }

    .toast-title {
        font-size: 13px;
    }

    .toast-message {
        font-size: 12px;
    }
}

/* Toast con solo mensaje (sin title) */
.toast-item.toast-simple {
    padding: 12px 14px;
}

.toast-item.toast-simple .toast-content {
    gap: 0;
}

.toast-item.toast-simple .toast-title {
    display: none;
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .toast-item,
    .toast-item.removing,
    .toast-progress {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
