/* ============================================
   REBULDIO - NOTIFICATIONS (toasts + alerts)
   ============================================ */

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(110%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideOutRight {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(110%); }
}

@keyframes slideInDown {
    from { opacity: 0; transform: translateY(-120%); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideOutUp {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-120%); }
}

/* ---------- Toasts ---------- */
.toast-container {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: calc(100vw - 2.5rem);
}

.toast {
    min-width: 320px;
    max-width: 460px;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    background: #fff;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--anthracite-600);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    pointer-events: auto;
    animation: slideInRight 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.removing { animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 1, 1) forwards; }

.toast-icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    font-size: 1.1rem;
    font-weight: 700;
    background: var(--gray-100);
    color: var(--anthracite-700);
}

.toast-content { flex: 1; min-width: 0; padding-top: 0.1rem; }
.toast-title { margin: 0 0 0.15rem; font-size: 0.95rem; font-weight: 700; color: var(--anthracite-900); }
.toast-message { margin: 0; font-size: 0.875rem; line-height: 1.5; color: var(--text-secondary); }

.toast-close {
    flex-shrink: 0;
    width: 1.9rem;
    height: 1.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--gray-100);
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.toast-close:hover { background: var(--anthracite-800); color: #fff; }

.toast.success { border-left-color: var(--success); }
.toast.success .toast-icon { background: var(--success-light); color: #047857; }
.toast.error { border-left-color: var(--error); }
.toast.error .toast-icon { background: var(--error-light); color: #B91C1C; }
.toast.warning { border-left-color: var(--primary); }
.toast.warning .toast-icon { background: var(--primary-light); color: var(--primary-hover); }
.toast.info { border-left-color: var(--info); }
.toast.info .toast-icon { background: var(--info-light); color: #1D4ED8; }

@media (max-width: 560px) {
    .toast-container {
        top: calc(0.75rem + env(safe-area-inset-top));
        left: 0.75rem;
        right: 0.75rem;
        max-width: none;
    }
    .toast { min-width: 0; max-width: none; width: 100%; animation-name: slideInDown; }
    .toast.removing { animation-name: slideOutUp; }
}

/* ---------- Alerts ---------- */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 1rem 1.15rem;
    margin-bottom: 1rem;
    background: var(--gray-50);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--anthracite-600);
    border-radius: var(--radius-md);
    color: var(--anthracite-800);
}

.alert-icon { flex-shrink: 0; font-size: 1.15rem; line-height: 1.4; }
.alert-content { flex: 1; min-width: 0; }
.alert-title { margin: 0 0 0.15rem; font-size: 0.95rem; font-weight: 700; color: inherit; }
.alert-message { margin: 0; font-size: 0.9rem; line-height: 1.55; color: inherit; opacity: 0.9; }

.alert-close {
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    border: none;
    border-radius: var(--radius-sm);
    background: transparent;
    color: inherit;
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity var(--transition-fast), background-color var(--transition-fast);
}

.alert-close:hover { opacity: 1; background: rgba(28, 31, 36, 0.08); }

.alert-success { background: #ECFDF5; border-color: #A7F3D0; border-left-color: var(--success); color: #065F46; }
.alert-error { background: #FEF2F2; border-color: #FECACA; border-left-color: var(--error); color: #991B1B; }
.alert-warning { background: var(--primary-light); border-color: var(--primary-soft); border-left-color: var(--primary); color: #9A3F0C; }
.alert-info { background: #EFF6FF; border-color: #BFDBFE; border-left-color: var(--info); color: #1E40AF; }
