/* Traders Journal — 4K Walkthrough Video Player Component */

.walkthrough-section {
  position: relative;
  padding: clamp(48px, 6vw, 84px) 0;
  background: var(--paper-quiet);
  overflow: hidden;
}

.walkthrough-section .wrap {
  max-width: min(1640px, 95vw);
  padding: 0 clamp(16px, 2.5vw, 36px);
}

.walkthrough-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 1400px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--dark-rule), transparent);
}

.walkthrough__head {
  text-align: center;
  max-width: 860px;
  margin: 0 auto clamp(20px, 3vw, 40px);
}

.walkthrough__head h2 {
  margin-bottom: 12px;
}

.walkthrough__head p.lede {
  margin: 0 auto;
}

/* Player Frame & Shell (Expanded Cinematic Size) */
.tj-player {
  position: relative;
  width: 100%;
  max-width: 1640px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #08080a;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 36px 90px -20px rgba(0, 0, 0, 0.92),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 120px -20px rgba(59, 130, 246, 0.35);
  user-select: none;
  touch-action: manipulation;
}

.tj-player video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #08080a;
}

/* Ambient glow container */
.tj-player__ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* Center Big Play Button */
.tj-player__center-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(1);
  width: clamp(60px, 8vw, 88px);
  height: clamp(60px, 8vw, 88px);
  border-radius: 50%;
  background: rgba(17, 17, 21, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  cursor: pointer;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 24px rgba(59, 130, 246, 0.4);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s, opacity 0.3s;
}

.tj-player__center-btn:hover {
  transform: translate(-50%, -50%) scale(1.08);
  background: rgba(30, 30, 38, 0.88);
  border-color: rgba(59, 130, 246, 0.5);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7), 0 0 32px rgba(59, 130, 246, 0.6);
}

.tj-player__center-btn svg {
  width: 38%;
  height: 38%;
  margin-left: 5%;
  fill: #fff;
  transition: transform 0.2s;
}

.tj-player.is-playing .tj-player__center-btn {
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.85);
}

/* Controls Bar */
.tj-player__controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 24px clamp(14px, 2.5vw, 24px) clamp(12px, 2vw, 18px);
  background: linear-gradient(0deg, rgba(8, 8, 11, 0.94) 0%, rgba(8, 8, 11, 0.65) 60%, transparent 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.tj-player.is-playing.is-idle .tj-player__controls {
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
}

/* Timeline / Scrubber */
.tj-player__timeline {
  position: relative;
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  cursor: pointer;
  transition: height 0.15s ease;
}

.tj-player__timeline:hover {
  height: 9px;
}

.tj-player__buffered {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  pointer-events: none;
  transition: width 0.2s ease;
}

.tj-player__played {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 999px;
  pointer-events: none;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.6);
}

.tj-player__thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%) scale(0);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.9), 0 2px 6px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transition: transform 0.15s ease;
}

.tj-player__timeline:hover .tj-player__thumb,
.tj-player.is-scrubbing .tj-player__thumb {
  transform: translate(-50%, -50%) scale(1);
}

/* Timeline Time Tooltip */
.tj-player__tooltip {
  position: absolute;
  bottom: 18px;
  transform: translateX(-50%);
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(14, 14, 18, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #f1f5f9;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  white-space: nowrap;
}

.tj-player__timeline:hover .tj-player__tooltip {
  opacity: 1;
}

/* Controls Row */
.tj-player__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(8px, 1.8vw, 18px);
}

.tj-player__group {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.2vw, 14px);
}

/* Control Buttons */
.tj-btn {
  background: none;
  border: 0;
  padding: 6px;
  cursor: pointer;
  color: #d1d5db;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s, transform 0.15s;
}

.tj-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

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

.tj-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* Volume Group */
.tj-player__vol-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tj-player__vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 0px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
  opacity: 0;
  overflow: hidden;
  transition: width 0.25s ease, opacity 0.25s ease;
}

.tj-player__vol-wrap:hover .tj-player__vol-slider,
.tj-player__vol-slider:focus {
  width: clamp(50px, 6vw, 75px);
  opacity: 1;
}

.tj-player__vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  box-shadow: -100px 0 0 100px #3b82f6;
}

.tj-player__vol-slider::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #3b82f6;
  cursor: pointer;
  border: 0;
}

.tj-player__vol-slider::-moz-range-progress {
  background: #3b82f6;
  height: 4px;
}

/* Time display */
.tj-player__time {
  font-family: var(--mono);
  font-size: clamp(11px, 1.1vw, 13px);
  color: #9ca3af;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.tj-player__time span {
  color: #f3f4f6;
  font-weight: 500;
}

/* Playback Speed Button / Menu */
.tj-player__speed-btn {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: -0.02em;
}

.tj-player__speed-btn:hover {
  background: rgba(59, 130, 246, 0.2);
  color: #93b8ff;
  border-color: rgba(59, 130, 246, 0.4);
}

.tj-player__speed-btn.is-fast {
  background: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
  border-color: #3b82f6;
}

/* Fullscreen Styles */
.tj-player:fullscreen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
  border: 0;
}

.tj-player:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-width: none;
  border-radius: 0;
  border: 0;
}

/* Floating Unmute Button */
.tj-player__unmute-badge {
  position: absolute;
  top: clamp(14px, 2.5vw, 24px);
  right: clamp(14px, 2.5vw, 24px);
  z-index: 15;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(15, 17, 23, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(59, 130, 246, 0.45);
  border-radius: 999px;
  color: #fff;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 20px rgba(59, 130, 246, 0.3);
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.3s ease, border-color 0.2s ease;
  animation: pulse-unmute 2.4s ease-in-out infinite;
}

.tj-player__unmute-badge:hover {
  transform: scale(1.05);
  background: rgba(30, 35, 48, 0.96);
  border-color: rgba(59, 130, 246, 0.85);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.85), 0 0 30px rgba(59, 130, 246, 0.55);
}

.tj-player__unmute-badge svg {
  width: 15px;
  height: 15px;
  fill: #60a5fa;
  stroke: #60a5fa;
  flex-shrink: 0;
}

.tj-player__unmute-badge.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px) scale(0.95);
}

@keyframes pulse-unmute {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 16px rgba(59, 130, 246, 0.25);
  }
  50% {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 32px rgba(59, 130, 246, 0.6);
  }
}

/* Mobile responsive adjustments */
@media (max-width: 640px) {
  .tj-player__title {
    display: none;
  }
  .tj-player__vol-slider {
    display: none;
  }
  .tj-player__controls {
    padding: 16px 12px 10px;
    gap: 8px;
  }
}
