/*
 * QORTECA ORACLE MOTION REPAIR
 * Applies to the published frontend only.
 */

/* Prevent Framer Motion's route container from constraining
   full-screen fixed-position popup overlays. */
main > div[style*="will-change"] {
  transform: none !important;
  will-change: opacity !important;
}

/* Consistent interaction easing */
:root {
  --qorteca-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

button,
a[href],
[role="button"],
[role="tab"],
[role="menuitem"] {
  transition:
    background-color 200ms var(--qorteca-ease),
    border-color 200ms var(--qorteca-ease),
    color 200ms var(--qorteca-ease),
    opacity 200ms var(--qorteca-ease),
    box-shadow 200ms var(--qorteca-ease),
    scale 180ms var(--qorteca-ease),
    translate 180ms var(--qorteca-ease);
}

button:not(:disabled):hover,
a[href]:hover,
[role="button"]:not([aria-disabled="true"]):hover {
  translate: 0 -1px;
}

button:not(:disabled):active,
a[href]:active,
[role="button"]:not([aria-disabled="true"]):active {
  translate: 0 0;
  scale: 0.975;
}

button:focus-visible,
a[href]:focus-visible,
[role="button"]:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Smooth form feedback */
input,
textarea,
select {
  transition:
    border-color 180ms var(--qorteca-ease),
    box-shadow 180ms var(--qorteca-ease),
    background-color 180ms var(--qorteca-ease),
    opacity 180ms var(--qorteca-ease);
}

/* Shared opening animation for inline full-screen dialogs */
@keyframes qorteca-overlay-open {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes qorteca-dialog-open {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Paid Time Off, Team Tapping and Report Absence */
div.fixed.inset-0:not([data-qorteca-popup-kind]):has(
  > [role="dialog"][aria-label="PAID TIME OFF"],
  > [role="dialog"][aria-label="TEAM TAPPING"],
  > [role="dialog"][aria-label="REPORT ABSENCE"]
) {
  background-color: rgb(0 0 0 / 0.40) !important;
  backdrop-filter: blur(6px);
  animation: qorteca-overlay-open 200ms ease-out both;
}

div.fixed.inset-0:not([data-qorteca-popup-kind]):has(
  > [role="dialog"][aria-label="PAID TIME OFF"],
  > [role="dialog"][aria-label="TEAM TAPPING"],
  > [role="dialog"][aria-label="REPORT ABSENCE"]
) > [role="dialog"] {
  animation: qorteca-dialog-open 230ms
    var(--qorteca-ease) both;
}

/* Respect accessibility preferences */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  button,
  a[href],
  [role="button"],
  [role="tab"] {
    translate: none !important;
    scale: none !important;
  }
}
