/* Client Page Layout */
html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #000;
}

#client-app {
  width: 100vw;
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #111827 0%, #000000 100%);
}

/* Floating Top Bar (Minimal, non-intrusive) */
.client-top-bar {
  position: absolute;
  top: 16px;
  left: 20px;
  right: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 100;
  pointer-events: none; /* Let clicks fall through except on specific buttons */
}

.top-bar-left, .top-bar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
}

.user-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 22, 31, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(12px);
  font-size: 0.85rem;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-badge:hover {
  background: rgba(28, 35, 49, 0.9);
  border-color: var(--accent-primary);
}

.user-avatar-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  color: #fff;
}

/* Local Volume Controller */
.volume-control {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(18, 22, 31, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
}

.volume-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.volume-btn:hover {
  color: #fff;
}

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

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  transition: transform 0.1s;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

/* Video Stage Container */
.player-container {
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

/* Player Shield Overlay: COMPLETELY DISABLES INTERACTIONS WITH VIDEO */
.player-shield {
  position: absolute;
  inset: 0;
  z-index: 50;
  background: transparent;
  pointer-events: auto !important;
  user-select: none;
  -webkit-user-select: none;
  cursor: default;
}

/* Video elements */
.video-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
}

.video-wrapper.hidden {
  display: none !important;
}

#html5-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none !important;
  user-select: none;
  background: #000;
}

#youtube-player-container {
  width: 100%;
  height: 100%;
  pointer-events: none !important;
  user-select: none;
}

#youtube-player-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none !important;
}

/* Empty State / Waiting Screen */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
  z-index: 10;
  max-width: 500px;
}

.empty-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin-bottom: 24px;
  box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
  animation: pulseGlow 2.5s infinite;
}

.empty-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: #fff;
}

.empty-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Join Modal Styling */
.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.modal-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Audio Autoplay Unblocker Banner (if browser blocked sound) */
.audio-unmute-prompt {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: rgba(30, 58, 138, 0.9);
  border: 1px solid var(--accent-primary);
  backdrop-filter: blur(12px);
  padding: 10px 20px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  animation: slideUp 0.3s ease-out;
}

.audio-unmute-prompt:hover {
  background: var(--accent-primary);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-100%); }
  to { opacity: 1; transform: translateY(0); }
}

/* Subtitle Overlay Styles */
.subtitle-overlay {
  position: absolute;
  bottom: 52px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 85%;
  text-align: center;
  z-index: 55;
  pointer-events: none;
  user-select: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: bottom 0.2s ease;
}

.subtitle-cue {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  font-size: var(--sub-font-size, 1.5rem);
  font-weight: 600;
  line-height: 1.45;
  border-radius: var(--radius-sm);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.95), 0 0 2px #000;
  white-space: pre-wrap;
  backdrop-filter: blur(4px);
  max-width: 100%;
}

.subtitle-cue.hidden {
  display: none !important;
}

/* Client Subtitle Toggle in Top Bar */
.subtitle-client-control {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(18, 22, 31, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow-sm);
  font-size: 0.85rem;
}

.sub-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
  user-select: none;
}

.sub-btn:hover {
  color: #fff;
}

.sub-btn.active {
  color: var(--accent-primary);
  font-weight: 600;
}

.sub-font-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.sub-font-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

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

