/* ILECO III — animations, the same as i-Assist (copied from its css/style.css).
   Loaded on every page EXCEPT the login page, which keeps its own look.
   - the logo in the header glows (hs)         - the watermark pulses (shine)
   - chart bars grow when drawn (grow / growx) - action buttons light up and sweep on hover (fx, fxsweep)
   - menu icons lift on hover                  */

/* ---- the logo in the header glows ---- */
header .mark,
header.top .mark,
header.letterhead .mark {
  animation: hs 1s ease-in-out infinite;
}
@keyframes hs {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.3) drop-shadow(0 0 10px #fff) drop-shadow(0 0 16px #ffe14d);
  }
}

/* ---- the big logo behind the page pulses ---- */
.wm .wm-base {
  animation: shine 2s ease-in-out infinite;
}
.wm .wm-shine {
  display: none;
}
@keyframes shine {
  0%,
  100% {
    opacity: 0.14;
    filter: none;
  }
  50% {
    opacity: 0.32;
    filter: drop-shadow(0 0 22px #ffd84d) drop-shadow(0 0 6px #fff6b0) brightness(1.3);
  }
}

/* ---- chart bars grow (summary-charts.js puts class "bar" / "barh" on every bar) ---- */
.bar {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: grow 0.7s ease both;
}
@keyframes grow {
  from {
    transform: scaleY(0);
  }
}
.barh {
  transform-box: fill-box;
  transform-origin: 0 50%;
  animation: growx 0.7s ease both;
}
@keyframes growx {
  from {
    transform: scaleX(0);
  }
}

/* ---- futuristic action buttons (the small buttons in tables: Reset, Delete, Role ...) ---- */
.btn:is(.small, .sm) {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(70, 190, 255, 0.6);
  border-radius: 10px;
  background: linear-gradient(135deg, #091329 0%, #12224a 55%, #1a3170 100%);
  color: #c9efff;
  font-weight: 700;
  letter-spacing: 0.3px;
  box-shadow:
    inset 0 0 0 1px rgba(120, 220, 255, 0.12),
    0 0 9px rgba(60, 170, 255, 0.28);
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease,
    border-color 0.2s,
    color 0.2s;
}
.btn:is(.small, .sm)::after {
  content: '';
  position: absolute;
  top: 0;
  left: -70%;
  width: 45%;
  height: 100%;
  pointer-events: none;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  opacity: 0;
}
.btn:is(.small, .sm):hover,
.btn:is(.small, .sm):focus-visible {
  transform: translateY(-1px);
  color: #fff;
  border-color: #8be6ff;
  outline: none;
  box-shadow:
    inset 0 0 14px rgba(80, 210, 255, 0.3),
    0 0 16px rgba(70, 190, 255, 0.75);
}
.btn:is(.small, .sm):hover::after {
  opacity: 1;
  animation: fxsweep 0.7s ease;
}
.btn:is(.small, .sm):active {
  transform: translateY(0) scale(0.97);
}
.btn:is(.small, .sm):disabled {
  opacity: 0.5;
  transform: none;
  box-shadow: none;
}
.btn:is(.small, .sm).danger {
  border-color: rgba(255, 95, 120, 0.7);
  background: linear-gradient(135deg, #2a0b14 0%, #46101f 55%, #641a2c 100%);
  color: #ffd0d8;
  box-shadow:
    inset 0 0 0 1px rgba(255, 140, 160, 0.14),
    0 0 9px rgba(255, 70, 100, 0.3);
}
.btn:is(.small, .sm).danger:hover,
.btn:is(.small, .sm).danger:focus-visible {
  border-color: #ff9fb0;
  box-shadow:
    inset 0 0 14px rgba(255, 90, 115, 0.32),
    0 0 16px rgba(255, 80, 105, 0.75);
}
@keyframes fxsweep {
  from {
    left: -70%;
  }
  to {
    left: 130%;
  }
}

/* ---- menu icons lift on hover (a mouse only) ---- */
nav.rail .nav-ico {
  transition:
    transform 0.18s ease,
    filter 0.18s ease;
}
@media (hover: hover) {
  nav.rail button:not(.active):hover .nav-ico,
  nav.rail a:hover .nav-ico {
    transform: translateY(-1px) scale(1.08);
  }
}

/* ---- for a person who asked the device for less motion ---- */
@media (prefers-reduced-motion: reduce) {
  header .mark,
  .wm .wm-base,
  .bar,
  .barh {
    animation: none !important;
  }
  .btn:is(.small, .sm) {
    transition: none;
  }
  .btn:is(.small, .sm):hover::after {
    animation: none;
    opacity: 0;
  }
  nav.rail .nav-ico {
    transition: none;
  }
}
@media print {
  header .mark,
  .wm .wm-base {
    animation: none !important;
  }
}

/* ---- the 3D pie comes in (as the bars grow) ---- */
.pie3d {
  transform-box: fill-box;
  transform-origin: 50% 60%;
  animation: pieIn 0.6s ease both;
}
@keyframes pieIn {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
}
@media (prefers-reduced-motion: reduce) {
  .pie3d {
    animation: none !important;
  }
}
