/* ==========================================================================
   GojoEmbed Player Stylesheet - Clean Default JWPlayer Embed
   ========================================================================== */

@import "../../themes/red-theme.css";

/* Slash separator between elapsed and duration in Red Skin */
.jw-skin-red .jw-time-sep {
  color: rgba(255, 255, 255, 0.7);
  margin: 0 4px;
  font-weight: 500;
  font-size: 0.9em;
  user-select: none;
}

/* Settings Menu Positioning (Cleanly Above Progress Bar, No Overlap) */
.jwplayer.jw-skin-red .jw-settings-menu {
  bottom: 84px !important;
  z-index: 100 !important;
}

.jwplayer.jw-skin-red.jw-breakpoint-7:not(.jw-flag-audio-player) .jw-settings-menu {
  bottom: 95px !important;
  z-index: 100 !important;
}

/* 100% Exact Matching Size for -10 and +10 Buttons */
.jwplayer.jw-skin-red .jw-controlbar .jw-icon-rewind .jw-svg-icon,
.jwplayer.jw-skin-red .jw-controlbar div[button="ff11"] .jw-svg-icon {
  width: 30px !important;
  height: 30px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}

.jwplayer.jw-skin-red .jw-controlbar .jw-icon-rewind svg,
.jwplayer.jw-skin-red .jw-controlbar div[button="ff11"] svg {
  width: 24px !important;
  height: 24px !important;
  background-size: contain !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  margin: auto !important;
}

/* Progress Bar 100% White */
.jwplayer.jw-skin-red .jw-slider-horizontal.jw-chapter-slider-time .jw-slider-container .jw-timesegment-progress,
.jwplayer.jw-skin-red .jw-slider-horizontal.jw-chapter-slider-time .jw-knob,
.jwplayer.jw-skin-red .jw-slider-time .jw-progress,
.jwplayer.jw-skin-red .jw-slider-time .jw-knob,
.jwplayer.jw-skin-red .jw-progress {
  background-color: #ffffff !important;
  background: #ffffff !important;
}

:root {
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg-primary: #000;
  --accent-gojo: #ec4899;
  --accent-cyan: #06b6d4;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border-light: rgba(255, 255, 255, 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000;
  font-family: var(--font-main);
  color: var(--text-main);
}

.app-container {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  background-color: #000;
  overflow: hidden;
}

.player-stage {
  position: relative;
  width: 100%;
  height: 100%;
  background-color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.jwplayer-target {
  width: 100% !important;
  height: 100% !important;
  position: absolute !important;
  top: 0;
  left: 0;
}

.jwplayer {
  width: 100% !important;
  height: 100% !important;
}

.embed-iframe-target {
  width: 100%;
  height: 100%;
  border: none;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 5;
  background: #000;
}

.hidden {
  display: none !important;
}

/* --------------------------------------------------------------------------
   Loader Overlay
   -------------------------------------------------------------------------- */
.loader-overlay {
  position: absolute;
  inset: 0;
  background: #000000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 60;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loader-overlay.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.infinity-spinner {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.void-circle {
  position: absolute;
  border-radius: 50%;
  border: 2px solid transparent;
}

.void-circle.outer {
  width: 100%;
  height: 100%;
  border-top-color: var(--accent-gojo);
  border-right-color: var(--accent-cyan);
  animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
}

.void-circle.inner {
  width: 65%;
  height: 65%;
  border-bottom-color: var(--accent-gojo);
  animation: spinReverse 0.9s linear infinite;
}

.void-core {
  font-size: 16px;
}

.loader-message {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

/* --------------------------------------------------------------------------
   Error Overlay
   -------------------------------------------------------------------------- */
.error-overlay {
  position: absolute;
  inset: 0;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 65;
}

.error-card {
  max-width: 340px;
  background: rgba(18, 18, 28, 0.95);
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: var(--radius-md);
  padding: 22px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

.error-icon {
  font-size: 28px;
  margin-bottom: 10px;
}

.error-card h3 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fca5a5;
}

.error-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}

.error-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.btn-retry, .btn-fallback-embed {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn-retry {
  background: var(--accent-gojo);
  border: none;
  color: #fff;
}

.btn-fallback-embed {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-light);
  color: var(--text-main);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes spinReverse {
  to { transform: rotate(-360deg); }
}

/* --------------------------------------------------------------------------
   Server Selector Widget (Top Right Corner - Byse Red UI Match)
   -------------------------------------------------------------------------- */
.player-server-widget {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 100;
  font-family: 'Roboto', sans-serif;
  user-select: none;
  transition: opacity .25s ease, transform .25s ease;
}

.btn-server-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  background-color: rgba(0, 0, 0, 0.35);
  border: none;
  border-radius: 50px;
  color: #ffffff;
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  cursor: pointer;
  outline: none;
  box-shadow: none !important;
  transition: background-color .25s ease, transform .2s ease;
  position: relative;
}

.btn-server-toggle:hover {
  background-color: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.btn-server-toggle.active {
  background-color: rgba(255, 0, 51, 0.25);
  color: #ffffff;
}

.btn-server-toggle .chevron-icon {
  width: 12px;
  height: 12px;
  stroke: rgba(255, 255, 255, 0.7);
  transition: transform .2s ease, stroke .2s ease;
  flex-shrink: 0;
}

.btn-server-toggle.active .chevron-icon {
  transform: rotate(180deg);
  stroke: #ffffff;
}

/* Dropdown Menu (Exact match to .jw-skin-red .jw-settings-menu) */
.server-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 185px;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 105;
  animation: jwMenuFadeIn .2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes jwMenuFadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.server-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 8px;
  margin-bottom: 4px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.6);
}

.server-count-badge {
  background-color: #FF0033;
  color: #ffffff;
  padding: 1px 7px;
  border-radius: 50px;
  font-size: 10px;
  font-weight: 700;
}

.server-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 220px;
  overflow-y: auto;
}

.server-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.85);
  font-family: 'Roboto', sans-serif;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
}

.server-item:hover {
  background-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.server-item.active {
  background-color: rgba(255, 0, 51, 0.2);
  color: #FF0033;
  font-weight: 700;
}

.server-item .server-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.10);
  color: rgba(255, 255, 255, 0.7);
}

.server-item.active .server-tag {
  background-color: #FF0033;
  color: #ffffff;
}

/* Auto fade when user is inactive in JWPlayer controls */
.jwplayer.jw-flag-user-inactive:not(.jw-state-paused) .player-server-widget:not(.menu-open) {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
}

@media (max-width: 767px) {
  .player-server-widget {
    top: 10px;
    right: 10px;
  }
  .btn-server-toggle {
    height: 30px;
    padding: 0 12px;
    font-size: 11px;
  }
}


