/* ==========================================================
   Orion micro-animation & UI-polish suite
   (loaded globally — keep additions pure CSS, no layout deps)
   ========================================================== */

/* ---------- 1. Button ripple wave ---------- */
.btn { position: relative; overflow: hidden; }
.ripple-wave {
    position: absolute; border-radius: 50%;
    background: rgba(255, 255, 255, .45);
    transform: scale(0); animation: ripple-animation .6s linear;
    pointer-events: none;
}
.btn-outline-danger .ripple-wave, .btn-outline-secondary .ripple-wave,
.btn-outline-primary .ripple-wave, .btn-light .ripple-wave,
.btn-default .ripple-wave { background: rgba(211, 47, 47, .18); }
@keyframes ripple-animation { to { transform: scale(4); opacity: 0; } }

/* ---------- 2. Shake for errors / high-risk alerts ---------- */
@keyframes shake-horizontal {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}
.animate-shake { animation: shake-horizontal .6s ease-in-out; }
.alert-danger { animation: shake-horizontal .5s ease-in-out; }
.form-control.is-invalid, .is-invalid.form-control,
select.is-invalid, textarea.is-invalid { animation: shake-horizontal .45s ease-in-out; }

/* ---------- 3. Skeleton shimmer loaders ---------- */
@keyframes skeleton-shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}
.skeleton-shimmer {
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    background-size: 400px 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    border-radius: 6px; display: inline-block; color: transparent !important;
}
div.dataTables_processing {
    background: linear-gradient(90deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    background-size: 400px 100%;
    animation: skeleton-shimmer 1.4s ease-in-out infinite;
    border: 0; border-radius: 8px; color: transparent;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .10);
}

/* ---------- 4. Card elevation on hover ---------- */
.card-interactive, .small-box {
    transition: transform .25s cubic-bezier(.16, 1, .3, 1), box-shadow .25s cubic-bezier(.16, 1, .3, 1);
}
.card-interactive:hover, .small-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -6px rgba(0, 0, 0, .12), 0 4px 12px -2px rgba(0, 0, 0, .06) !important;
}

/* ---------- 5. Glowing accent on active tabs ---------- */
.nav-pills .nav-link.active, .nav-tabs .nav-link.active {
    transition: all .25s ease-in-out;
    box-shadow: 0 4px 12px rgba(220, 38, 38, .22);
}

/* ---------- 6. Floating glass toasts ---------- */
.toast-glass-container {
    position: fixed; top: 1.25rem; right: 1.25rem; z-index: 10000;
    display: flex; flex-direction: column; gap: .75rem; pointer-events: none;
}
.toast-glass {
    pointer-events: auto;
    background: rgba(255, 255, 255, .9);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(226, 232, 240, .8);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, .1), 0 8px 10px -6px rgba(0, 0, 0, .05);
    border-radius: 12px; padding: .8rem 1.1rem;
    display: flex; align-items: center; gap: .7rem;
    min-width: 300px; max-width: 420px;
    animation: toast-slide-in .35s cubic-bezier(.16, 1, .3, 1) forwards;
    transition: opacity .25s ease, transform .25s ease;
    font-family: inherit;
}
.toast-glass .tg-title { font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #0f172a; }
.toast-glass .tg-body { font-size: 12.5px; color: #475569; margin-top: 2px; word-break: break-word; }
.toast-glass .tg-close { margin-left: auto; background: none; border: 0; font-size: 17px; line-height: 1; color: #94a3b8; cursor: pointer; padding: 0 0 0 8px; }
.toast-glass .tg-close:hover { color: #334155; }
.toast-glass.toast-success { border-left: 4px solid #22c55e; }
.toast-glass.toast-warning { border-left: 4px solid #f59e0b; }
.toast-glass.toast-error   { border-left: 4px solid #dc2626; }
.toast-glass.toast-info    { border-left: 4px solid #3b82f6; }
@keyframes toast-slide-in {
    from { opacity: 0; transform: translateX(100%) scale(.9); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ---------- 7. Keyboard shortcut badge ---------- */
.kbd-shortcut {
    background: #f1f5f9; border: 1px solid #cbd5e1; border-bottom-width: 2px;
    border-radius: 6px; color: #475569;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: .68rem; font-weight: 700; padding: .15rem .45rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .05); white-space: nowrap;
}
.search-flash { box-shadow: 0 0 0 3px rgba(220, 38, 38, .35) !important; border-color: #dc2626 !important; }

/* ---------- 8. Hover-reveal row action toolbar ---------- */
.table tbody tr .hover-action-toolbar {
    opacity: 0; transform: translateX(8px);
    transition: opacity .2s cubic-bezier(.16, 1, .3, 1), transform .2s cubic-bezier(.16, 1, .3, 1);
}
.table tbody tr:hover .hover-action-toolbar { opacity: 1; transform: translateX(0); }

/* ---------- 9. Stat trend pills ---------- */
.stat-trend-up, .stat-trend-down {
    border-radius: 9999px; font-size: .7rem; font-weight: 700;
    padding: .2rem .55rem; display: inline-flex; align-items: center; gap: .2rem;
}
.stat-trend-up   { background: rgba(34, 197, 94, .1);  color: #15803d; border: 1px solid rgba(34, 197, 94, .25); }
.stat-trend-down { background: rgba(220, 38, 38, .1); color: #b91c1c; border: 1px solid rgba(220, 38, 38, .25); }

/* ---------- 10. Focus polish & smooth drawers ---------- */
.form-control { transition: border-color .18s ease, box-shadow .18s ease; }
#hw-drawer { transition: transform .28s cubic-bezier(.16, 1, .3, 1); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
