/* ============================================================
   SISTEMA DE ALERTAS GLOBAL
   ============================================================ */
.alerts-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: 400px;
    width: calc(100% - 2rem);
}

.alert {
    background: var(--panel);
    border: 1px solid var(--borders);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    pointer-events: auto;
    animation: alertSlideIn 0.3s ease;
    position: relative;
    overflow: hidden;
}

@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes alertSlideInMobile {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert.closing {
    animation: alertSlideOut 0.3s ease forwards;
}

@keyframes alertSlideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

@keyframes alertSlideOutMobile {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-100%);
    }
}

.alert-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.alert-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.alert-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--txt);
    margin: 0;
}

.alert-message {
    font-size: 0.9rem;
    color: var(--txt);
    margin: 0;
    line-height: 1.4;
}

.alert-close {
    flex-shrink: 0;
    background: transparent;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--txt);
    transition: all 0.2s ease;
    margin-left: 0.5rem;
}

.alert-close:hover {
    background: var(--hover);
    color: var(--accent);
}

.alert-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: alertProgress linear forwards;
}

@keyframes alertProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Tipos de alerta */
.alert.success {
    border-left: 4px solid #10b981;
}

.alert.success .alert-icon {
    color: #10b981;
}

.alert.success .alert-progress {
    color: #10b981;
}

.alert.error {
    border-left: 4px solid var(--accent);
}

.alert.error .alert-icon {
    color: var(--accent);
}

.alert.error .alert-progress {
    color: var(--accent);
}

.alert.warning {
    border-left: 4px solid #f59e0b;
}

.alert.warning .alert-icon {
    color: #f59e0b;
}

.alert.warning .alert-progress {
    color: #f59e0b;
}

.alert.info {
    border-left: 4px solid #3b82f6;
}

.alert.info .alert-icon {
    color: #3b82f6;
}

.alert.info .alert-progress {
    color: #3b82f6;
}

/* Responsive */
@media (max-width: 576px) {
    .alerts-container {
        top: 0.75rem;
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
        max-width: none;
    }
    
    .alert {
        padding: 0.875rem 1rem;
        animation: alertSlideInMobile 0.3s ease;
    }
    
    .alert.closing {
        animation: alertSlideOutMobile 0.3s ease forwards;
    }
    
    .alert-title {
        font-size: 0.9rem;
    }
    
    .alert-message {
        font-size: 0.85rem;
    }
}