/**
 * إشعارات العمليات (toast) — متوافق مع RTL والهوية البصرية للتطبيق
 */
.app-toast-host {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 12000;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    pointer-events: none;
    max-width: 100%;
}

@media (min-width: 576px) {
    .app-toast-host {
        top: 0.75rem;
        right: 0.75rem;
        left: auto;
        max-width: 420px;
        align-items: flex-end;
    }
}

.app-toast {
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    font-family: var(--bs-body-font-family, 'Tajawal', sans-serif);
    border-radius: var(--radius-card, 16px);
    box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.15));
    border: 1px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: app-toast-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    text-align: right;
    direction: rtl;
}

.app-toast.is-leaving {
    animation: app-toast-out 0.35s cubic-bezier(0.55, 0, 1, 0.45) forwards;
}

@keyframes app-toast-in {
    from {
        opacity: 0;
        transform: translateY(-18px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes app-toast-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-12px) scale(0.96);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-toast {
        animation: none;
        opacity: 1;
        transform: none;
    }
    .app-toast.is-leaving {
        animation: none;
        opacity: 0;
    }
}

.app-toast__inner {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1rem 0.85rem;
}

.app-toast__icon {
    flex-shrink: 0;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
}

.app-toast__body {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.98);
}

.app-toast__close {
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.12);
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.app-toast__close:hover {
    background: rgba(255, 255, 255, 0.22);
}

.app-toast__progress {
    height: 3px;
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    margin-top: 0.15rem;
}

.app-toast__progress-bar {
    height: 100%;
    width: 100%;
    transform-origin: right center;
    animation: app-toast-progress linear forwards;
}

@keyframes app-toast-progress {
    from {
        transform: scaleX(1);
    }
    to {
        transform: scaleX(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .app-toast__progress-bar {
        animation: none;
        width: 0;
    }
}

/* أنواع الرسائل */
.app-toast--success {
    background: linear-gradient(135deg, #1a6b5c 0%, #2d8a7a 45%, #3aa899 100%);
    color: #fff;
}

.app-toast--success .app-toast__icon {
    background: rgba(255, 255, 255, 0.18);
}

.app-toast--error {
    background: linear-gradient(135deg, #8b2635 0%, #b83b4d 50%, #c94d5e 100%);
    color: #fff;
}

.app-toast--error .app-toast__icon {
    background: rgba(255, 255, 255, 0.15);
}

.app-toast--warning {
    background: linear-gradient(135deg, #8a6d1a 0%, #b8942a 50%, #c9a43a 100%);
    color: #1a1a1a;
}

.app-toast--warning .app-toast__body,
.app-toast--warning .app-toast__close {
    color: #1a1a1a;
}

.app-toast--warning .app-toast__icon {
    background: rgba(0, 0, 0, 0.08);
}

.app-toast--info {
    background: linear-gradient(135deg, #1a5f6e 0%, #217a8c 50%, #2a8fa3 100%);
    color: #fff;
}

.app-toast--info .app-toast__icon {
    background: rgba(255, 255, 255, 0.15);
}
