/* Watch page player toolbar & controls — matches PirateMedia dark / indigo scheme */

.watch-player-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-top: -8px;
}

.watch-toolbar-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 140px;
}

.watch-now-playing {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watch-now-playing span {
  color: #a5b8ff;
}

.watch-player-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.watch-player-status.is-ready {
  color: #4ade80;
}

.watch-player-status.is-loading {
  color: #a5b8ff;
}

.watch-player-status.is-error {
  color: #f87171;
}

.watch-toolbar-toggles {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 2 1 240px;
  justify-content: center;
}

.watch-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.watch-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.watch-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.watch-toggle-track {
  position: relative;
  width: 36px;
  height: 20px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.watch-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease, background 0.2s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.watch-toggle input:checked + .watch-toggle-track {
  background: linear-gradient(135deg, rgba(92, 124, 250, 0.85), rgba(138, 43, 226, 0.75));
}

.watch-toggle input:checked + .watch-toggle-track .watch-toggle-thumb {
  transform: translateX(16px);
}

.watch-toggle-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.watch-toggle input:checked ~ .watch-toggle-label {
  color: #c7d2fe;
}

.watch-toolbar-quick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1 1 180px;
  justify-content: flex-end;
}

.watch-quick-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.watch-quick-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.15);
}

.watch-quick-btn.is-active {
  background: rgba(92, 124, 250, 0.18);
  border-color: rgba(92, 124, 250, 0.45);
  color: #a5b8ff;
}

.watch-quick-btn i {
  font-size: 13px;
}

.watch-quick-btn .watch-quick-label {
  display: none;
}

@media (min-width: 900px) {
  .watch-quick-btn .watch-quick-label {
    display: inline;
  }
}

/* Controls panel */
.watch-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
}

.watch-controls-panel .player-controls {
  flex-direction: column;
  gap: 16px;
}

.watch-controls-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.watch-controls-section-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.5);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.watch-controls-section-head h3 i {
  color: #5c7cfa;
  font-size: 11px;
}

.watch-server-count {
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.35);
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.watch-controls-actions-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.watch-controls-actions-row .player-actions {
  gap: 8px;
}

.watch-action-hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}

.watch-controls-panel .server-selector label {
  display: none;
}

.watch-controls-panel .server-buttons {
  max-height: 160px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(92, 124, 250, 0.4) transparent;
}

/* Player wrapper enhancements */
.video-player-wrapper.watch-player-loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 5;
  pointer-events: none;
}

.video-player-wrapper .watch-loading-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(92, 124, 250, 0.35);
  color: #a5b8ff;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.video-player-wrapper.watch-player-loading .watch-loading-badge {
  opacity: 1;
}

/* Theater & cinema modes */
body.watch-theater-mode .sidebar-section,
body.watch-theater-mode .similar-section-wrapper,
body.watch-theater-mode .tips-section,
body.watch-theater-mode .content-overview,
body.watch-theater-mode .enhanced-similar-section,
body.watch-theater-mode .discord-sidebar {
  display: none !important;
}

body.watch-theater-mode .watch-container {
  grid-template-columns: 1fr;
  max-width: 1400px;
}

body.watch-theater-mode .video-player-wrapper {
  padding-top: 50%;
}

body.watch-cinema-mode::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  z-index: 900;
  pointer-events: none;
  animation: watchCinemaFade 0.35s ease;
}

body.watch-cinema-mode .player-section,
body.watch-cinema-mode .video-player-wrapper,
body.watch-cinema-mode .watch-player-toolbar,
body.watch-cinema-mode .watch-controls-panel {
  position: relative;
  z-index: 901;
}

@keyframes watchCinemaFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 640px) {
  .watch-player-toolbar {
    padding: 12px;
  }

  .watch-toolbar-toggles {
    justify-content: flex-start;
    width: 100%;
  }

  .watch-toolbar-quick {
    width: 100%;
    justify-content: flex-start;
  }

  .watch-toggle-label span.toggle-text {
    display: none;
  }
}

/* Media download dropdown on watch pages */
.watch-download-bar {
  margin: 12px 0 0;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  scroll-margin-top: 96px;
}

.watch-download-bar.watch-download-highlight {
  border-color: rgba(0, 255, 255, 0.45);
  box-shadow: 0 0 0 2px rgba(0, 255, 255, 0.12);
}

.watch-download-bar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.watch-download-bar-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.watch-download-bar-count {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.45);
}

.watch-download-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.watch-download-select {
  flex: 1 1 220px;
  min-width: 0;
  padding: 11px 36px 11px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.watch-download-select:hover,
.watch-download-select:focus {
  border-color: rgba(255, 0, 255, 0.35);
  outline: none;
}

.watch-download-select option {
  background: #14141c;
  color: #fff;
}

.watch-download-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 11px 20px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 0, 255, 0.22), rgba(0, 255, 255, 0.14));
  border: 1px solid rgba(255, 0, 255, 0.35);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  white-space: nowrap;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 6px 20px rgba(255, 0, 255, 0.1);
}

.watch-download-cta:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 255, 255, 0.45);
  box-shadow: 0 8px 24px rgba(0, 255, 255, 0.14);
}

.watch-download-hint {
  margin: 10px 0 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.45);
}

.watch-download-action {
  text-decoration: none;
  color: inherit;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 640px) {
  .watch-download-controls {
    flex-direction: column;
  }

  .watch-download-select,
  .watch-download-cta {
    width: 100%;
  }
}
