/* Plyr theme + modal for index2 tutorial videos */

:root {
  --plyr-color-main: #6366f1;
  --plyr-video-background: #141414;
  --plyr-menu-background: rgba(15, 23, 42, 0.95);
  --plyr-font-family: inherit;
  --plyr-control-radius: 10px;
}

html[data-theme="light"] {
  --plyr-color-main: #6366f1;
  --plyr-video-background: #141414;
  --plyr-menu-background: rgba(15, 23, 42, 0.95);
}

html[data-theme="dark"],
html:not([data-theme]) {
  --plyr-color-main: #818cf8;
  --plyr-video-background: rgb(var(--ttt-tradly-nb4, 20, 20, 20));
  --plyr-menu-background: rgba(20, 20, 20, 0.96);
}

.video-thumb:focus-visible {
  outline: 2px solid #6366f1;
  outline-offset: 3px;
}

.video-thumb {
  cursor: pointer;
}

.video-thumb .play-btn {
  pointer-events: none;
  z-index: 2;
  transition: transform 0.25s ease;
}

.video-thumb:hover .play-btn {
  transform: scale(1.08);
}

/* Overlay only on play control, not full thumbnail frame */
.video-thumb.popup-video::after,
.ttt-tutorial-video-card__play.video-thumb::after,
.ttt-video-tutorials-band button.video-thumb::after {
  content: none;
}

.video-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.video-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.video-modal[hidden] {
  display: none;
}

.video-modal:not([hidden]) {
  display: flex;
}

.video-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
}

.video-modal__dialog {
  position: relative;
  width: min(960px, 100%);
  z-index: 1;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.45);
  transform: translateY(12px) scale(0.98);
  transition: transform 0.3s ease;
}

.video-modal.is-open .video-modal__dialog {
  transform: translateY(0) scale(1);
}

.video-modal__close {
  position: absolute;
  top: 0.75rem;
  inset-inline-end: 0.75rem;
  z-index: 3;
  width: 2.5rem;
  height: 2.5rem;
  border: none;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
}

.video-modal__close:hover {
  background: rgba(15, 23, 42, 0.95);
  transform: scale(1.05);
}

.video-modal__player-wrap {
  background: #141414;
}

.video-modal__player-wrap .plyr {
  border-radius: 0;
}

.video-modal__player-wrap .plyr--video {
  overflow: hidden;
}

.video-modal__player-wrap video {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
}

.plyr--full-ui input[type="range"] {
  color: var(--plyr-color-main);
}

@media (max-width: 640px) {
  .video-modal {
    padding: 0.5rem;
  }

  .video-modal__dialog {
    border-radius: 0.75rem;
  }
}
