/* ═══════════════════════════════════════════════════════════
   Toast Notification v3  —  Premium 2026
   ═══════════════════════════════════════════════════════════ */

/* ── Container ── */
.toast-notify {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 10000;
    min-width: 340px;
    max-width: 440px;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    gap: .875rem;
    padding: 1.05rem 1.15rem 1rem 1.15rem;
    box-shadow:
        0 0 0 1px rgba(0,0,0,.04),
        0 1px 2px rgba(0,0,0,.03),
        0 4px 12px rgba(0,0,0,.06),
        0 16px 40px -6px rgba(0,0,0,.14);
    font-family: 'Cairo', 'Inter', system-ui, sans-serif;
}

/* Colored accent bar on the left */
.toast-notify::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    border-radius: 16px 0 0 16px;
}

html[dir="rtl"] .toast-notify::before {
    left: auto;
    right: 0;
    border-radius: 0 16px 16px 0;
}

/* RTL: flip to left side */
html[dir="rtl"] .toast-notify {
    right: auto;
    left: 1.25rem;
}

@media (max-width: 576px) {
    .toast-notify {
        left: .75rem;
        right: .75rem;
        min-width: unset;
        max-width: unset;
        top: .75rem;
    }
    html[dir="rtl"] .toast-notify {
        left: .75rem;
        right: .75rem;
    }
}

/* ── Color accent bars ── */
.toast-notify--success::before { background: linear-gradient(180deg, #34d399, #16a34a); }
.toast-notify--danger::before  { background: linear-gradient(180deg, #fb7185, #dc2626); }
.toast-notify--warning::before { background: linear-gradient(180deg, #fbbf24, #d97706); }
.toast-notify--info::before    { background: linear-gradient(180deg, #60a5fa, #2563eb); }

/* ── Icon ── */
.toast-notify__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    position: relative;
}

/* Subtle ring around icon */
.toast-notify__icon::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 14px;
    border: 2px solid transparent;
    opacity: .3;
}

.toast-notify--success .toast-notify__icon { background: #f0fdf4; color: #16a34a; }
.toast-notify--success .toast-notify__icon::after { border-color: #22c55e; }
.toast-notify--danger  .toast-notify__icon { background: #fef2f2; color: #dc2626; }
.toast-notify--danger  .toast-notify__icon::after { border-color: #ef4444; }
.toast-notify--warning .toast-notify__icon { background: #fffbeb; color: #d97706; }
.toast-notify--warning .toast-notify__icon::after { border-color: #f59e0b; }
.toast-notify--info    .toast-notify__icon { background: #eff6ff; color: #2563eb; }
.toast-notify--info    .toast-notify__icon::after { border-color: #3b82f6; }

/* Icon pop-in */
.toast-notify--in .toast-notify__icon {
    animation: toastIconPop .5s .15s cubic-bezier(.34,1.56,.64,1) both;
}
@keyframes toastIconPop {
    0%   { transform: scale(0); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ── Text body ── */
.toast-notify__body {
    flex: 1;
    padding-bottom: .5rem;
    min-width: 0;
}

.toast-notify__title {
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #94a3b8;
    margin-bottom: 3px;
}

.toast-notify__msg {
    font-size: .875rem;
    font-weight: 600;
    line-height: 1.5;
    color: #1e293b;
    word-break: break-word;
}

/* ── Close button ── */
.toast-notify__close {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    cursor: pointer;
    font-size: .72rem;
    flex-shrink: 0;
    color: #94a3b8;
    transition: all .2s ease;
    margin-top: 2px;
}
.toast-notify__close:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
    transform: rotate(90deg);
}

/* ── Progress bar ── */
.toast-notify__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #f1f5f9;
    overflow: hidden;
}

.toast-notify__bar {
    height: 100%;
    width: 100%;
    transform-origin: left center;
    animation-name: toastProgress;
    animation-timing-function: linear;
    animation-fill-mode: forwards;
}

html[dir="rtl"] .toast-notify__bar {
    transform-origin: right center;
}

.toast-notify--success .toast-notify__bar {
    background: linear-gradient(90deg, #22c55e, #4ade80);
    box-shadow: 0 0 10px rgba(34,197,94,.4);
}
.toast-notify--danger  .toast-notify__bar {
    background: linear-gradient(90deg, #ef4444, #fb7185);
    box-shadow: 0 0 10px rgba(239,68,68,.4);
}
.toast-notify--warning .toast-notify__bar {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    box-shadow: 0 0 10px rgba(245,158,11,.4);
}
.toast-notify--info    .toast-notify__bar {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    box-shadow: 0 0 10px rgba(59,130,246,.4);
}

@keyframes toastProgress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}

/* ── Entrance: spring slide from right ── */
.toast-notify--in {
    animation: toastSlideIn .45s cubic-bezier(.21,1.02,.73,1) forwards;
}
@keyframes toastSlideIn {
    0%   { opacity: 0; transform: translateX(50px) scale(.95); }
    60%  { transform: translateX(-3px) scale(1.005); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

/* RTL entrance: from left */
html[dir="rtl"] .toast-notify--in {
    animation-name: toastSlideInRtl;
}
@keyframes toastSlideInRtl {
    0%   { opacity: 0; transform: translateX(-50px) scale(.95); }
    60%  { transform: translateX(3px) scale(1.005); }
    100% { opacity: 1; transform: translateX(0) scale(1); }
}

/* ── Exit: smooth fade out ── */
.toast-notify--out {
    animation: toastSlideOut .35s cubic-bezier(.4,0,1,1) forwards;
}
@keyframes toastSlideOut {
    0%   { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-14px) scale(.96); }
}


/* ═══════════════════════════════════════════════════════════
   Premium Inline Alerts  (Bootstrap .alert overrides)
   Applies to all admin pages that use .alert classes
   ═══════════════════════════════════════════════════════════ */

.alert {
    border: none;
    border-radius: 14px;
    padding: 1rem 1.25rem;
    font-size: .875rem;
    font-weight: 500;
    line-height: 1.55;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.04);
    animation: alertFadeIn .4s cubic-bezier(.34,1.3,.64,1);
    font-family: 'Cairo', 'Inter', system-ui, sans-serif;
}

/* Accent bar on left (right for RTL) */
.alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 4px;
    border-radius: 14px 0 0 14px;
}
html[dir="rtl"] .alert::before {
    left: auto;
    right: 0;
    border-radius: 0 14px 14px 0;
}

/* Icons inside alerts get colored circle bg */
.alert > i.bi,
.alert > .bi,
.alert .d-flex > i.bi:first-child {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ── Success ── */
.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}
.alert-success::before {
    background: linear-gradient(180deg, #34d399, #16a34a);
}
.alert-success > i.bi,
.alert-success > .bi,
.alert-success .d-flex > i.bi:first-child {
    background: #dcfce7;
    color: #16a34a;
}

/* ── Danger ── */
.alert-danger {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}
.alert-danger::before {
    background: linear-gradient(180deg, #fb7185, #dc2626);
}
.alert-danger > i.bi,
.alert-danger > .bi,
.alert-danger .d-flex > i.bi:first-child {
    background: #fee2e2;
    color: #dc2626;
}

/* ── Warning ── */
.alert-warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}
.alert-warning::before {
    background: linear-gradient(180deg, #fbbf24, #d97706);
}
.alert-warning > i.bi,
.alert-warning > .bi,
.alert-warning .d-flex > i.bi:first-child {
    background: #fef3c7;
    color: #d97706;
}

/* ── Info ── */
.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}
.alert-info::before {
    background: linear-gradient(180deg, #60a5fa, #2563eb);
}
.alert-info > i.bi,
.alert-info > .bi,
.alert-info .d-flex > i.bi:first-child {
    background: #dbeafe;
    color: #2563eb;
}

/* ── Alert close button ── */
.alert .btn-close {
    background: none;
    border: 1.5px solid rgba(0,0,0,.1);
    border-radius: 8px;
    width: 28px;
    height: 28px;
    padding: 0;
    opacity: .5;
    transition: all .2s ease;
    background-size: .65rem;
}
.alert .btn-close:hover {
    opacity: 1;
    border-color: rgba(0,0,0,.2);
    transform: rotate(90deg);
}

/* ── Dismissible fix ── */
.alert-dismissible {
    padding-inline-end: 3.5rem;
}
.alert-dismissible .btn-close {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 1rem;
}
html[dir="rtl"] .alert-dismissible .btn-close {
    right: auto;
    left: 1rem;
}
.alert-dismissible .btn-close:hover {
    transform: translateY(-50%) rotate(90deg);
}

/* ── Entrance animation ── */
@keyframes alertFadeIn {
    0%   { opacity: 0; transform: translateY(-10px) scale(.97); }
    60%  { transform: translateY(2px) scale(1.003); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ── Alert links ── */
.alert .alert-link {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity .15s;
}
.alert .alert-link:hover {
    opacity: .75;
}

/* ── Flex alerts (common pattern: icon + text + close) ── */
.alert.d-flex {
    gap: .75rem;
}
