/**
 * JPlayer Frontend Stylesheet — Luxury Cyberpunk & Glassmorphic 3D Player
 */

:root {
  --jp-primary: #00f0ff;
  --jp-accent: #ff007f;
  --jp-bg: #0a0a14;
  --jp-surface: rgba(18, 18, 30, 0.85);
  --jp-text: #f0f4f8;
  --jp-muted: #8b9bb4;
  --jp-border: rgba(0, 240, 255, 0.2);
  --jp-glow: 0 0 25px rgba(0, 240, 255, 0.25);
  --jp-radius: 12px;
}

.jplayer-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  background: var(--jp-bg);
  border-radius: var(--jp-radius);
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), var(--jp-glow);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.15s ease-out, box-shadow 0.2s ease;
  perspective: 1000px;
}

.jplayer-container.is-3d-tilt {
  transform-style: preserve-3d;
}

.jplayer-media-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #000;
  overflow: hidden;
}

.jplayer-video-element,
.jplayer-iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  object-fit: contain;
}

/* Glassmorphic Control Bar */
.jplayer-controls-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to top, rgba(10, 10, 20, 0.95) 0%, rgba(10, 10, 20, 0.6) 70%, transparent 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 16px;
  gap: 8px;
  z-index: 30;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.jplayer-container:hover .jplayer-controls-bar,
.jplayer-container.is-paused .jplayer-controls-bar {
  opacity: 1;
  transform: translateY(0);
}

/* Progress / Scrubber Bar */
.jplayer-progress-area {
  position: relative;
  height: 6px;
  width: 100%;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  cursor: pointer;
  transition: height 0.15s ease;
}

.jplayer-progress-area:hover {
  height: 10px;
}

.jplayer-progress-loaded {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 4px;
  width: 0%;
}

.jplayer-progress-played {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--jp-primary) 0%, var(--jp-accent) 100%);
  border-radius: 4px;
  width: 0%;
  box-shadow: 0 0 10px var(--jp-primary);
}

.jplayer-scrubber-handle {
  position: absolute;
  top: 50%;
  right: -6px;
  transform: translateY(-50%) scale(0);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 0 8px var(--jp-primary);
  transition: transform 0.15s ease;
}

.jplayer-progress-area:hover .jplayer-scrubber-handle {
  transform: translateY(-50%) scale(1);
}

/* Control Row & Buttons */
.jplayer-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  color: var(--jp-text);
}

.jplayer-controls-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.jplayer-btn {
  background: transparent;
  border: none;
  color: var(--jp-text);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, transform 0.15s ease, background 0.2s ease;
}

.jplayer-btn:hover {
  color: var(--jp-primary);
  background: rgba(0, 240, 255, 0.1);
  transform: scale(1.08);
}

.jplayer-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.jplayer-time-display {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  color: var(--jp-muted);
}

.jplayer-time-display span.current {
  color: var(--jp-text);
  font-weight: 600;
}

/* Speed and Quality Selectors */
.jplayer-dropdown-trigger {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border: 1px solid var(--jp-border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--jp-text);
  cursor: pointer;
}

/* Dynamic Floating Watermark Container */
.jplayer-watermark-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 25;
  overflow: hidden;
}

.jplayer-floating-watermark {
  position: absolute;
  color: rgba(255, 255, 255, 0.25);
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
  pointer-events: none;
  white-space: nowrap;
  transition: top 1.5s cubic-bezier(0.4, 0, 0.2, 1), left 1.5s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.5s ease;
  user-select: none;
}

/* Anti-Cheat Warning Shield */
.jplayer-security-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 10, 20, 0.95);
  backdrop-filter: blur(15px);
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #ff3366;
  text-align: center;
  padding: 24px;
}

.jplayer-security-overlay h3 {
  font-size: 20px;
  margin-bottom: 8px;
  font-weight: 700;
}

.jplayer-security-overlay p {
  font-size: 14px;
  color: #cad5e2;
  max-width: 420px;
  line-height: 1.6;
}

/* Cinema Mode */
.jplayer-container.is-cinema {
  max-width: 95vw;
  width: 95vw;
  margin: 0 auto;
  z-index: 1000;
}

/* RTL Support */
[dir="rtl"] .jplayer-controls-row {
  direction: rtl;
}

[dir="rtl"] .jplayer-progress-played {
  left: auto;
  right: 0;
}

[dir="rtl"] .jplayer-progress-loaded {
  left: auto;
  right: 0;
}

[dir="rtl"] .jplayer-scrubber-handle {
  right: auto;
  left: -6px;
}
