/* ===== CUSTOM PLAYER ===== */

.player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: black;
  border-radius: 14px;
  overflow: hidden;
}

.player-wrapper video {
  width: 100%;
  height: 100%;
  background: black;
}

/* Overlay UI */
.player-ui {
 position: absolute;
  bottom: 0;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
}

.player-btn {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

.player-btn:hover {
  color: var(--accent);
}

/* Seekbar */
#seekBar {
  flex: 1;
  cursor: pointer;
}

/* Right side */
.player-right {
  display: flex;
  gap: 8px;
}

/* Quality menu */
.quality-menu {
  position: absolute;
  bottom: 56px;
  right: 12px;

  width: 220px;
  max-height: 320px;

  overflow-y: auto;
  overflow-x: hidden;

  background: rgba(20,20,20,0.96);
  backdrop-filter: blur(12px);

  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;

  box-shadow:
    0 10px 30px rgba(0,0,0,0.45);

  padding: 6px;

  z-index: 999;
}

.quality-menu div {
  display: flex;
  align-items: center;

  min-height: 44px;

  padding: 0 14px;

  font-size: 14px;
  font-weight: 500;

  cursor: pointer;
  user-select: none;

  transition: background 0.12s ease;
}

.quality-menu div:hover {
  background: rgba(255,255,255,0.08);
}

.quality-menu .menu-screen,
.quality-menu .submenu {
  padding: 0 6px;
}

.quality-menu .menu-screen > div,
.quality-menu .submenu > div {
  padding: 0 8px;
  margin: 0 2px;
}

.quality-menu .menu-row .row-label,
.quality-menu .option .option-label {
  font-size: 14px;
  font-weight: 500;
}

.quality-menu hr {
  border: none;
  border-top: 1px solid rgba(255,255,255,0.08);
  margin: 6px 0;
}

/* ===== YouTube-style rows ===== */
.menu-row .row-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}

.menu-row .row-icon svg {
  width: 20px;
  height: 20px;
}

.menu-row .row-label {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-row .row-value {
  font-size: 13px;
  color: rgba(255,255,255,0.6);
  white-space: nowrap;
  margin-left: 10px;
}

.menu-row .row-chev {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-right: 2px solid rgba(255,255,255,0.5);
  border-bottom: 2px solid rgba(255,255,255,0.5);
  transform: rotate(-45deg);
  margin-left: 8px;
}

/* ===== Submenu header + options ===== */
.submenu .submenu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 46px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 4px;
}

.submenu .submenu-header:hover {
  background: transparent;
}

.submenu .submenu-header .back-chevron {
  width: 8px;
  height: 8px;
  border-left: 2px solid rgba(255,255,255,0.8);
  border-bottom: 2px solid rgba(255,255,255,0.8);
  transform: rotate(45deg);
  flex-shrink: 0;
}

.submenu .option .option-check {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

.submenu .option .option-check svg {
  width: 18px;
  height: 18px;
}

.submenu .option.selected .option-check {
  display: flex;
}

.submenu .option .option-label {
  flex: 1;
}

.quality-menu::-webkit-scrollbar {
  width: 6px;
}

.quality-menu::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 999px;
}

.hidden {
  display: none;
}

#timeDisplay {
  color: white;
  font-size: 13px;
  min-width: 90px;
  text-align: left;
  font-variant-numeric: tabular-nums;
}
#volumeWrapper {
  position: relative;
  display: flex;
  align-items: center;
}

#volumeSlider {
  width: 80px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#volumeWrapper:hover #volumeSlider {
  opacity: 1;
  pointer-events: auto;
}
#settingsMenu hr{
  border:none;
  border-top:1px solid #333;
  margin:6px 10px;
}

.back-btn {
  opacity: 0.7;
  font-size: 13px;
}

.menu-screen,
.submenu {
  display: none !important;
  flex-direction: column;
}

.menu-screen.active,
.submenu.active {
  display: flex !important;
  animation: menuFade 0.18s ease-out;
}

@keyframes menuFade {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
  
/* =========================
   WATCH RESPONSIVE
========================= */

@media (max-width: 900px) {

  .watch-layout {
    grid-template-columns: 1fr;
    padding: 72px 18px 24px;
    gap: 24px;
  }

  .watch-side {
    position: static;
    height: auto;
    overflow: visible;
  }

  .player-wrapper {
    border-radius: 12px;
  }
}


@media (max-width: 600px) {

  .watch-layout {
    display: block;

    padding: 58px 10px 20px;
  }

  .watch-main {
    width: 100%;
    min-width: 0;
  }

  .player-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
  }

  .player-ui {
    gap: 5px;
    padding: 7px;

    min-width: 0;
  }

  .player-btn {
    width: 32px;
    height: 32px;

    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 14px;
    flex-shrink: 0;
  }

  #timeDisplay {
    min-width: auto;
    font-size: 11px;
    white-space: nowrap;
  }

  #seekBar {
    min-width: 0;
  }

  #volumeWrapper {
    flex-shrink: 0;
  }

  #volumeSlider {
    display: none;
  }

  .player-right {
    gap: 2px;
    flex-shrink: 0;
  }

  .quality-menu {
    right: 8px;
    bottom: 48px;

    width: min(220px, calc(100vw - 24px));
    max-height: 65vh;
  }

  .quality-menu div {
    min-height: 42px;
  }

  .quality-menu .menu-screen > div,
  .quality-menu .submenu > div {
    padding: 0 6px;
    margin: 0 1px;
  }

  #videoTitle {
    margin-top: 14px;
    font-size: 21px;
    line-height: 1.25;
  }

  .watch-meta {
    font-size: 12px;
  }

  .creator-bar {
    flex-wrap: wrap;
    gap: 10px;
  }

  .creator-left {
    width: 100%;
  }

  .creator-right {
    width: 100%;

    justify-content: space-between;
    gap: 8px;
  }

  .rating-group {
    gap: 3px;
  }

  #subscribeBtn {
    padding: 8px 14px;
  }

  .comments {
    margin-top: 18px;
    padding: 12px;
  }

  .watch-side {
    margin-top: 24px;
  }

  .watch-side h3 {
    font-size: 18px;
  }

  .watch-side .video-card {
    margin-bottom: 16px;
  }
}
/* =========================
   MOBILE WATCH PAGE
========================= */

@media (max-width: 700px) {

  .watch-layout {
    display: block !important;
    width: 100%;
    padding: 58px 10px 24px !important;
  }

  .watch-main {
    width: 100%;
    min-width: 0;
  }

  .watch-side {
    position: static !important;
    width: 100%;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;

    margin-top: 28px;
  }

  .watch-side h3 {
    margin-bottom: 14px;
  }

  .watch-side .video-card {
    width: 100%;
    margin-bottom: 18px;
  }

  .watch-side .thumb {
    width: 100%;
    display: block;
  }
}
/* =========================
   MEMBER LOCK OVERLAY
   ========================= */
.member-lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: inherit;
}
.member-lock-inner {
  text-align: center;
  color: #fff;
  max-width: 320px;
  padding: 24px;
}
.member-lock-icon {
  display: inline-flex;
  margin-bottom: 12px;
  opacity: .9;
}
.member-lock-inner h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}
.member-lock-inner p {
  margin: 0 0 18px;
  font-size: 14px;
  color: rgba(255,255,255,.75);
}
.member-lock-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #f7c948, #e8a020);
  color: #1a1a1a;
  padding: 10px 24px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
}
.member-lock-btn .icon {
  width: 16px;
  height: 16px;
}
