/* ═══════════════════════════════════════════════════════════════
   AffenKino – Premium Dark Mode Stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ─── Google Font ─────────────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ─── CSS Variables ───────────────────────────────────────────── */
:root {
  /* Core Colors */
  --bg-primary: #060a14;
  --bg-secondary: #0c1220;
  --bg-tertiary: #111827;
  --bg-card: rgba(17, 24, 39, 0.6);
  --bg-glass: rgba(17, 24, 39, 0.45);

  /* Accent Colors */
  --accent-primary: #7c3aed;
  --accent-primary-light: #a78bfa;
  --accent-secondary: #06b6d4;
  --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #06b6d4 100%);
  --accent-gradient-hover: linear-gradient(135deg, #8b5cf6 0%, #22d3ee 100%);

  /* Text */
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Borders */
  --border-subtle: rgba(148, 163, 184, 0.08);
  --border-glass: rgba(148, 163, 184, 0.12);
  --border-accent: rgba(124, 58, 237, 0.3);

  /* Effects */
  --glass-blur: blur(20px);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 24px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 48px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 30px rgba(124, 58, 237, 0.15);

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset & Base ────────────────────────────────────────────── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ─── Animated Background ──────────────────────────────────────── */
.bg-animation {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.bg-animation .orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: orbFloat 20s ease-in-out infinite;
}

.bg-animation .orb:nth-child(1) {
  width: 600px;
  height: 600px;
  background: var(--accent-primary);
  top: -200px;
  left: -100px;
  animation-delay: 0s;
}

.bg-animation .orb:nth-child(2) {
  width: 500px;
  height: 500px;
  background: var(--accent-secondary);
  bottom: -150px;
  right: -100px;
  animation-delay: -7s;
}

.bg-animation .orb:nth-child(3) {
  width: 350px;
  height: 350px;
  background: #ec4899;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, -80px) scale(1.1); }
  50% { transform: translate(-30px, 60px) scale(0.95); }
  75% { transform: translate(70px, 40px) scale(1.05); }
}

/* ─── Landing Page ─────────────────────────────────────────────── */
#landing-page {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.landing-container {
  text-align: center;
  max-width: 520px;
  width: 100%;
}

.logo {
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.logo-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-glow);
  animation: logoPulse 3s ease-in-out infinite;
  display: block;
  object-fit: cover;
}

@keyframes logoPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(124, 58, 237, 0.15); }
  50% { box-shadow: 0 0 40px rgba(124, 58, 237, 0.3); }
}

.logo h1 {
  font-size: 2rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.02em;
}

.landing-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 2.5rem;
  font-weight: 400;
  line-height: 1.7;
}

.landing-card {
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.02em;
}

.input-field {
  width: 100%;
  padding: 0.85rem 1.15rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition-normal), box-shadow var(--transition-normal);
}

.input-field::placeholder {
  color: var(--text-muted);
}

.input-field:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.btn-group {
  display: flex;
  gap: 0.75rem;
}

.btn {
  flex: 1;
  padding: 0.85rem 1.5rem;
  border: none;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  outline: none;
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: var(--shadow-sm), 0 0 20px rgba(124, 58, 237, 0.15);
}

.btn-primary:hover {
  background: var(--accent-gradient-hover);
  box-shadow: var(--shadow-md), 0 0 30px rgba(124, 58, 237, 0.25);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: rgba(17, 24, 39, 0.9);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.divider {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1.5rem 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.room-code-input {
  display: flex;
  gap: 0.75rem;
}

.room-code-input .input-field {
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  text-align: center;
}

/* ─── Watch Page ───────────────────────────────────────────────── */
#watch-page {
  display: none;
  position: relative;
  z-index: 1;
  height: 100vh;
  padding: 0;
}

#watch-page.active {
  display: flex;
  flex-direction: column;
}

/* Top Bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.top-bar .logo-small {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.top-bar .logo-icon-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: block;
  object-fit: cover;
}

.top-bar .logo-text {
  font-size: 1rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.room-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.room-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-primary-light);
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.room-badge .copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 2px;
  transition: color var(--transition-fast);
  display: flex;
}

.room-badge .copy-btn:hover {
  color: var(--accent-secondary);
}

.user-count {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.user-count .dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-glass);
}

.btn-leave {
  padding: 0.45rem 1rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: #f87171;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-leave:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.4);
}

/* Main Content Area */
.watch-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Player Section */
.player-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.player-wrapper {
  position: relative;
  width: 100%;
  flex: 1;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.player-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.player-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  color: var(--text-muted);
  text-align: center;
  padding: 2rem;
}

.player-empty-icon {
  font-size: 4rem;
  opacity: 0.3;
}

.player-empty h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.player-empty p {
  font-size: 0.9rem;
  max-width: 340px;
}

.custom-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1.5rem;
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-subtle);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.volume-icon {
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, opacity 0.2s ease;
  cursor: pointer;
  user-select: none;
}

.volume-icon:hover {
  opacity: 0.75;
}

.volume-icon.muted {
  color: #ef4444;
}

/* ─── Unmute Overlay (für Browser-Autoplay-Fallback) ──────────── */
.unmute-overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  border: none;
  z-index: 5;
  animation: unmute-fade-in 0.25s ease;
  font-family: inherit;
}

.unmute-overlay.active {
  display: flex;
}

.unmute-overlay i {
  font-size: 3rem;
  color: #f59e0b;
  filter: drop-shadow(0 4px 12px rgba(245, 158, 11, 0.4));
}

.unmute-overlay span {
  padding: 0.5rem 1.25rem;
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-full);
}

.unmute-overlay:hover span {
  background: rgba(245, 158, 11, 0.3);
  border-color: rgba(245, 158, 11, 0.6);
}

@keyframes unmute-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ─── Volume Toast (Pfeiltasten-Feedback) ─────────────────────── */
.volume-toast {
  position: absolute;
  top: 1rem;
  left: 50%;
  transform: translate(-50%, -8px);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 6;
}

.volume-toast.active {
  opacity: 1;
  transform: translate(-50%, 0);
}

.volume-toast i {
  font-size: 1rem;
  color: #f59e0b;
}

.volume-toast.muted i {
  color: #ef4444;
}

.volume-toast-bar {
  width: 90px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.volume-toast-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
  border-radius: 2px;
  transition: width 0.15s ease;
}

.volume-toast.muted .volume-toast-fill {
  background: #ef4444;
}

.volume-toast-percent {
  min-width: 38px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.volume-slider {
  flex: 1;
  max-width: 250px;
  -webkit-appearance: none;
  background: transparent;
  width: 100%;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--text-primary);
  cursor: pointer;
  margin-top: -6px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.volume-slider::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
}

/* Firefox */
.volume-slider::-moz-range-thumb {
  height: 16px;
  width: 16px;
  border-radius: 50%;
  background: var(--text-primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.3);
}

.volume-slider::-moz-range-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  background: var(--bg-primary);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.sync-status.playing {
  color: white;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.3);
}

.sync-status.playing .status-dot {
  background-color: #22c55e;
  box-shadow: 0 0 8px #22c55e;
}

.sync-status.paused {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}

.sync-status.paused .status-dot {
  background-color: #f59e0b;
}

.sync-status.error {
  color: white;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.sync-status.error .status-dot {
  background-color: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-secondary);
  transition: all 0.3s ease;
}

/* ─── Sidebar ──────────────────────────────────────────────────── */
.sidebar {
  width: 380px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-left: 1px solid var(--border-subtle);
  overflow: hidden;
}

/* Sidebar Tabs */
.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.sidebar-tab {
  flex: 1;
  padding: 0.85rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.sidebar-tab:hover {
  color: var(--text-secondary);
  background: rgba(124, 58, 237, 0.05);
}

.sidebar-tab.active {
  color: var(--accent-primary-light);
}

.sidebar-tab.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 1rem;
  right: 1rem;
  height: 2px;
  background: var(--accent-gradient);
  border-radius: 2px;
}

.tab-badge {
  background: var(--accent-primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Tab Content */
.sidebar-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tab-panel {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.tab-panel.active {
  display: flex;
}

/* ─── Playlist Panel ───────────────────────────────────────────── */
.playlist-add {
  padding: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  flex-shrink: 0;
}

.playlist-add-form {
  display: flex;
  gap: 0.5rem;
}

.playlist-add-form .input-field {
  flex: 1;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
}

.btn-add {
  padding: 0.7rem 1rem;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-md);
  color: white;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
}

.btn-add:hover {
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.playlist-items {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.playlist-items::-webkit-scrollbar {
  width: 4px;
}

.playlist-items::-webkit-scrollbar-track {
  background: transparent;
}

.playlist-items::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 4px;
}

.playlist-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  color: var(--text-muted);
  text-align: center;
  gap: 0.75rem;
}

.playlist-empty-icon {
  font-size: 2.5rem;
  opacity: 0.3;
}

.playlist-empty p {
  font-size: 0.85rem;
  line-height: 1.5;
}

/* Playlist Item */
.playlist-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.playlist-item:hover {
  background: rgba(124, 58, 237, 0.06);
}

.playlist-item.active {
  background: rgba(124, 58, 237, 0.1);
  border: 1px solid var(--border-accent);
}

.playlist-item.drag-over {
  background: rgba(124, 58, 237, 0.18);
  border: 1px dashed var(--accent-primary);
}

.playlist-item.dragging {
  opacity: 0.4;
}

.playlist-item-drag-handle {
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 0 4px;
  cursor: grab;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.playlist-item:hover .playlist-item-drag-handle {
  opacity: 1;
}

/* Playlist-Quelle: aus importierter Playlist */
.playlist-item.from-playlist {
  border-left: 2px solid rgba(249, 115, 22, 0.55);
}

.playlist-item.from-playlist .playlist-item-source {
  display: inline-flex;
}

.playlist-item-source {
  display: none;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.68rem;
  color: #f97316;
  opacity: 0.85;
}

.playlist-item.active .playlist-item-index {
  color: var(--accent-primary-light);
}

.playlist-item-index {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.playlist-item-playing {
  display: none;
}

.playlist-item.active .playlist-item-index span {
  display: none;
}

.playlist-item.active .playlist-item-playing {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.playing-bars {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 12px;
}

.playing-bars span {
  width: 2px;
  background: var(--accent-primary-light);
  border-radius: 1px;
  animation: playingBar 1s ease-in-out infinite;
}

.playing-bars span:nth-child(1) { height: 4px; animation-delay: 0s; }
.playing-bars span:nth-child(2) { height: 8px; animation-delay: 0.15s; }
.playing-bars span:nth-child(3) { height: 5px; animation-delay: 0.3s; }

@keyframes playingBar {
  0%, 100% { height: 4px; }
  50% { height: 12px; }
}

.playlist-item-thumb {
  width: 72px;
  height: 40px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-secondary);
}

.playlist-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.playlist-item-info {
  flex: 1;
  min-width: 0;
}

.playlist-item-title {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

.playlist-item-added {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.playlist-item-remove {
  opacity: 0;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
  border-radius: 4px;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.playlist-item:hover .playlist-item-remove {
  opacity: 1;
}

.playlist-item-remove:hover {
  color: #f87171;
  background: rgba(239, 68, 68, 0.1);
}

/* ─── Users Panel ──────────────────────────────────────────────── */
.users-list {
  padding: 0.75rem;
  overflow-y: auto;
  flex: 1;
}

.user-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
}

.user-item:hover {
  background: rgba(124, 58, 237, 0.05);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-details {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}


.you-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--accent-secondary);
  opacity: 0.8;
}

.user-status {
  font-size: 0.75rem;
  color: #22c55e;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* ─── Toast Notifications ──────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  color: var(--text-primary);
  font-size: 0.85rem;
  box-shadow: var(--shadow-lg);
  animation: toastIn 300ms ease-out;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toast.toast-out {
  animation: toastOut 300ms ease-in forwards;
}

.toast.success { border-left: 3px solid #22c55e; }
.toast.error { border-left: 3px solid #ef4444; }
.toast.info { border-left: 3px solid var(--accent-secondary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(100px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(100px); }
}

/* ─── Modal ────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center;
  animation: fadeIn 200ms ease-out;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: modalIn 300ms ease-out;
}

.modal h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.modal p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ─── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    width: 320px;
  }
}

@media (max-width: 768px) {
  .watch-content {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: 45vh;
    border-left: none;
    border-top: 1px solid var(--border-subtle);
  }

  .player-wrapper {
    aspect-ratio: 16 / 9;
    flex: none;
  }
}

/* ─── Utility ──────────────────────────────────────────────────── */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── Version Badge ────────────────────────────────────────────── */
.app-version {
  position: fixed;
  bottom: 0.5rem;
  right: 0.65rem;
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
  z-index: 90;
}
