/* =====================================================================
   Kalasamrat — motion layer (2026-11-18)
   Keeps the original Geex look; only adds smooth transitions and small,
   subtle animations. Everything is disabled for "reduce motion" users.
   ===================================================================== */

:root {
  --uim-ease: cubic-bezier(.2, .7, .2, 1);
  --uim-ease-out: cubic-bezier(.16, 1, .3, 1);
}

html { scroll-behavior: smooth; }

/* ---------- Keyframes ---------- */
@keyframes uim-fade-up   { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }
@keyframes uim-fade-down { from { opacity: 0; transform: translate3d(0, -10px, 0); } to { opacity: 1; transform: none; } }
@keyframes uim-slide-in  { from { opacity: 0; transform: translate3d(-18px, 0, 0); } to { opacity: 1; transform: none; } }
@keyframes uim-pop       { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes uim-ripple    { to { transform: scale(4); opacity: 0; } }

/* ---------- Page entrance ---------- */
.geex-sidebar { animation: uim-slide-in .6s var(--uim-ease-out) both; }
.geex-sidebar__menu > .geex-sidebar__menu__item {
  animation: uim-fade-up .45s var(--uim-ease-out) both;
  animation-delay: calc(var(--uim-i, 0) * 35ms + 120ms);
}
/* "backwards" (not "both") so the header does not stay in its own layer after the animation,
   and z-index keeps the header's pop-ups (profile / logout menu, search) above the page cards. */
.geex-content__header { animation: uim-fade-up .55s var(--uim-ease-out) backwards; z-index: 20; }

/* Cards / sections fade up as they scroll into view (classes added by ui-motion.js) */
.uim-reveal { opacity: 0; transform: translate3d(0, 18px, 0); }
.uim-reveal.uim-in {
  opacity: 1; transform: none;
  transition: opacity .6s var(--uim-ease-out), transform .6s var(--uim-ease-out);
  transition-delay: var(--uim-delay, 0ms);
}

/* ---------- Smooth hover states ---------- */
.geex-content__feature__card,
.dashboard-card,
.stats-card,
.geex-content__widget__single {
  transition: transform .3s var(--uim-ease), box-shadow .3s var(--uim-ease);
}
.geex-content__feature__card:not(:has(.modal)):hover,
.dashboard-card:not(:has(.modal)):hover,
.stats-card:not(:has(.modal)):hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(23, 22, 30, .08);
}
.geex-content__feature__card__img img { transition: transform .45s var(--uim-ease); }
.geex-content__feature__card:hover .geex-content__feature__card__img img { transform: scale(1.06); }

/* Buttons: smooth colour change, tiny lift, soft press */
.geex-btn, .btn, button.btn-add-new, a.btn-add-new {
  transition: background-color .25s ease, color .25s ease, border-color .25s ease, box-shadow .25s ease, transform .15s ease !important;
}
.geex-btn:hover, .btn:hover { transform: translateY(-1px); }
.geex-btn:active, .btn:active { transform: translateY(0) scale(.97); }
.uim-ripple-host { overflow: hidden; }
.uim-ripple {
  position: absolute; border-radius: 50%; pointer-events: none; width: 24px; height: 24px; margin: -12px 0 0 -12px;
  background: rgba(255, 255, 255, .45); transform: scale(0); animation: uim-ripple .6s ease-out forwards;
}

/* Sidebar links */
.geex-sidebar__menu__link { transition: background-color .3s ease, color .3s ease, padding .3s var(--uim-ease) !important; }
.geex-sidebar__menu__link i { transition: transform .3s var(--uim-ease), color .3s ease; display: inline-block; }
.geex-sidebar__menu__link:hover i { transform: scale(1.15); }

/* Form fields: smooth focus glow in the theme colour */
.form-control, .form-select, .geex-content__form__single__box input, .geex-content__form__single__box select, .geex-content__form__single__box textarea {
  transition: border-color .25s ease, box-shadow .25s ease, background-color .25s ease;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px var(--primary-color-transparent);
}

/* Table rows */
table tbody tr { transition: background-color .2s ease; }
table tbody tr:hover > td { background-color: rgba(171, 84, 219, .04); }

/* Links */
a { transition: color .2s ease; }

/* ---------- Alerts, modals, popups ---------- */
.alert { animation: uim-fade-down .45s var(--uim-ease-out) both; }
.modal.fade .modal-dialog { transform: translate3d(0, 18px, 0) scale(.97); transition: transform .4s var(--uim-ease-out), opacity .3s ease; }
.modal.show .modal-dialog { transform: none; }
.modal-backdrop.fade { transition: opacity .3s ease; }
.dropdown-menu.show { animation: uim-pop .2s var(--uim-ease-out); transform-origin: top; }
.geex-content__header__popup { transition: opacity .25s ease, transform .25s var(--uim-ease-out), visibility .25s; }

/* ---------- Page-change progress bar ---------- */
.uim-progress {
  position: fixed; top: 0; left: 0; z-index: 99999; height: 3px; width: 0; opacity: 0; pointer-events: none;
  background: linear-gradient(90deg, var(--primary-color), #FF8DE0);
  box-shadow: 0 0 10px var(--primary-color);
  transition: width .35s ease, opacity .3s ease;
}
.uim-progress.is-active { opacity: 1; width: 75%; transition: width 2.8s var(--uim-ease-out), opacity .2s ease; }
body.uim-leaving .geex-content { opacity: .55; transition: opacity .25s ease; }

/* ---------- Accessibility: respect "reduce motion" ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .uim-reveal { opacity: 1 !important; transform: none !important; }
}
