/* YouTube player container */
#youtube-player {
  aspect-ratio: 16 / 9;
  width: 100%;
  max-height: 70vh;
  background: #000;
  border-radius: 0.75rem;
  overflow: hidden;
}

#youtube-player iframe {
  width: 100%;
  height: 100%;
}

/* Transparent shield blocks all YouTube iframe interactions (hover, clicks, end screen) */
#iframe-shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: default;
}

/* Pulse animation for now playing indicator */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.animate-pulse-dot {
  animation: pulse-dot 1.5s ease-in-out infinite;
}

/* Line clamp utility (fallback for older browsers) */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Smooth page transitions */
.page-enter {
  opacity: 0;
  transform: translateY(10px);
}

.page-enter-active {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* QR code styling */
.qr-container canvas,
.qr-container img {
  border-radius: 0.5rem;
}

/* Scrollbar styling for queue */
.queue-scroll::-webkit-scrollbar {
  width: 4px;
}

.queue-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.queue-scroll::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 2px;
}

/* Player overlay — ensure it sits above the YouTube iframe */
#player-overlay {
  z-index: 20;
}

/* When overlay is visible, allow clicks through to buttons but block iframe interaction */
#player-overlay.opacity-100 {
  cursor: default;
}

/* Fullscreen: make player container fill the screen */
#player-container:fullscreen {
  border-radius: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* In fullscreen, keep video at 16:9 centered (no cropping) */
#player-container:fullscreen #youtube-player,
#player-container:fullscreen #html-player {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: calc(100vh * 16 / 9);
  max-height: calc(100vw * 9 / 16);
  aspect-ratio: 16 / 9;
  border-radius: 0;
}

/* HTML5 player: match YouTube player styling */
#html-player {
  z-index: 1;
  background: #000;
  border-radius: 0.75rem;
}

/* In fullscreen: hide cursor when idle, show when overlay visible */
#player-container:fullscreen {
  cursor: none;
}

#player-container:fullscreen #iframe-shield {
  cursor: inherit;
}

#player-container:fullscreen.overlay-visible {
  cursor: default;
}

#player-container:fullscreen #player-overlay.opacity-100 {
  cursor: default;
}

/* Toast animation */
.toast-enter {
  animation: slide-up 0.3s ease-out;
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
