/* OfficeHR Global Animations v2
   Mobile/WebView-safe: animate page content instead of body.lg-app, because
   liquid-ui.css intentionally pins body.lg-app animation/transform with !important. */

@keyframes officehrContentEnter {
  from { opacity: .02; transform: translate3d(0, 14px, 0) scale(.994); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}
@keyframes officehrDialogBackdrop {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes officehrDialogCard {
  from { opacity: 0; transform: translate3d(0, 9px, 0) scale(.965); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1); }
}

/* Login/register/recovery pages that are not .lg-app can animate the body. */
html.officehr-motion-ready body:not(.lg-app) {
  animation: officehrContentEnter .30s cubic-bezier(.22,.8,.26,1) both;
}

/* App pages: JS marks real page-content children, leaving fixed nav/dock stable. */
html.officehr-motion-ready body.lg-app > .officehr-motion-target {
  animation: officehrContentEnter .30s cubic-bezier(.22,.8,.26,1) both !important;
  transform-origin: 50% 24%;
}

/* Exit transition. */
html.officehr-page-leaving body:not(.lg-app) {
  opacity: 0 !important;
  transform: translate3d(-9px,0,0) scale(.997) !important;
  transition: opacity .17s ease, transform .17s ease !important;
  pointer-events: none;
}
html.officehr-page-leaving body.lg-app > .officehr-motion-target {
  opacity: 0 !important;
  transform: translate3d(-10px,0,0) scale(.995) !important;
  transition: opacity .17s ease, transform .17s ease !important;
  pointer-events: none;
}

/* Touch feedback: mobile has no hover, so taps must still feel responsive. */
a, button, .btn, .nav-btn, .lg-nav-link, .lg-dock a, .lg-dock button,
.menu-item, .dashboard-card, .action-card, .quick-action, .back-btn {
  -webkit-tap-highlight-color: transparent;
}
button, .btn, .nav-btn, .lg-nav-link, .lg-dock a, .lg-dock button,
.menu-item, .dashboard-card, .action-card, .quick-action, .back-btn {
  transition: transform .14s ease, opacity .14s ease, box-shadow .20s ease, background-color .20s ease !important;
}
button:active, .btn:active, .nav-btn:active, .lg-nav-link:active,
.lg-dock a:active, .lg-dock button:active, .menu-item:active,
.dashboard-card:active, .action-card:active, .quick-action:active, .back-btn:active {
  transform: scale(.972) !important;
  opacity: .86 !important;
}
a[href]:active { opacity: .76; }

/* Existing custom AJAX dialogs. */
.app-dialog-overlay { animation: officehrDialogBackdrop .18s ease both !important; }
.app-dialog-card { animation: officehrDialogCard .24s cubic-bezier(.2,.85,.25,1.12) both !important; }

/* Do not override video/canvas transforms: face camera mirroring must stay intact. */

/* Respect reduced motion on desktop. On touch/mobile, the user explicitly requested
   transitions, so JS adds officehr-force-motion and these specific effects remain enabled. */
@media (prefers-reduced-motion: reduce) {
  html:not(.officehr-force-motion).officehr-motion-ready body:not(.lg-app),
  html:not(.officehr-force-motion).officehr-motion-ready body.lg-app > .officehr-motion-target,
  html:not(.officehr-force-motion).officehr-page-leaving body:not(.lg-app),
  html:not(.officehr-force-motion).officehr-page-leaving body.lg-app > .officehr-motion-target,
  html:not(.officehr-force-motion) .app-dialog-overlay,
  html:not(.officehr-force-motion) .app-dialog-card {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* liquid-ui.css can disable every transition under reduced-motion. Re-enable only the
   requested OfficeHR interactions for touch/mobile when force-motion is active. */
@media (prefers-reduced-motion: reduce) {
  html.officehr-force-motion body.lg-app > .officehr-motion-target {
    animation: officehrContentEnter .30s cubic-bezier(.22,.8,.26,1) both !important;
  }
  html.officehr-force-motion button,
  html.officehr-force-motion .btn,
  html.officehr-force-motion .nav-btn,
  html.officehr-force-motion .lg-nav-link,
  html.officehr-force-motion .lg-dock a,
  html.officehr-force-motion .lg-dock button,
  html.officehr-force-motion .menu-item,
  html.officehr-force-motion .dashboard-card,
  html.officehr-force-motion .action-card,
  html.officehr-force-motion .quick-action,
  html.officehr-force-motion .back-btn {
    transition: transform .14s ease, opacity .14s ease, box-shadow .20s ease, background-color .20s ease !important;
  }
  html.officehr-force-motion button:active,
  html.officehr-force-motion .btn:active,
  html.officehr-force-motion .nav-btn:active,
  html.officehr-force-motion .lg-nav-link:active,
  html.officehr-force-motion .lg-dock a:active,
  html.officehr-force-motion .lg-dock button:active,
  html.officehr-force-motion .menu-item:active,
  html.officehr-force-motion .dashboard-card:active,
  html.officehr-force-motion .action-card:active,
  html.officehr-force-motion .quick-action:active,
  html.officehr-force-motion .back-btn:active {
    transform: scale(.972) !important;
    opacity: .86 !important;
  }
}
