/* EagleTagz demo: slimmer Platform player on /micro (October 2026).
 *
 * - Bigger picture: the page script forced the video to 384px tall (192px on phones);
 *   now it fills the width, up to 78% of the screen height.
 * - Controls sit on top of the bottom of the video on a soft dark gradient, the way
 *   common web players do it (Mobbin references: Disney+, Higgsfield, Frame.io, Runway):
 *   a thin progress line with the tag markers, then one compact row of small icons.
 *   While the video plays the row fades out and only the thin line stays.
 * - The "(c) EagleTagz Platform - User: Admin" line under the video is hidden.
 *
 * The control bar itself is built by micro-player.js; rules below that mention
 * .etz-player only apply once that script has run. */

/* ---------- picture ---------- */
#platformVideo {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-height: 78vh !important;
  aspect-ratio: auto 16 / 9; /* 16:9 box until the file's own shape is known (and for audio) */
  object-fit: contain;
  background: #000;
}
@supports (height: 1svh) {
  #platformVideo { max-height: 78svh !important; }
}

/* ---------- watermark ---------- */
#watermark { display: none !important; }

/* ---------- control bar ---------- */
#video-section.etz-player .video-controls { display: none !important; } /* its buttons now live in .etz-bar */
#video-section.etz-player #playOverlay,
#video-section.etz-player #videoError { z-index: 30; }
#video-section.etz-player #videoLoadHelper { z-index: 31; bottom: 76px; }

.etz-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 40px 12px 4px;
  color: #fff;
  pointer-events: none; /* the gradient lets clicks through to the video */
  transition: transform 0.25s ease;
}
.etz-bar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.45) 45%, rgba(0, 0, 0, 0));
  transition: opacity 0.25s ease;
  pointer-events: none;
}
.etz-bar > * { position: relative; pointer-events: auto; }

/* progress line (the page's own timeline, with its tag markers) */
.etz-bar #videoTimeline { margin: 0 !important; }
.etz-bar #videoTimeline > div { display: block !important; }
.etz-bar #currentTime,
.etz-bar #totalTime { display: none !important; }
.etz-bar #timeline {
  height: 4px !important;
  margin: 6px 0;
  background: rgba(255, 255, 255, 0.25) !important;
  border-radius: 9999px;
  touch-action: none;
  transition: height 0.15s ease, margin 0.15s ease;
}
.etz-bar #timeline::before { /* easier to hit than the 4px line itself */
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -7px;
  bottom: -7px;
}
.etz-bar #timeline:hover,
.etz-bar #timeline.etz-dragging { height: 8px !important; margin: 4px 0; }
.etz-bar #timelineProgress { background: #3b82f6 !important; border-radius: 9999px; }
.etz-bar #timelineProgress::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transform: translateY(-50%) scale(0);
  transition: transform 0.15s ease;
}
.etz-bar #timeline:hover #timelineProgress::after,
.etz-bar #timeline.etz-dragging #timelineProgress::after { transform: translateY(-50%) scale(1); }

/* icon row */
.etz-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 36px;
  transition: opacity 0.2s ease;
}
.etz-group { display: flex; align-items: center; gap: 2px; min-width: 0; flex: none; }
.etz-group:first-child { flex: 1 1 auto; }
.etz-bar .etz-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.etz-bar .etz-btn:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
.etz-bar .etz-btn:focus-visible,
#video-section.etz-player #playbackRate:focus-visible { outline: 2px solid #93c5fd; outline-offset: 1px; }
.etz-bar .etz-skip i { font-size: 19px; }
.etz-bar .etz-skip span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -38%);
  font: 700 7px/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  letter-spacing: -0.03em;
  pointer-events: none;
}
.etz-time {
  min-width: 0;
  padding: 0 8px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.92);
}
.etz-time .etz-sep,
.etz-time .etz-dur { color: rgba(255, 255, 255, 0.6); }

#video-section.etz-player #playbackRate {
  -webkit-appearance: none;
  appearance: none;
  flex: none;
  height: 32px;
  min-width: 40px;
  padding: 0 8px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  text-align-last: center;
  cursor: pointer;
}
#video-section.etz-player #playbackRate:hover { background: rgba(255, 255, 255, 0.14); }
#video-section.etz-player #playbackRate option { background: #111827; color: #fff; }

/* while playing with no mouse movement: hide the row, keep the thin line at the very bottom */
#video-section.etz-idle { cursor: none; }
#video-section.etz-idle .etz-bar { transform: translateY(46px); }
#video-section.etz-idle .etz-bar::before { opacity: 0; }
#video-section.etz-idle .etz-row { opacity: 0; pointer-events: none; }
#video-section.etz-idle .etz-bar #timeline { height: 3px !important; margin: 6.5px 0; }

/* phones and tablets: every control at least 44 x 44 px, Apple's minimum touch target */
@media (pointer: coarse) {
  .etz-row { height: 44px; }
  .etz-bar .etz-btn { width: 44px; height: 44px; font-size: 17px; }
  .etz-bar .etz-skip i { font-size: 21px; }
  .etz-bar .etz-skip span { font-size: 8px; }
  #video-section.etz-player #playbackRate { height: 44px; min-width: 44px; }
  .etz-bar #timeline { margin: 8px 0; }
  .etz-bar #timeline.etz-dragging { margin: 6px 0; }
  #video-section.etz-idle .etz-bar { transform: translateY(56px); }
  #video-section.etz-idle .etz-bar #timeline { margin: 8.5px 0; }
}
/* phones: the time shows as elapsed only ("0:42", no " / 4:49"), so the 44px buttons fit on one line */
@media (pointer: coarse) and (max-width: 440px) {
  .etz-bar { padding-left: 8px; padding-right: 8px; }
  .etz-group { gap: 0; }
  .etz-time { padding: 0 4px; }
  .etz-time .etz-sep,
  .etz-time .etz-dur { display: none; }
}
@media (max-width: 360px) {
  .etz-bar .etz-skip { display: none; } /* very narrow phones: swipe left/right on the video still skips 10s */
}

/* audio files: smaller black stage with a music note */
#video-section.etz-audio #platformVideo { max-height: 40vh !important; }
#video-section.etz-audio::after {
  content: '\f001';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  font-size: 56px;
  color: rgba(255, 255, 255, 0.22);
  pointer-events: none;
  z-index: 1;
}

/* full screen keeps these controls (the whole player goes full screen, not just the video) */
#video-section:fullscreen {
  max-height: none !important;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#video-section:fullscreen #platformVideo {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  aspect-ratio: auto;
}
#video-section:-webkit-full-screen {
  max-height: none !important;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
#video-section:-webkit-full-screen #platformVideo {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  aspect-ratio: auto;
}

@media (prefers-reduced-motion: reduce) {
  .etz-bar,
  .etz-bar::before,
  .etz-row,
  .etz-bar #timeline,
  .etz-bar #timelineProgress::after { transition: none !important; }
}
