/* ============================================
   NOTIFICACIONES - POSICIÓN DEBAJO DEL HEADER
============================================ */
#toast-container {
    position: fixed;
    top: 74px; /* Altura del header (64px) + un pequeño margen */
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 90%;
    max-width: 600px;
    pointer-events: none; /* Permite hacer clic a través del contenedor */
    max-height: calc(100vh - 100px); /* Evita que crezca más allá de la pantalla */
    overflow: visible;
}

#toast-container .toast {
    pointer-events: auto; /* Reactiva el click en los toasts */
    width: 100%;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 14px 20px;
    border-radius: 8px;
    border-left: 4px solid var(--color-primary);
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0; /* Evita que se encojan */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#toast-container .toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Tipos de notificación */
#toast-container .toast.success {
    border-left-color: var(--accent-success);
    background: rgba(26, 46, 26, 0.95);
    color: #8bc34a;
}

#toast-container .toast.error {
    border-left-color: #dc3545;
    background: rgba(46, 26, 26, 0.95);
    color: #ff6b6b;
}

#toast-container .toast.info {
    border-left-color: var(--color-primary);
    background: rgba(46, 34, 26, 0.95);
    color: var(--text-primary);
}

#toast-container .toast.warning {
    border-left-color: #ffc107;
    background: rgba(46, 42, 26, 0.95);
    color: #ffd54f;
}

/* Iconos en las notificaciones */
#toast-container .toast .toast-icon {
    font-size: 20px;
    flex-shrink: 0;
    line-height: 1;
}

#toast-container .toast .toast-message {
    flex: 1;
    line-height: 1.4;
}

#toast-container .toast .toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 20px;
    padding: 0 4px;
    opacity: 0.4;
    transition: opacity 0.3s, transform 0.3s;
    line-height: 1;
    flex-shrink: 0;
}

#toast-container .toast .toast-close:hover {
    opacity: 1;
    transform: scale(1.1);
}

/* Animación de entrada */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

#toast-container .toast.show {
    animation: slideDown 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Animación de salida */
@keyframes slideUp {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
}

#toast-container .toast:not(.show) {
    animation: slideUp 0.3s ease forwards;
}

/* Contador de notificaciones (opcional) */
#toast-container .toast-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: var(--color-primary);
    color: var(--color-primary-darkest);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
}

/* Responsive */
@media (max-width: 768px) {
    #toast-container {
        top: 70px;
        width: 95%;
        max-width: 100%;
    }
    
    #toast-container .toast {
        padding: 12px 16px;
        font-size: 13px;
        border-radius: 6px;
    }
    
    #toast-container .toast .toast-icon {
        font-size: 18px;
    }
    
    #toast-container .toast .toast-close {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    #toast-container {
        top: 66px;
        width: 98%;
        gap: 8px;
    }
    
    #toast-container .toast {
        padding: 10px 14px;
        font-size: 12px;
        border-radius: 4px;
        border-left-width: 3px;
    }
}