/* Custom CSS Variables scoped to Video Player */
.tp-root-wrapper {
  --tp-accent: #38bdf8;
  --tp-accent-glow: rgba(56, 189, 248, 0.35);
  --tp-bg-dark: #09090b;
  --tp-bg-control: rgba(15, 23, 42, 0.75);
  --tp-text-main: #f8fafc;
  --tp-text-muted: #94a3b8;
  --tp-border: rgba(255, 255, 255, 0.1);
  --tp-radius: 14px;
  
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 2.5rem auto;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: var(--tp-text-main);
  box-sizing: border-box;
}

.tp-root-wrapper * {
  box-sizing: border-box;
}

/* Main Article Frame */
.tp-video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: var(--tp-bg-dark);
  border-radius: var(--tp-radius);
  overflow: hidden;
  border: 1px solid var(--tp-border);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  user-select: none;
}

/* Video Slot & Video Tag */
.tp-video-slot {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.tp-video-element {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  outline: none;
}

/* Minimalist Center Play Overlay */
.tp-center-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.25);
  transition: opacity 0.3s ease;
  z-index: 5;
}

.tp-center-overlay.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.tp-minimal-play-btn {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.25s ease;
}

.tp-minimal-play-btn svg {
  width: 52px;
  height: 52px;
  fill: var(--tp-accent);
  filter: drop-shadow(0 0 16px var(--tp-accent-glow)) drop-shadow(0 4px 12px rgba(0,0,0,0.6));
  transform: translateX(3px); /* Optical alignment for triangle */
}

.tp-center-overlay:hover .tp-minimal-play-btn {
  transform: scale(1.15);
}

/* Custom Controls Bar */
.tp-controls-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(9, 9, 11, 0.95) 0%, rgba(9, 9, 11, 0.4) 70%, transparent 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 12px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  opacity: 1;
  transition: opacity 0.3s ease;
  z-index: 10;
}

.tp-video-frame.is-playing:not(:hover) .tp-controls-bar {
  opacity: 0;
}

/* Progress Bar */
.tp-progress-container {
  position: relative;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  cursor: pointer;
  transition: height 0.15s ease;
}

.tp-progress-container:hover {
  height: 8px;
}

.tp-progress-buffered {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
  width: 0%;
}

.tp-progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--tp-accent);
  border-radius: 3px;
  width: 0%;
  box-shadow: 0 0 8px var(--tp-accent-glow);
}

.tp-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.15s ease;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

.tp-progress-container:hover .tp-progress-thumb {
  transform: translate(-50%, -50%) scale(1);
}

/* Buttons and Controls Layout */
.tp-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tp-controls-left, .tp-controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tp-btn {
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--tp-text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.2s, background-color 0.2s;
}

.tp-btn:hover {
  color: var(--tp-accent);
  background-color: rgba(255, 255, 255, 0.08);
}

.tp-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tp-btn .tp-icon-pause,
.tp-btn .tp-icon-vol-mute,
.tp-btn .tp-icon-fs-exit {
  display: none;
}

/* Time Indicator */
.tp-time-display {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  color: var(--tp-text-muted);
}

.tp-time-divider {
  margin: 0 3px;
  opacity: 0.5;
}

/* Volume Slider */
.tp-volume-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.tp-volume-slider-wrapper {
  width: 0px;
  overflow: hidden;
  transition: width 0.25s ease;
  display: flex;
  align-items: center;
}

.tp-volume-group:hover .tp-volume-slider-wrapper {
  width: 65px;
}

.tp-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 60px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.tp-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tp-accent);
  cursor: pointer;
}

.tp-volume-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: none;
  border-radius: 50%;
  background: var(--tp-accent);
  cursor: pointer;
}

/* Fullscreen Mode Fixes */
.tp-video-frame:fullscreen {
  border-radius: 0;
  border: none;
  width: 100vw;
  height: 100vh;
}

/* TRUE SCREEN FLOATING MINI PLAYER DOCK */
body > .tp-floating-dock,
.tp-floating-dock {
  position: fixed !important;
  bottom: 24px !important;
  right: 24px !important;
  left: auto !important;
  top: auto !important;
  
  width: 320px !important;
  max-width: 85vw !important;
  aspect-ratio: 16 / 9;
  
  background-color: #09090b;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  
  /* Browser ke sabse top layer (Z-Index) par float hoga */
  z-index: 2147483647 !important;
  
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateY(30px) scale(0.9);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
}

body > .tp-floating-dock.is-active,
.tp-floating-dock.is-active {
  opacity: 1 !important;
  pointer-events: auto !important;
  transform: translateY(0) scale(1) !important;
}

/* Mobile Devices (Portrait & Landscape) Floating Adjustments */
@media (max-width: 640px) {
  body > .tp-floating-dock,
  .tp-floating-dock {
    width: 240px !important;
    right: 12px !important;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  }
}

.tp-floating-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  z-index: 20;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tp-floating-dock:hover .tp-floating-header {
  opacity: 1;
}

.tp-floating-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--tp-accent);
}

.tp-floating-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 2px;
}

.tp-floating-close svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 2;
}

/* Responsive Floating Dock for Mobile */
@media (max-width: 640px) {
  .tp-floating-dock {
    width: calc(100vw - 32px);
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}