@import url('/ananfx-home-system-v51.css');

/* V52: controls appear on tap and auto-hide while the lesson is playing. */
.ananfx-player-shell {
  isolation: isolate;
}

.ananfx-player-head button {
  z-index: 14;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: scale(.9);
  transition: opacity .18s ease, transform .18s ease, visibility .18s;
}

.ananfx-player-nav {
  position: absolute;
  z-index: 13;
  inset: 0 0 auto;
  width: 100%;
  aspect-ratio: 16 / 9;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  background: linear-gradient(90deg, #0003, transparent 30%, transparent 70%, #0003);
  transition: opacity .18s ease, visibility .18s;
}

.ananfx-player-nav button {
  position: absolute;
  top: 50%;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid #ffffff55;
  border-radius: 50%;
  color: #fff;
  background: #111116d9;
  box-shadow: 0 5px 24px #000a;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

.ananfx-player-nav button::before {
  font-size: 29px;
  line-height: 1;
}

.ananfx-player-nav button::after {
  position: absolute;
  top: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 11px;
  white-space: nowrap;
  text-shadow: 0 2px 5px #000;
}

.ananfx-player-prev { left: max(18px, 6%); }
.ananfx-player-next { right: max(18px, 6%); }
.ananfx-player-prev::before { content: '❮'; }
.ananfx-player-next::before { content: '❯'; }
.ananfx-player-prev::after { content: 'บทก่อนหน้า'; }
.ananfx-player-next::after { content: 'บทถัดไป'; }

.ananfx-player-shell.ananfx-controls-visible .ananfx-player-head button,
.ananfx-player-shell.ananfx-controls-visible .ananfx-player-nav {
  opacity: 1;
  visibility: visible;
}

.ananfx-player-shell.ananfx-controls-visible .ananfx-player-head button {
  pointer-events: auto;
  transform: scale(1);
}

.ananfx-player-nav button:active {
  transform: translateY(-50%) scale(.92);
  background: #ffc400;
  color: #050505;
}

@media (max-width: 520px) {
  .ananfx-player-nav button {
    width: 54px;
    height: 54px;
  }
}
