/* Modern YouTube (2026) HTML5 Video Player UI */

.html5-video-player {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible; /* Allows ambient glow to softly bleed outside */
  background: #000;
  font-family: "YouTube Noto", Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 12px;
  color: #fff;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
  tabindex: -1;
  display: block;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

/* Ambient Mode Glow (Real-Time Color Bleed) */
.ytp-ambient-glow {
  position: absolute;
  top: -8%;
  left: -8%;
  width: 116%;
  height: 116%;
  z-index: 1;
  pointer-events: none;
  filter: blur(54px) saturate(1.9) brightness(1.15);
  opacity: 0.68;
  transition: opacity 0.5s cubic-bezier(0, 0, 0.2, 1);
  border-radius: 32px;
}

.html5-video-player.ytp-ambient-off .ytp-ambient-glow {
  opacity: 0 !important;
}

/* Autohide behavior */
.html5-video-player.ytp-autohide {
  cursor: none;
}

.html5-video-player.ytp-autohide .ytp-chrome-bottom,
.html5-video-player.ytp-autohide .ytp-chrome-top,
.html5-video-player.ytp-autohide .ytp-gradient-bottom,
.html5-video-player.ytp-autohide .ytp-gradient-top {
  opacity: 0;
  pointer-events: none;
}

/* Video Stage Container */
.html5-video-container {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: 16px;
  overflow: hidden;
}

.html5-video-container video,
.video-stream.html5-main-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
  border-radius: inherit;
  border: 0;
}

/* Video Click Target Overlay (catches clicks & gestures over iframes) */
.ytp-video-click-target {
  position: absolute;
  inset: 0;
  z-index: 8;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* Soft Modern Vignette Gradients */
.ytp-gradient-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  z-index: 12;
  pointer-events: none;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.35) 45%, transparent 100%);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  transition: opacity 0.25s cubic-bezier(0, 0, 0.2, 1);
}

.ytp-gradient-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  z-index: 12;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  transition: opacity 0.25s cubic-bezier(0, 0, 0.2, 1);
}

/* Press & Hold 2x Speed Floating Pill Badge */
.ytp-speed-indicator {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) scale(0.92);
  background: rgba(18, 18, 18, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s cubic-bezier(0, 0, 0.2, 1), transform 0.15s cubic-bezier(0, 0, 0.2, 1);
  z-index: 35;
  letter-spacing: 0.3px;
}

.ytp-speed-indicator.ytp-active {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.ytp-speed-arrow {
  color: #ff0000;
  font-size: 14px;
}

/* Chrome Top Bar */
.ytp-chrome-top {
  position: absolute;
  top: 14px;
  left: 16px;
  right: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0, 0, 0.2, 1);
}

.ytp-title-pill {
  pointer-events: auto;
  max-width: 70%;
  display: inline-flex;
  align-items: center;
  background: rgba(18, 18, 18, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  padding: 6px 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.ytp-title-text {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Chrome Bottom Container */
.ytp-chrome-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 0 16px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  transition: opacity 0.25s cubic-bezier(0, 0, 0.2, 1);
}

/* Modern Floating Progress Bar */
.ytp-progress-bar-container {
  position: relative;
  width: 100%;
  height: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  touch-action: none;
}

.ytp-progress-bar {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  transition: height 0.12s cubic-bezier(0, 0, 0.2, 1);
  overflow: visible;
}

.ytp-progress-bar-container:hover .ytp-progress-bar,
.ytp-seeking .ytp-progress-bar {
  height: 5px;
}

.ytp-progress-list {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
}

.ytp-load-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.45);
  border-radius: inherit;
  pointer-events: none;
  transition: width 0.15s ease;
}

.ytp-hover-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.ytp-progress-bar-container:hover .ytp-hover-progress {
  opacity: 1;
}

.ytp-play-progress {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: #ff0000;
  border-radius: inherit;
  pointer-events: none;
}

.ytp-scrubber-container {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 5;
}

.ytp-scrubber-button {
  width: 0px;
  height: 0px;
  border-radius: 50%;
  background: #ff0000;
  transform: scale(0);
  transition: transform 0.12s cubic-bezier(0, 0, 0.2, 1);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45), 0 2px 8px rgba(0, 0, 0, 0.5);
}

.ytp-progress-bar-container:hover .ytp-scrubber-button,
.ytp-seeking .ytp-scrubber-button {
  width: 13px;
  height: 13px;
  transform: scale(1);
}

/* Modern Pill Tooltip */
.ytp-tooltip {
  position: absolute;
  bottom: 26px;
  transform: translateX(-50%);
  background: rgba(18, 18, 18, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s;
  white-space: nowrap;
  z-index: 25;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  font-variant-numeric: tabular-nums;
}

.ytp-tooltip.ytp-visible {
  opacity: 1;
}

.ytp-tooltip .ytp-tooltip-thumb {
  display: block;
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 6px;
  margin: 0 auto 4px;
}


/* Modern 2026 Floating Controls Shelf */
.ytp-chrome-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Modern Floating Frosted Glass Capsule Pods */
.ytp-pill-left,
.ytp-pill-right {
  display: inline-flex;
  align-items: center;
  background: rgba(18, 18, 18, 0.78);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 3px 8px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  gap: 2px;
}

.ytp-button {
  background: none;
  border: 0;
  outline: none;
  padding: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  opacity: 0.92;
  transition: opacity 0.15s, background 0.15s, transform 0.1s ease;
  vertical-align: top;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
}

.ytp-button.ytp-download-button {
  width: auto;
  min-width: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.ytp-button:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.14);
}

.ytp-button:active {
  transform: scale(0.92);
}

.ytp-button svg {
  width: 20px;
  height: 20px;
  fill: #fff;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.3));
}

/* Volume Panel */
.ytp-volume-area {
  display: inline-flex;
  align-items: center;
  position: relative;
}

.ytp-volume-panel {
  width: 0px;
  height: 36px;
  overflow: hidden;
  display: flex;
  align-items: center;
  transition: width 0.22s cubic-bezier(0, 0, 0.2, 1), margin-right 0.22s cubic-bezier(0, 0, 0.2, 1);
  cursor: pointer;
}

.ytp-volume-area:hover .ytp-volume-panel,
.ytp-volume-slider-active .ytp-volume-panel {
  width: 56px;
  margin-right: 6px;
}

.ytp-volume-slider {
  width: 48px;
  height: 3px;
  background: rgba(255, 255, 255, 0.25);
  position: relative;
  border-radius: 999px;
}

.ytp-volume-slider-fill {
  height: 100%;
  background: #fff;
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 999px;
  pointer-events: none;
}

.ytp-volume-slider-handle {
  position: absolute;
  top: 50%;
  left: 100%;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Time Display */
.ytp-time-display {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  padding: 0 8px 0 4px;
  color: #ddd;
  height: 36px;
  font-family: Roboto, -apple-system, sans-serif;
  letter-spacing: 0.2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ytp-time-current {
  color: #fff;
}

.ytp-time-separator {
  color: #888;
  margin: 0 4px;
}

.ytp-time-duration {
  color: #aaa;
}

/* Modern Glassmorphic Settings Menu */
.ytp-settings-menu {
  position: absolute;
  right: 16px;
  bottom: 64px;
  background: rgba(20, 20, 20, 0.94);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.75);
  padding: 8px 0;
  min-width: 220px;
  z-index: 30;
  font-family: Roboto, -apple-system, sans-serif;
  font-size: 13px;
  color: #eee;
  user-select: none;
  display: none;
}

.ytp-settings-menu.ytp-visible {
  display: block;
  animation: ytp-menu-in 0.18s cubic-bezier(0, 0, 0.2, 1);
}

@keyframes ytp-menu-in {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ytp-menu-header {
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 700;
  color: #aaa;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.ytp-menu-header:hover {
  color: #fff;
}

.ytp-menuitem {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.12s;
  color: #ddd;
}

.ytp-menuitem:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.ytp-menuitem.ytp-menuitem-active {
  color: #ff0000;
  font-weight: 600;
}

.ytp-menuitem-label {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ytp-menuitem-content {
  font-size: 12px;
  color: #aaa;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ytp-menuitem-active .ytp-menuitem-content {
  color: #ff0000;
}

/* Modern Toggle Switch */
.ytp-switch {
  width: 32px;
  height: 18px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s ease;
}

.ytp-switch.ytp-on {
  background: #ff0000;
}

.ytp-switch-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: transform 0.2s cubic-bezier(0, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

.ytp-switch.ytp-on .ytp-switch-thumb {
  transform: translateX(14px);
}

/* Center Bezel Pulse Animation */
.ytp-bezel {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: rgba(18, 18, 18, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  z-index: 25;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.ytp-bezel.ytp-bezel-animate {
  animation: ytp-bezel-pop 0.55s cubic-bezier(0, 0, 0.2, 1) forwards;
}

@keyframes ytp-bezel-pop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  25% { opacity: 1; transform: translate(-50%, -50%) scale(1.05); }
  45% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); }
}

.ytp-bezel-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ytp-bezel-icon svg {
  width: 100%;
  height: 100%;
  fill: #fff;
}

/* Quick Seek Ripples (10s back / forward) */
.ytp-quick-seek {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 35%;
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
}

.ytp-quick-seek-left {
  left: 0;
  border-top-right-radius: 100%;
  border-bottom-right-radius: 100%;
}

.ytp-quick-seek-right {
  right: 0;
  border-top-left-radius: 100%;
  border-bottom-left-radius: 100%;
}

.ytp-quick-seek.ytp-quick-seek-animate {
  background: rgba(255, 255, 255, 0.14);
  animation: ytp-seek-ripple 0.45s ease-out forwards;
}

@keyframes ytp-seek-ripple {
  0% { opacity: 0; }
  35% { opacity: 1; }
  100% { opacity: 0; }
}

.ytp-quick-seek-text {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-top: 6px;
  letter-spacing: 0.5px;
}

/* Fullscreen Mode */
.html5-video-player.ytp-fullscreen {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  z-index: 999999 !important;
  border-radius: 0 !important;
}

.html5-video-player.ytp-fullscreen .ytp-ambient-glow {
  display: none !important;
}

@media (max-width: 600px) {
  .ytp-chrome-bottom {
    padding: 0 10px 10px 10px;
  }
  .ytp-pill-left, .ytp-pill-right {
    padding: 2px 6px;
  }
  .ytp-button {
    width: 32px;
    height: 32px;
  }
  .ytp-button svg {
    width: 18px;
    height: 18px;
  }
  .ytp-time-display {
    font-size: 11px;
    padding: 0 4px;
  }
  .ytp-volume-area:hover .ytp-volume-panel,
  .ytp-volume-slider-active .ytp-volume-panel {
    display: none;
  }
}
