/* ============================================
   ANIVORA — WATCH PAGE
============================================ */

/* ============================================
   WATCH PAGE WRAPPER
============================================ */
.watch-page {
  background: #000;
  min-height: 100vh;
}

/* ============================================
   PLAYER WRAPPER
============================================ */
.player-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  max-height: calc(100vh - var(--header-h) - 80px);
  background: #000;
  overflow: hidden;
  cursor: pointer;
}

.player-wrap .plyr {
  width: 100%;
  height: 100%;
  --plyr-color-main: #6c63ff;
  --plyr-video-control-color: #fff;
  --plyr-video-control-color-hover: #fff;
  --plyr-video-control-background-hover: rgba(108,99,255,0.5);
}
.player-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* ============================================
   PLAYER BACKGROUND
============================================ */
.player-bg {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #080808;
}
.player-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
}

/* ============================================
   PLAYER CENTER (Big Play Button)
============================================ */
.player-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 3;
  transition: opacity 0.3s ease;
}
.player-center.hidden {
  opacity: 0;
  pointer-events: none;
}
.player-play-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(108,99,255,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}
.player-play-btn:hover {
  background: rgba(108,99,255,1);
  transform: scale(1.05);
}
.player-ep-label {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255,255,255,0.75);
  transition: opacity 0.3s ease;
}
.player-center.hidden .player-ep-label {
  opacity: 0;
}

/* ============================================
   PLAYER CONTROLS
============================================ */
.player-controls {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 32px 20px 14px;
  background: linear-gradient(to top,
    rgba(0,0,0,0.92) 0%,
    transparent 100%);
  z-index: 5;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.player-wrap.playing { cursor: none; }
.player-wrap.playing .player-controls {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
}

/* ============================================
   PROGRESS BAR
============================================ */
.player-progress {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px;
  margin-bottom: 16px;
  cursor: pointer;
  position: relative;
  transition: height 0.15s ease;
}
.player-progress:hover {
  height: 5px;
}
.player-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 42%;
  position: relative;
}
.player-progress-fill::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.15s ease;
}
.player-progress:hover .player-progress-fill::after {
  opacity: 1;
}

/* ============================================
   CONTROLS BOTTOM ROW
============================================ */
.player-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.player-left,
.player-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.player-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.65);
  border-radius: 6px;
  transition: var(--transition);
}
.player-btn:hover {
  color: #fff;
  background: rgba(255,255,255,0.09);
}
.player-time {
  font-size: 12px;
  color: rgba(255,255,255,0.6);
  padding: 0 4px;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.player-ctrl-select {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.8);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 11.5px;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}
.player-ctrl-select:hover {
  background: rgba(255,255,255,0.12);
}
.player-ctrl-select option {
  background: #1c1c28;
  color: #fff;
}

/* ============================================
   FULLSCREEN MODE
============================================ */
.player-wrap:fullscreen,
.player-wrap:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  aspect-ratio: auto;
  background: #000;
}
.player-wrap:fullscreen .player-bg img,
.player-wrap:-webkit-full-screen .player-bg img {
  object-fit: contain;
  opacity: 1;
}

/* ============================================
   WATCH LAYOUT (Main + Sidebar)
============================================ */
.watch-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 16px;
}
.watch-main {
  flex: 1;
  min-width: 0;
}

/* ============================================
   WATCH INFO
============================================ */
.watch-info {
  padding: 16px 0;
}
.watch-ep-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.watch-ep-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

/* ★ خط جداکننده بین عنوان اپیزود و دکمه‌های اکشن */
.watch-info .watch-ep-title {
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 16px;
}

/* ============================================
   UP NEXT ROW
============================================ */
.up-next-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.up-next-row::-webkit-scrollbar { display: none; }

.up-next-card {
  flex-shrink: 0;
  width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}
.up-next-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}
.up-next-thumb {
  height: 110px;
  background: linear-gradient(135deg, var(--bg-elevated), var(--bg-card));
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.up-next-body { padding: 10px; }
.up-next-ep {
  font-size: 10.5px;
  color: var(--text-muted);
}
.up-next-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   SIDEBAR EPISODES
============================================ */
.watch-sidebar {
  min-width: 0;
}
.sidebar-episodes {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.sidebar-ep-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-ep-title {
  font-size: 14px;
  font-weight: 700;
}
.sidebar-ep-list {
  max-height: 520px;
  overflow-y: auto;
}
.sidebar-ep-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.sidebar-ep-item:hover {
  background: var(--bg-elevated);
}
.sidebar-ep-item.active {
  background: var(--accent-dim);
  border-left: 3px solid var(--accent);
}
.sidebar-ep-thumb {
  width: 70px;
  height: 40px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.sidebar-ep-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.sidebar-ep-info {
  flex: 1;
  min-width: 0;
}
.sidebar-ep-num {
  font-size: 10px;
  color: var(--text-muted);
}
.sidebar-ep-name {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-ep-dur {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ============================================
   SCROLLBAR در سایدبار
============================================ */
.sidebar-ep-list::-webkit-scrollbar {
  width: 4px;
}
.sidebar-ep-list::-webkit-scrollbar-thumb {
  background: var(--bg-elevated);
  border-radius: 2px;
}

/* ============================================
   UP NEXT CARDS
============================================ */
.up-next-card {
  flex-shrink: 0;
  width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
}
.up-next-card:hover {
  border-color: var(--border-hover);
}

.up-next-thumb {
  width: 100%;
  height: 110px;
  background: var(--bg-elevated);
  position: relative;
  overflow: hidden;
}
.up-next-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.up-next-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10,10,15,0.35);
  color: #fff;
  z-index: 2;
  transition: var(--transition);
}
.up-next-card:hover .up-next-play-overlay {
  background: rgba(10,10,15,0.55);
}
.up-next-play-overlay svg {
  fill: #fff;
  stroke: none;
  width: 32px;
  height: 32px;
  opacity: 0.9;
}

.up-next-body {
  padding: 10px;
}
.up-next-ep {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.up-next-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================
   SEEK FEEDBACK (◀◀ 10s / 10s ▶▶)
============================================ */
.seek-feedback {
  position: absolute;
  top: 50%;
  transform: translateY(-50%) scale(0.85);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 20px;
  border-radius: 50%;
  background: rgba(10,10,15,0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0;
  z-index: 10;
  transition: opacity 0.25s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  border: 1.5px solid rgba(255,255,255,0.15);
  font-variant-numeric: tabular-nums;
}

.seek-feedback.show {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.seek-feedback.seek-left {
  left: 15%;
  transform: translate(-50%, -50%) scale(0.85);
}
.seek-feedback.seek-left.show {
  transform: translate(-50%, -50%) scale(1);
}

.seek-feedback.seek-right {
  right: 15%;
  transform: translate(50%, -50%) scale(0.85);
}
.seek-feedback.seek-right.show {
  transform: translate(50%, -50%) scale(1);
}

.seek-feedback svg {
  width: 22px;
  height: 22px;
  color: #fff;
}

.seek-feedback span {
  font-size: 15px;
  letter-spacing: 0.5px;
}

/* ============================================
   WATCH ACTIONS ROW
============================================ */
#watchActionsRow {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 2px;
}
#watchActionsRow::-webkit-scrollbar {
  display: none;
}

#watchActionsRow .btn-sm {
  height: 32px;
  padding: 0 10px;
  font-size: 11.5px;
  gap: 5px;
  flex-shrink: 0;
  white-space: nowrap;
  border-radius: var(--radius-sm);
}

#watchActionsRow .btn-sm svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

#watchActionsRow .btn-action-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
#watchActionsRow .btn-action-icon svg {
  width: 16px;
  height: 16px;
}

#watchActionsRow .btn-action-wide {
  flex: 0 0 auto;
}

/* ============================================
   MOBILE (≤ 500px)
============================================ */
@media (max-width: 500px) {
  #watchActionsRow {
    margin-left: 0 !important;
    width: 100%;
    gap: 6px;
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  #watchActionsRow .btn-action-wide {
    flex: 1 1 0;
    min-width: 0;
    height: 38px;
    padding: 0 10px;
    gap: 5px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    justify-content: center;
    overflow: hidden;
  }

  #watchActionsRow .btn-action-wide svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }

  #watchActionsRow .btn-action-wide span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  #watchActionsRow .btn-action-icon {
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 8px;
  }

  #watchActionsRow .btn-action-icon svg {
    width: 17px;
    height: 17px;
  }
}

/* ============================================
   MOBILE کوچک (≤ 400px)
============================================ */
@media (max-width: 400px) {
  #watchActionsRow {
    gap: 5px;
  }

  #watchActionsRow .btn-action-wide {
    height: 36px;
    padding: 0 8px;
    font-size: 11.5px;
    border-radius: 7px;
  }

  #watchActionsRow .btn-action-wide svg {
    width: 13px;
    height: 13px;
  }

  #watchActionsRow .btn-action-icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 7px;
  }

  #watchActionsRow .btn-action-icon svg {
    width: 16px;
    height: 16px;
  }
}

/* ============================================
   MOBILE خیلی کوچک (≤ 340px)
============================================ */
@media (max-width: 340px) {
  #watchActionsRow {
    gap: 6px;
  }

  #watchActionsRow .btn-action-icon {
    display: none !important;
  }

  #watchActionsRow .btn-action-wide {
    flex: 1 1 0;
    height: 38px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 12px;
  }

  #watchActionsRow .btn-action-wide svg {
    width: 14px;
    height: 14px;
  }
}