/* ==========================================================================
   BK Stream - YouTube Cinema Player & Watch Page Styling
   ========================================================================== */

:root {
  --yt-red: #ff0000;
  --yt-red-dark: #cc0000;
  --yt-bg-dark: #0f0f0f;
  --yt-card-bg: rgba(255, 255, 255, 0.06);
  --yt-card-hover: rgba(255, 255, 255, 0.1);
  --yt-border: rgba(255, 255, 255, 0.12);
}

/* --------------------------------------------------
   Cinema Stage Container & Theater Mode
   -------------------------------------------------- */
.bk-watch-layout {
  position: relative;
  width: 100%;
}

.bk-cinema-stage-wrap {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.7);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* When Theater Mode is Active */
.bk-watch-layout.bk-mode-theater .bk-cinema-stage-wrap {
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  margin-right: calc(-50vw + 50%);
  border-radius: 0;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.9);
  max-height: calc(100vh - 110px);
  display: flex;
  justify-content: center;
  align-items: center;
  background: #000;
}

.bk-watch-layout.bk-mode-theater .bk-yt-player-root,
.bk-watch-layout.bk-mode-theater .ratio-16x9 {
  width: 100%;
  max-width: 1600px;
  max-height: calc(100vh - 110px);
  aspect-ratio: 16/9;
  border-radius: 0;
}

/* --------------------------------------------------
   YouTube Embed & IFrame Player
   -------------------------------------------------- */
.bk-yt-player-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: #000;
  border-radius: inherit;
}

/* --------------------------------------------------
   Native YouTube-Styled Player
   -------------------------------------------------- */
.bk-yt-player-root {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.bk-yt-player-root video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  display: block;
}

/* Centered Big YouTube Red Play Button */
.bk-yt-big-play {
  position: absolute;
  width: 68px;
  height: 48px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  z-index: 6;
  outline: none;
  transition: transform 0.15s cubic-bezier(0, 0, 0.2, 1), opacity 0.2s ease;
}

.bk-yt-big-play svg {
  display: block;
  width: 100%;
  height: 100%;
}

.bk-yt-big-play:hover {
  transform: scale(1.12);
}

.bk-yt-big-play:hover .ytp-large-play-button-bg {
  fill: #ff0000;
  filter: drop-shadow(0 0 12px rgba(255, 0, 0, 0.75));
}

.bk-yt-player-root.is-playing .bk-yt-big-play {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.85);
}

/* Double-click skip ripples */
.bk-skip-ripple {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.bk-skip-ripple.left {
  left: 0;
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
  background: radial-gradient(circle at left center, rgba(255,255,255,0.2) 0%, transparent 70%);
}

.bk-skip-ripple.right {
  right: 0;
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
  background: radial-gradient(circle at right center, rgba(255,255,255,0.2) 0%, transparent 70%);
}

.bk-skip-ripple.animate {
  opacity: 1;
}

.bk-skip-ripple i {
  font-size: 2.2rem;
  color: #fff;
}

.bk-skip-ripple span {
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  margin-top: 4px;
}

/* --------------------------------------------------
   YouTube Controls Bar & Timeline
   -------------------------------------------------- */
.bk-yt-controls-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 0.5rem 0.85rem 0.6rem;
  background: linear-gradient(to top, rgba(0,0,0,0.88) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: opacity 0.25s ease;
}

.bk-yt-player-root.is-playing.is-idle .bk-yt-controls-wrapper {
  opacity: 0;
  pointer-events: none;
}

.bk-yt-player-root.is-playing.is-idle {
  cursor: none;
}

/* Scrubber Timeline */
.bk-yt-timeline-container {
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.bk-yt-timeline-track {
  position: relative;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 2px;
  transition: height 0.12s ease;
}

.bk-yt-timeline-container:hover .bk-yt-timeline-track {
  height: 6px;
}

.bk-yt-timeline-buffered {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 2px;
  pointer-events: none;
  transition: width 0.2s ease;
}

.bk-yt-timeline-played {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: var(--yt-red);
  border-radius: 2px;
  pointer-events: none;
}

.bk-yt-timeline-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%) scale(0);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--yt-red);
  box-shadow: 0 0 6px rgba(0,0,0,0.6);
  pointer-events: none;
  transition: transform 0.12s ease;
}

.bk-yt-timeline-container:hover .bk-yt-timeline-thumb,
.bk-yt-timeline-container.is-dragging .bk-yt-timeline-thumb {
  transform: translate(-50%, -50%) scale(1);
}

.bk-yt-timeline-hover-time {
  position: absolute;
  bottom: 22px;
  left: 0;
  transform: translateX(-50%);
  background: rgba(15, 15, 15, 0.95);
  color: #fff;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  z-index: 15;
}

/* Control Buttons Row */
.bk-yt-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.bk-yt-left-controls,
.bk-yt-right-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.bk-yt-btn {
  background: transparent;
  border: 0;
  color: #fff;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  transition: color 0.15s ease, transform 0.1s ease;
}

.bk-yt-btn:hover {
  color: var(--yt-red);
}

.bk-yt-btn:active {
  transform: scale(0.92);
}

.bk-yt-btn.is-active {
  color: var(--yt-red);
}

.bk-yt-btn-skip {
  font-size: 0.85rem;
  font-weight: 700;
  gap: 3px;
}

.bk-yt-btn-skip i {
  font-size: 1.15rem;
}

/* Volume Wrap & Slider */
.bk-yt-volume-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bk-yt-volume-slider {
  width: 0;
  opacity: 0;
  cursor: pointer;
  accent-color: var(--yt-red);
  transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  height: 4px;
  border-radius: 2px;
}

.bk-yt-volume-wrap:hover .bk-yt-volume-slider,
.bk-yt-volume-slider:focus {
  width: 60px;
  opacity: 1;
}

/* Time Display */
.bk-yt-time-display {
  color: #e0e0e0;
  font-size: 0.82rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  margin-left: 6px;
  white-space: nowrap;
}

/* Settings Gear Menu */
.bk-yt-settings-menu {
  position: absolute;
  bottom: 52px;
  right: 12px;
  background: rgba(22, 22, 22, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.4rem 0;
  min-width: 170px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  z-index: 25;
  display: none;
  backdrop-filter: blur(8px);
}

.bk-yt-settings-menu.is-open {
  display: block;
}

.bk-yt-settings-header {
  padding: 6px 14px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: rgba(255, 255, 255, 0.5);
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bk-yt-speed-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 14px;
  color: #fff;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease;
}

.bk-yt-speed-option:hover {
  background: rgba(255, 255, 255, 0.1);
}

.bk-yt-speed-option.is-selected {
  color: var(--yt-red);
  font-weight: 700;
}

/* --------------------------------------------------
   YouTube Watch Page UI: Header, Channel, Description
   -------------------------------------------------- */
.bk-watch-title {
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.3px;
  line-height: 1.3;
}

.bk-channel-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bk-channel-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e50914, #b20710);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(229, 9, 20, 0.4);
}

.bk-channel-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.bk-channel-sub {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Action Buttons (YouTube pill style) */
.bk-action-pill {
  background: var(--yt-card-bg);
  color: #fff;
  border: 1px solid var(--yt-border);
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  text-decoration: none;
}

.bk-action-pill:hover {
  background: var(--yt-card-hover);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.bk-action-pill:active {
  transform: scale(0.96);
}

.bk-action-pill.active {
  background: var(--yt-red);
  border-color: var(--yt-red);
  color: #fff;
}

/* Description Card */
.bk-description-card {
  background: var(--yt-card-bg);
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  transition: background 0.2s ease;
  cursor: pointer;
}

.bk-description-card:hover {
  background: var(--yt-card-hover);
}

.bk-description-card.is-expanded .bk-desc-text {
  max-height: none;
  -webkit-line-clamp: unset;
}

.bk-desc-meta {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 8px;
}

.bk-desc-text {
  font-size: 0.9rem;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.85);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bk-desc-toggle-btn {
  background: transparent;
  border: 0;
  color: #fff;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 4px 0 0;
  cursor: pointer;
  margin-top: 4px;
}

/* --------------------------------------------------
   YouTube Up Next & Playlist Sidebar
   -------------------------------------------------- */
.bk-sidebar-card {
  background: rgba(18, 18, 18, 0.7);
  border: 1px solid var(--yt-border);
  border-radius: 12px;
  padding: 1rem;
}

.bk-upnext-item {
  display: flex;
  gap: 12px;
  padding: 8px;
  border-radius: 8px;
  text-decoration: none;
  color: #fff;
  transition: background 0.15s ease;
  position: relative;
}

.bk-upnext-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.bk-upnext-item.is-active {
  background: rgba(255, 0, 0, 0.12);
  border-left: 3px solid var(--yt-red);
}

.bk-upnext-thumb {
  position: relative;
  width: 120px;
  min-width: 120px;
  aspect-ratio: 16/9;
  border-radius: 6px;
  overflow: hidden;
  background: #000;
}

.bk-upnext-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bk-upnext-thumb .duration-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
}

.bk-upnext-thumb .playing-indicator {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--yt-red);
  font-size: 1.5rem;
}

.bk-upnext-info {
  flex: 1;
  min-width: 0;
}

.bk-upnext-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.bk-upnext-meta {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.55);
}

/* Toast Alert for Share */
.bk-toast-alert {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(18, 18, 18, 0.95);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 9999;
  box-shadow: 0 8px 30px rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.bk-toast-alert.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --------------------------------------------------
   Smart Resume Playback Overlay
   -------------------------------------------------- */
.bk-resume-banner {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  z-index: 45;
  background: rgba(18, 18, 20, 0.94);
  border: 1px solid rgba(229, 9, 20, 0.4);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.75), 0 0 20px rgba(229, 9, 20, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.bk-resume-banner.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.bk-resume-banner .bk-resume-btn {
  background: var(--yt-red);
  color: #fff;
  border: none;
  padding: 4px 12px;
  border-radius: 16px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.bk-resume-banner .bk-resume-btn:hover {
  background: #ff1f2d;
  transform: scale(1.04);
}

.bk-resume-banner .bk-resume-dismiss {
  background: transparent;
  border: none;
  color: #a1a1aa;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  padding: 2px;
}

.bk-resume-banner .bk-resume-dismiss:hover {
  color: #fff;
}

/* --------------------------------------------------
   Next Episode Autoplay Countdown (Netflix Style)
   -------------------------------------------------- */
.bk-autoplay-card {
  position: absolute;
  bottom: 64px;
  right: 20px;
  z-index: 45;
  width: min(340px, 90vw);
  background: rgba(14, 14, 16, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(229, 9, 20, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.bk-autoplay-card.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.bk-autoplay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #a1a1aa;
  font-weight: 600;
}

.bk-autoplay-timer-num {
  color: #e50914;
  font-weight: 800;
  font-size: 0.95rem;
}

.bk-autoplay-body {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bk-autoplay-thumb {
  width: 64px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  background: #27272a;
  flex-shrink: 0;
}

.bk-autoplay-info {
  flex: 1;
  min-width: 0;
}

.bk-autoplay-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bk-autoplay-sub {
  font-size: 0.75rem;
  color: #a1a1aa;
}

.bk-autoplay-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bk-autoplay-play {
  flex: 1;
  background: #e50914;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease;
  text-decoration: none;
}

.bk-autoplay-play:hover {
  background: #ff1f2d;
  color: #fff;
}

.bk-autoplay-cancel {
  background: rgba(255, 255, 255, 0.1);
  color: #d4d4d8;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.bk-autoplay-cancel:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

/* --------------------------------------------------
   Social Share Modal
   -------------------------------------------------- */
.bk-share-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.bk-share-modal-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

.bk-share-modal-card {
  width: 100%;
  max-width: 480px;
  background: #18181c;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  transform: translateY(10px) scale(0.96);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.bk-share-modal-backdrop.is-open .bk-share-modal-card {
  transform: translateY(0) scale(1);
}

.bk-share-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.bk-share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 0.85rem 0.5rem;
  color: #fff;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  transition: background 0.15s ease, transform 0.15s ease;
}

.bk-share-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
  color: #fff;
}

.bk-share-btn i {
  font-size: 1.5rem;
}

.bk-share-btn.whatsapp i { color: #25D366; }
.bk-share-btn.telegram i { color: #229ED9; }
.bk-share-btn.facebook i { color: #1877F2; }
.bk-share-btn.twitter i { color: #1DA1F2; }

.bk-share-copy-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #101012;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 0.4rem 0.5rem 0.4rem 0.85rem;
}

.bk-share-copy-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #d4d4d8;
  font-size: 0.85rem;
  font-family: inherit;
}
