/* =============================================
   NEXUSWATCHPARTY — Dark Purple / Pink Theme
   (unified with NexusHost)
   ============================================= */

:root {
  --bg-deep:      #08000d;
  --bg-base:      #0e0016;
  --bg-card:      #160020;
  --bg-card2:     #1e002e;
  --purple-mid:   #2d0040;
  --purple-glow:  #6600aa;
  --neon-purple:  #aa00ff;
  --neon-pink:    #ff2d78;
  --pink-soft:    #ff6fa8;
  --text-primary: #f0d0ff;
  --text-muted:   #8a5fa0;
  --text-dim:     #4a2a60;
  --border:       rgba(170, 0, 255, 0.18);
  --border-pink:  rgba(255, 45, 120, 0.25);
  --glow-purple:  0 0 20px rgba(170,0,255,0.4);
  --glow-pink:    0 0 20px rgba(255,45,120,0.4);
  --radius:       12px;
  --radius-lg:    20px;
}

/* RESET & BASE */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: none;
  background: var(--bg-deep);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
}

/* =============================================
   CUSTOM CURSOR
   ============================================= */
.cursor-ring {
  position: fixed;
  width: 32px;
  height: 32px;
  border: 1.5px solid var(--neon-pink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width 0.2s, height 0.2s, border-color 0.2s, opacity 0.2s;
  mix-blend-mode: screen;
}
.cursor-ring.hovering {
  width: 48px;
  height: 48px;
  border-color: var(--neon-purple);
  box-shadow: var(--glow-purple);
}
.cursor-dot {
  position: fixed;
  width: 5px;
  height: 5px;
  background: var(--neon-pink);
  border-radius: 50%;
  pointer-events: none;
  z-index: 10000;
  transform: translate(-50%, -50%);
  box-shadow: var(--glow-pink);
}

/* =============================================
   DOT CANVAS BACKGROUND
   ============================================= */
#dotCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* =============================================
   TOPBAR
   ============================================= */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  background: rgba(8, 0, 13, 0.75);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  z-index: 200;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}
.logo-icon {
  font-size: 22px;
  color: var(--neon-purple);
  filter: drop-shadow(0 0 8px var(--neon-purple));
  animation: pulse-icon 3s ease-in-out infinite;
}
.logo-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-primary);
}
.logo-accent { color: var(--neon-purple); text-shadow: var(--glow-purple); }

@keyframes pulse-icon {
  0%, 100% { filter: drop-shadow(0 0 6px var(--neon-purple)); }
  50%       { filter: drop-shadow(0 0 18px var(--neon-purple)); }
}

.guest-badge {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  padding: 3px 10px;
  border: 1px solid var(--text-dim);
  border-radius: 20px;
  color: var(--text-muted);
}
.host-badge-top {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 3px 10px;
  border: 1px solid var(--neon-pink);
  border-radius: 20px;
  color: var(--neon-pink);
  box-shadow: var(--glow-pink);
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* MODUS-SELECTOR (Zusammen / Solo) */
.mode-selector {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px;
  gap: 2px;
}
.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 18px;
  cursor: none;
  transition: all 0.25s ease;
}
.mode-btn.active {
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
  color: #fff;
  box-shadow: var(--glow-purple);
}
.mode-btn:hover:not(.active) {
  color: var(--text-primary);
  background: rgba(170, 0, 255, 0.12);
}

/* =============================================
   MAIN LAYOUT
   ============================================= */
.layout {
  position: fixed;
  top: 56px;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  z-index: 10;
}

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  background: rgba(14, 0, 22, 0.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(.16,1,.3,1), width 0.3s;
  overflow: hidden;
}

.sidebar.closed {
  transform: translateX(-100%);
  position: absolute;
  height: 100%;
  z-index: 50;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.sidebar-close {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 12px;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, color 0.2s;
}
.sidebar-close:hover {
  border-color: var(--neon-pink);
  color: var(--neon-pink);
}

#movie-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 12px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--purple-mid) transparent;
}
#movie-list::-webkit-scrollbar { width: 3px; }
#movie-list::-webkit-scrollbar-thumb {
  background: var(--purple-mid);
  border-radius: 2px;
}

#movie-list li {
  padding: 12px 22px;
  cursor: none;
  border-bottom: 1px solid rgba(170,0,255,0.06);
  font-size: 13px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  transition: background 0.2s, color 0.2s, padding-left 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}
#movie-list li::before {
  content: '▶';
  font-size: 9px;
  color: var(--text-dim);
  transition: color 0.2s;
  flex-shrink: 0;
}
#movie-list li:hover {
  background: rgba(170,0,255,0.08);
  color: var(--text-primary);
  padding-left: 28px;
}
#movie-list li:hover::before {
  color: var(--neon-pink);
}
#movie-list li.active {
  background: rgba(170,0,255,0.12);
  color: var(--neon-purple);
  border-left: 2px solid var(--neon-purple);
  padding-left: 20px;
}
#movie-list li.active::before {
  color: var(--neon-purple);
}

/* Sidebar open button */
.sidebar-open-btn {
  position: absolute;
  top: 12px;
  left: 16px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(14, 0, 22, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 7px 16px 7px 12px;
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: none;
  transition: border-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.sidebar-open-btn:hover {
  border-color: var(--neon-purple);
  color: var(--neon-purple);
  box-shadow: var(--glow-purple);
}

/* =============================================
   MAIN CONTENT / VIDEO AREA
   ============================================= */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 24px;
  overflow: hidden;
}

.video-wrapper {
  width: 100%;
  max-width: 1100px;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 0 60px rgba(170,0,255,0.12), 0 24px 80px rgba(0,0,0,0.6);
}

/* VIDEO CONTAINER */
.video-container {
  position: relative;
  background: #000;
  width: 100%;
  aspect-ratio: 16/9;
}

video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

/* VIDEO PLACEHOLDER */
.video-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg-deep);
  z-index: 2;
  pointer-events: none;
}
.video-placeholder.hidden { display: none; }

.placeholder-icon {
  font-size: 48px;
  color: var(--neon-purple);
  filter: drop-shadow(0 0 16px var(--neon-purple));
  animation: pulse-icon 3s ease-in-out infinite;
}
.placeholder-text {
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.placeholder-sub {
  font-size: 12px;
  color: var(--text-dim);
}

/* =============================================
   CONTROLS BAR
   ============================================= */
.controls {
  background: rgba(14, 0, 22, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.controls-center {
  flex: 1;
  display: flex;
  align-items: center;
}
.controls-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.ctrl-btn {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: none;
  transition: border-color 0.2s, color 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}
.ctrl-btn:hover {
  border-color: var(--neon-purple);
  color: var(--neon-purple);
  box-shadow: var(--glow-purple);
}

.time-display {
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  white-space: nowrap;
  min-width: 80px;
}

/* SPEED CONTROL */
.speed-control-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
}
.control-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.speed-select {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  outline: none;
  cursor: none;
  transition: all 0.2s;
}
.speed-select:hover {
  border-color: var(--neon-purple);
  box-shadow: var(--glow-purple);
}

/* QUALITY MENU (YT-Style Popover) */
.quality-menu-container {
  position: relative;
}
.quality-popup {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 180px;
  padding: 8px 0;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), var(--glow-purple);
  display: flex;
  flex-direction: column;
  z-index: 100;
  animation: slideUp 0.2s ease-out;
}
.quality-popup-header {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-bottom: 1px solid rgba(170,0,255,0.1);
  margin-bottom: 4px;
}
.quality-option {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 16px;
  text-align: left;
  cursor: none;
  width: 100%;
  transition: all 0.2s;
}
.quality-option:hover {
  background: rgba(170, 0, 255, 0.1);
  color: var(--text-primary);
}
.quality-option.active {
  color: var(--neon-purple);
  border-left: 2px solid var(--neon-purple);
  padding-left: 14px;
}

/* PROGRESS BAR */
.progress-bar {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--purple-mid);
  border-radius: 2px;
  cursor: none;
  outline: none;
}
.progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--neon-purple);
  box-shadow: 0 0 8px var(--neon-purple);
  cursor: none;
}
.progress-bar::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--neon-purple);
  box-shadow: 0 0 8px var(--neon-purple);
  cursor: none;
  border: none;
}

/* VOLUME */
.volume-icon {
  font-size: 14px;
  opacity: 0.6;
}
.volume-bar {
  width: 80px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--purple-mid);
  border-radius: 2px;
  cursor: none;
  outline: none;
}
.volume-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--neon-pink);
  box-shadow: 0 0 6px var(--neon-pink);
  cursor: none;
}
.volume-bar::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--neon-pink);
  box-shadow: 0 0 6px var(--neon-pink);
  cursor: none;
  border: none;
}

/* =============================================
   LOGIN TRIGGER BUTTON (bottom left)
   ============================================= */
.login-trigger {
  position: fixed;
  bottom: 22px;
  left: 22px;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(14, 0, 22, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 8px 18px 8px 14px;
  color: var(--text-muted);
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  cursor: none;
  transition: border-color 0.25s, color 0.25s, box-shadow 0.25s;
}
.login-trigger:hover {
  border-color: var(--neon-purple);
  color: var(--neon-purple);
  box-shadow: var(--glow-purple);
}
.login-trigger.is-host {
  border-color: var(--neon-pink);
  color: var(--neon-pink);
  box-shadow: var(--glow-pink);
}
.login-trigger-icon { font-size: 14px; opacity: 0.7; }

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8,0,13,0.75);
  backdrop-filter: blur(8px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.hidden { display: none; }

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 44px 40px;
  width: 340px;
  position: relative;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), var(--glow-purple);
  animation: slideUp 0.25s cubic-bezier(.16,1,.3,1);
}
@keyframes slideUp {
  from { transform: translateY(24px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 16px; right: 18px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 15px;
  cursor: none;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--neon-pink); }

.modal-logo {
  font-size: 28px;
  color: var(--neon-purple);
  text-align: center;
  margin-bottom: 18px;
  filter: drop-shadow(0 0 12px var(--neon-purple));
}
.modal-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}
.modal-sub {
  font-size: 12px;
  color: var(--text-dim);
  text-align: center;
  margin-bottom: 28px;
}
.modal-field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.modal-label {
  font-family: 'Rajdhani', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--text-muted);
}
.modal-input {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  outline: none;
  width: 100%;
  letter-spacing: 0.1em;
  transition: border-color 0.2s, box-shadow 0.2s;
  cursor: none;
}
.modal-input:focus {
  border-color: var(--neon-purple);
  box-shadow: var(--glow-purple);
}
.modal-error {
  font-size: 12px;
  color: var(--neon-pink);
  font-family: 'Rajdhani', sans-serif;
  letter-spacing: 0.08em;
}
.modal-error.hidden { display: none; }
.modal-btn {
  width: 100%;
  padding: 13px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
  border: none;
  color: #fff;
  font-family: 'Rajdhani', sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  cursor: none;
  transition: opacity 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 24px rgba(170,0,255,0.4);
}
.modal-btn:hover {
  box-shadow: 0 4px 32px rgba(255,45,120,0.5);
}

/* =============================================
   TOAST
   ============================================= */
.toast {
  position: fixed;
  bottom: 70px;
  left: 22px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 20px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-primary);
  box-shadow: var(--glow-purple);
  z-index: 999;
  animation: toastIn 0.3s cubic-bezier(.16,1,.3,1);
  max-width: 280px;
}
.toast.hidden { display: none; }
.toast.success { border-color: var(--neon-purple); color: var(--neon-purple); }
.toast.error   { border-color: var(--neon-pink);   color: var(--neon-pink);   }
@keyframes toastIn {
  from { transform: translateY(14px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* =============================================
   UTILITIES
   ============================================= */
.hidden { display: none !important; }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
  .sidebar {
    position: absolute;
    height: 100%;
    z-index: 50;
  }
  .main-content {
    padding: 12px;
  }
  .video-wrapper {
    border-radius: var(--radius);
  }
  .controls {
    padding: 10px 12px;
    gap: 8px;
  }
  .volume-bar { width: 60px; }
}