/* ═══════════════════════════════════════════════════
   ADMIN UX — Toast / Confirm / Loading
   ═══════════════════════════════════════════════════ */

/* ─── Toast Container ─── */
.ux-toast-wrap {
    position: fixed;
    top: 80px;
    left: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 380px;
}
.ux-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bs-body-bg);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,.15), 0 0 0 1px rgba(0,0,0,.04);
    min-width: 300px;
    transform: translateX(-120%);
    transition: all .35s cubic-bezier(.2,.9,.3,1.2);
    border-right: 4px solid #7367F0;
    position: relative;
    overflow: hidden;
}
.ux-toast.show {
    transform: translateX(0);
}
.ux-toast.hide {
    transform: translateX(-120%);
    opacity: 0;
}
.ux-toast.success { border-right-color: #28c76f; }
.ux-toast.error   { border-right-color: #ea5455; }
.ux-toast.warning { border-right-color: #ff9f43; }
.ux-toast.info    { border-right-color: #00cfe8; }

.ux-toast-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.ux-toast.success .ux-toast-icon { background: rgba(40,199,111,.12); color: #28c76f; }
.ux-toast.error   .ux-toast-icon { background: rgba(234,84,85,.12); color: #ea5455; }
.ux-toast.warning .ux-toast-icon { background: rgba(255,159,67,.12); color: #ff9f43; }
.ux-toast.info    .ux-toast-icon { background: rgba(0,207,232,.12); color: #00cfe8; }

.ux-toast-body { flex: 1; min-width: 0; }
.ux-toast-title { font-weight: 700; font-size: .9rem; color: var(--bs-heading-color); margin-bottom: 2px; }
.ux-toast-msg { font-size: .82rem; color: var(--bs-secondary-color); line-height: 1.4; }

.ux-toast-close {
    background: transparent;
    border: none;
    color: var(--bs-secondary-color);
    font-size: 1rem;
    padding: 2px 4px;
    cursor: pointer;
    border-radius: 4px;
    opacity: .6;
    transition: all .15s;
}
.ux-toast-close:hover { opacity: 1; background: rgba(0,0,0,.05); }

.ux-toast-progress {
    position: absolute;
    bottom: 0;
    right: 0;
    height: 3px;
    background: currentColor;
    width: 100%;
    transform-origin: right;
    animation: ux-toast-progress linear forwards;
}
.ux-toast.success .ux-toast-progress { color: #28c76f; }
.ux-toast.error   .ux-toast-progress { color: #ea5455; }
.ux-toast.warning .ux-toast-progress { color: #ff9f43; }
.ux-toast.info    .ux-toast-progress { color: #00cfe8; }

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

/* ─── Confirm Dialog ─── */
.ux-confirm-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: ux-fade .2s ease;
}
.ux-confirm-backdrop.open { display: flex; }
@keyframes ux-fade { from{opacity:0} to{opacity:1} }

.ux-confirm {
    background: var(--bs-body-bg);
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0,0,0,.35);
    padding: 28px 24px 20px;
    max-width: 440px;
    width: 92%;
    text-align: center;
    animation: ux-pop .28s cubic-bezier(.2,.9,.3,1.2);
    position: relative;
}
@keyframes ux-pop {
    from { transform: scale(.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.ux-confirm-icon {
    width: 64px; height: 64px;
    border-radius: 50%;
    margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    font-size: 2rem;
}
.ux-confirm-icon.danger  { background: rgba(234,84,85,.12); color: #ea5455; }
.ux-confirm-icon.warning { background: rgba(255,159,67,.12); color: #ff9f43; }
.ux-confirm-icon.info    { background: rgba(0,207,232,.12); color: #00cfe8; }
.ux-confirm-icon.success { background: rgba(40,199,111,.12); color: #28c76f; }

.ux-confirm-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--bs-heading-color);
    margin-bottom: 8px;
}
.ux-confirm-msg {
    font-size: .9rem;
    color: var(--bs-secondary-color);
    margin-bottom: 22px;
    line-height: 1.6;
}
.ux-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}
.ux-confirm-actions .btn { min-width: 100px; font-weight: 600; }

/* ─── Loading Overlay ─── */
.ux-loading {
    position: fixed; inset: 0;
    background: rgba(255,255,255,.7);
    backdrop-filter: blur(3px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
}
[data-bs-theme="dark"] .ux-loading { background: rgba(0,0,0,.5); }
.ux-loading.open { display: flex; }

.ux-loading-box {
    background: var(--bs-body-bg);
    border-radius: 16px;
    padding: 22px 32px;
    box-shadow: 0 12px 40px rgba(0,0,0,.2);
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 600;
}
.ux-spinner {
    width: 22px; height: 22px;
    border: 3px solid rgba(115,103,240,.2);
    border-top-color: #7367F0;
    border-radius: 50%;
    animation: ux-spin .7s linear infinite;
}
@keyframes ux-spin { to { transform: rotate(360deg); } }

/* ─── Skeleton ─── */
.ux-skeleton {
    background: linear-gradient(90deg,
        rgba(0,0,0,.05) 25%,
        rgba(0,0,0,.08) 50%,
        rgba(0,0,0,.05) 75%);
    background-size: 200% 100%;
    animation: ux-sk 1.4s ease-in-out infinite;
    border-radius: 6px;
}
[data-bs-theme="dark"] .ux-skeleton {
    background: linear-gradient(90deg,
        rgba(255,255,255,.05) 25%,
        rgba(255,255,255,.1) 50%,
        rgba(255,255,255,.05) 75%);
    background-size: 200% 100%;
}
@keyframes ux-sk {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* ─── Button Loading State ─── */
.btn.is-loading {
    pointer-events: none;
    opacity: .8;
    position: relative;
}
.btn.is-loading::after {
    content: '';
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ux-spin .7s linear infinite;
    margin-inline-start: 6px;
    vertical-align: middle;
}

@media (max-width: 767px) {
    .ux-toast-wrap { top: 70px; left: 10px; right: 10px; max-width: none; }
    .ux-toast { min-width: auto; }
}
