/*
 * KiwiTube Hub - Premium Design System
 * Modern Glassmorphism with Depth & Elegance
 */

/* ========================================
   CSS VARIABLES - Premium Design Tokens
   ======================================== */
:root {
  /* Background Colors - Rich Dark Palette */
  --bg-base: #050505;
  --bg-primary: #0a0a0a;
  --bg-secondary: #121212;
  --bg-tertiary: #1a1a1a;
  --bg-card: rgba(24, 24, 28, 0.7);
  --bg-glass: rgba(30, 30, 35, 0.6);
  --bg-glass-hover: rgba(40, 40, 48, 0.8);
  --bg-elevated: rgba(35, 35, 42, 0.9);
  
  /* Accent - Vibrant Emerald */
  --accent: #1DB954;
  --accent-light: #1ed760;
  --accent-dark: #169c45;
  --accent-glow: rgba(29, 185, 84, 0.5);
  --accent-gradient: linear-gradient(135deg, #1DB954 0%, #1ed760 50%, #1DB954 100%);
  --accent-soft: rgba(29, 185, 84, 0.15);
  
  /* Secondary Accents */
  --info: #3b82f6;
  --info-glow: rgba(59, 130, 246, 0.4);
  --warning: #f59e0b;
  --danger: #ef4444;
  --danger-glow: rgba(239, 68, 68, 0.4);
  
  /* Text Colors */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --text-tertiary: rgba(255, 255, 255, 0.5);
  --text-muted: rgba(255, 255, 255, 0.35);
  --text-inverse: #000000;
  
  /* Gradients */
  --gradient-bg: radial-gradient(ellipse at 50% 0%, rgba(29, 185, 84, 0.08) 0%, transparent 50%),
                 linear-gradient(180deg, #0f0f13 0%, #050505 100%);
  --gradient-card: linear-gradient(145deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%);
  --gradient-shine: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  
  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(29, 185, 84, 0.2);
  --shadow-accent: 0 4px 20px rgba(29, 185, 84, 0.3);
  
  /* Glass Effects */
  --blur-sm: blur(8px);
  --blur-md: blur(16px);
  --blur-lg: blur(24px);
  --blur-glass: blur(20px) saturate(180%);
  
  /* Border Radius */
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;
  
  /* Spacing Scale */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Prevent layout shift */
img, svg {
  display: block;
  max-width: 100%;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Selection */
::selection {
  background: var(--accent);
  color: var(--text-inverse);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-gradient {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.glass {
  background: var(--bg-glass);
  backdrop-filter: var(--blur-glass);
  -webkit-backdrop-filter: var(--blur-glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-strong {
  background: var(--bg-elevated);
  backdrop-filter: var(--blur-lg);
  -webkit-backdrop-filter: var(--blur-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========================================
   BUTTONS - Premium Styles
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--gradient-shine);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn-primary {
  background: var(--accent-gradient);
  color: var(--text-inverse);
  box-shadow: var(--shadow-accent);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(29, 185, 84, 0.4);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.15);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: scale(1.05);
}

.btn-icon:active {
  transform: scale(0.95);
}

/* ========================================
   INPUTS - Modern Style
   ======================================== */
input[type="text"],
input[type="password"],
input[type="search"] {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

input::placeholder {
  color: var(--text-muted);
}

input:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(29, 185, 84, 0.15);
}

/* ========================================
   AUTH PAGES - Login/Register
   ======================================== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-bg);
  position: relative;
  overflow: hidden;
}

.auth-page::before {
  content: '';
  position: fixed;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(29, 185, 84, 0.12) 0%, transparent 70%);
  top: -200px;
  right: -200px;
  animation: float 12s ease-in-out infinite;
  will-change: transform;
}

.auth-page::after {
  content: '';
  position: fixed;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
  bottom: -100px;
  left: -100px;
  animation: float 15s ease-in-out infinite reverse;
  will-change: transform;
}

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(15px, -15px, 0) scale(1.05); }
}

.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  border-radius: var(--radius-xl);
  background: var(--bg-card);
  backdrop-filter: var(--blur-glass);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}

.auth-logo {
  text-align: center;
  margin-bottom: 2rem;
}

.kiwi-logo {
  font-size: 4rem;
  margin-bottom: 0.5rem;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(29, 185, 84, 0.3));
}

.auth-logo h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.03em;
}

.auth-tagline {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  padding: 0.75rem;
  background: rgba(239, 68, 68, 0.1);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--danger);
}

.auth-links {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--text-tertiary);
  font-size: 0.9rem;
}

.auth-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* ========================================
   DASHBOARD - Premium Layout
   ======================================== */
.dashboard-page {
  min-height: 100vh;
  background: var(--bg-primary);
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: var(--blur-glass);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 100;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.02em;
}

.logo-icon {
  font-size: 1.5rem;
  margin-right: 0.5rem;
  filter: drop-shadow(0 0 8px rgba(29, 185, 84, 0.3));
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.375rem 0.75rem 0.375rem 0.375rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-menu:hover {
  background: rgba(255, 255, 255, 0.08);
}

.dashboard-main {
  padding: calc(72px + 2rem) 2rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
}

/* Room Cards - Premium Grid */
.rooms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.room-card {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: all var(--transition-normal);
  overflow: hidden;
}

.room-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
  transform: scaleX(0);
  transition: transform 0.4s ease;
}

.room-card:hover {
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg), 0 20px 40px rgba(0, 0, 0, 0.3);
}

.room-card:hover::before {
  transform: scaleX(1);
}

.room-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.room-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.room-card-meta {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.room-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.625rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-full);
  color: var(--text-tertiary);
}

.room-card-badge.public {
  background: rgba(29, 185, 84, 0.15);
  color: var(--accent);
}

.room-card-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

/* ========================================
   ROOM PAGE - Premium Layout
   ======================================== */
.room-page {
  height: 100vh;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.room-header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: var(--blur-glass);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  z-index: 10;
}

.room-header-left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: translateX(-2px);
}

.room-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.room-header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.875rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.user-pill svg {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

/* Room Layout Grid */
.room-container {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  height: calc(100vh - 64px);
  overflow: hidden;
}

.room-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(29, 185, 84, 0.03) 0%, transparent 30%);
  min-height: 0;
}

/* Player Section */
.player-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.player-visualizer {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  padding: 1.5rem 1rem;
  height: 160px;
  position: relative;
}

.player-visualizer::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(29, 185, 84, 0.12) 0%, transparent 70%);
  animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: translate3d(-50%, -50%, 0) scale(1); opacity: 0.4; }
  50% { transform: translate3d(-50%, -50%, 0) scale(1.1); opacity: 0.6; }
}

.visualizer-bar {
  width: 5px;
  background: var(--accent-gradient);
  border-radius: 3px;
  animation: visualizer-dance 2.5s ease-in-out infinite alternate;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 10px var(--accent-glow);
  will-change: height;
  transform: translateZ(0);
}

.visualizer-bar:nth-child(odd) {
  animation-duration: 2s;
  opacity: 0.85;
}

.visualizer-bar:nth-child(3n) {
  animation-duration: 3s;
  opacity: 0.7;
}

@keyframes visualizer-dance {
  0% { height: 8px; }
  100% { height: var(--bar-height, 80px); }
}

/* Player Controls Area */
.player-controls-area {
  flex: 0 0 auto;
  padding: 1.5rem;
  background: var(--bg-card);
  backdrop-filter: var(--blur-glass);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 1rem;
}

.track-info {
  text-align: center;
  margin-bottom: 1.5rem;
}

.track-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 0.85rem;
  color: var(--text-tertiary);
}

/* Control Buttons */
.controls-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
}

.control-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: scale(1.05);
}

.control-btn.play-btn {
  width: 64px;
  height: 64px;
  background: var(--accent-gradient);
  color: var(--text-inverse);
  box-shadow: var(--shadow-accent);
}

.control-btn.play-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(29, 185, 84, 0.5);
}

.control-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* Progress Bar */
.progress-container {
  margin-bottom: 0.75rem;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  position: relative;
  transition: width 0.1s linear;
}

.progress-fill::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.2s;
}

.progress-bar:hover .progress-fill::after {
  opacity: 1;
}

.time-display {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* Extras Row */
.controls-extras {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.volume-slider {
  width: 100px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: white;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s;
}

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

.mode-buttons {
  display: flex;
  gap: 0.5rem;
}

.mode-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-tertiary);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mode-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
}

.mode-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Playlist Section */
.playlist-section {
  flex: 0 0 260px;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  min-height: 0;
}

.playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.playlist-header h3 {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.playlist-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.playlist-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.playlist-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.playlist-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.playlist-item.active {
  background: rgba(29, 185, 84, 0.12);
}

.playlist-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
}

.pl-number {
  width: 24px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.playlist-item.active .pl-number {
  color: var(--accent);
}

.pl-info {
  flex: 1;
  min-width: 0;
}

.pl-title {
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.125rem;
}

.pl-duration {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.pl-remove {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-muted);
  border: none;
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition-fast);
}

.playlist-item:hover .pl-remove {
  opacity: 1;
}

.pl-remove:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

/* Playlist Action Buttons */
.pl-actions {
  display: flex;
  gap: 0.25rem;
}

.pl-action-btn {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.pl-action-btn:hover {
  background: var(--accent-soft);
  color: var(--accent);
}

/* Drag & Drop Styles */
.sortable-ghost {
  opacity: 0.3;
  background: var(--accent-soft);
}

.sortable-drag {
  opacity: 0.9;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
}

/* Keyboard Shortcuts Help */
.shortcuts-help {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  padding: 0.5rem 1rem;
  background: var(--bg-card);
  backdrop-filter: var(--blur-glass);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.room-page:hover .shortcuts-help {
  opacity: 1;
}

/* Search Box */
.search-container {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.search-box {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 0.75rem 2.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.search-clear {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
}

/* Search Results & Preview */
#search-results {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  max-height: 350px;
  overflow-y: auto;
  background: var(--bg-elevated);
  backdrop-filter: var(--blur-glass);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.search-preview {
  padding: 1rem;
}

.search-preview-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.search-preview-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.search-preview-actions .btn {
  flex: 1;
}

.search-item {
  display: flex;
  gap: 0.875rem;
  padding: 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.search-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.search-thumb {
  width: 120px;
  height: 68px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--bg-tertiary);
}

.search-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.search-title {
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

.search-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.search-add-btn {
  padding: 0.375rem 0.875rem;
  font-size: 0.8rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.search-add-btn:hover {
  background: var(--accent-light);
}

/* Search Loading */
.search-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.search-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ========================================
   SIDEBAR - Chat & Friends
   ======================================== */
.room-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--bg-secondary);
  border-left: 1px solid rgba(255, 255, 255, 0.05);
  height: 100%;
  overflow: hidden;
}

.sidebar-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-tab {
  flex: 1;
  padding: 0.875rem;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.sidebar-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}

.sidebar-tab:hover {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.02);
}

.sidebar-tab.active {
  color: var(--accent);
}

.sidebar-tab.active::after {
  width: 40%;
}

.sidebar-content {
  flex: 1;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-content.active {
  display: flex;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-message {
  display: flex;
  gap: 0.75rem;
  animation: messageIn 0.3s ease;
}

@keyframes messageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.message-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.message-content {
  flex: 1;
  min-width: 0;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.message-author {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.message-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.message-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary);
  word-wrap: break-word;
}

.message-system {
  text-align: center;
  padding: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Chat Input */
.chat-input-container {
  padding: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.chat-input-wrapper {
  display: flex;
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  padding: 0.625rem 1rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-size: 0.875rem;
}

.chat-input:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.15);
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: white;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chat-send-btn:hover {
  background: var(--accent-light);
  transform: scale(1.05);
}

/* Friends Panel */
.friends-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.friends-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.add-friend-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.add-friend-btn:hover {
  background: var(--accent);
  color: white;
}

.friends-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
}

.friend-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.friend-item:hover {
  background: rgba(255, 255, 255, 0.04);
}

.friend-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
  position: relative;
}

.friend-avatar.online::after {
  content: '';
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border: 2px solid var(--bg-secondary);
  border-radius: 50%;
}

.friend-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.friend-info {
  flex: 1;
  min-width: 0;
}

.friend-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.friend-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.invite-btn {
  padding: 0.375rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(29, 185, 84, 0.3);
  border-radius: var(--radius-full);
  cursor: pointer;
  opacity: 0;
  transition: all var(--transition-fast);
}

.friend-item:hover .invite-btn {
  opacity: 1;
}

.invite-btn:hover {
  background: var(--accent);
  color: white;
}

/* Users in Room */
.users-section {
  padding: 0.875rem 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  max-height: 120px;
  overflow-y: auto;
}

.users-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.625rem;
}

.users-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem 0.25rem 0.25rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
}

.user-chip-avatar {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 600;
}

.user-chip-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.user-chip-name {
  color: var(--text-secondary);
}

.user-chip-owner {
  color: var(--accent);
  font-weight: 600;
}

/* ========================================
   MODALS & OVERLAYS
   ======================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: var(--blur-md);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

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

.modal-card {
  width: 90%;
  max-width: 400px;
  padding: 2rem;
  background: var(--bg-card);
  backdrop-filter: var(--blur-glass);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  text-align: center;
}

.modal-text {
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
}

.modal-actions .btn {
  flex: 1;
}

/* Tap to Join - Premium Modal */
.tap-modal {
  background: radial-gradient(circle at center, rgba(29, 185, 84, 0.08) 0%, rgba(0, 0, 0, 0.95) 70%);
}

.tap-card {
  text-align: center;
  max-width: 400px;
  padding: 3rem 2.5rem;
  background: var(--bg-card);
  backdrop-filter: var(--blur-glass);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-lg), 0 0 80px rgba(29, 185, 84, 0.1);
}

.tap-card h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tap-card p {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.tap-card .tap-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.tap-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  animation: pulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(29, 185, 84, 0.3));
}

.tap-btn {
  width: 100%;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  background: var(--accent-gradient);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tap-btn:hover {
  box-shadow: 0 8px 30px rgba(29, 185, 84, 0.5);
  transform: scale(1.02);
}

.tap-btn:active {
  transform: scale(0.98);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.05); opacity: 1; }
}

/* Toast */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.875rem 1.5rem;
  background: var(--bg-elevated);
  backdrop-filter: var(--blur-glass);
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  animation: toastIn 0.3s ease;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.toast.success {
  background: rgba(29, 185, 84, 0.2);
  border-color: rgba(29, 185, 84, 0.3);
}

.toast.error {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.3);
}

/* ========================================
   MINI PLAYER
   ======================================== */
.mini-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(18, 18, 22, 0.95);
  backdrop-filter: var(--blur-glass);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  gap: 1rem;
  z-index: 50;
}

.mini-progress {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(255, 255, 255, 0.1);
}

.mini-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s linear;
}

.mini-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.mini-title {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.125rem;
}

.mini-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.mini-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mini-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.mini-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.mini-btn.play {
  background: var(--accent);
  color: white;
}

.mini-btn.play:hover {
  background: var(--accent-light);
  transform: scale(1.05);
}

/* ========================================
   EMPTY STATES
   ======================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  text-align: center;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-text {
  font-size: 0.9rem;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media only screen and (max-width: 1024px) {
  .room-container {
    grid-template-columns: 1fr 320px;
  }
}

@media only screen and (max-width: 900px) {
  .room-container {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  
  .room-sidebar {
    border-left: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    height: 280px;
  }
  
  .rooms-grid {
    grid-template-columns: 1fr;
  }
}

@media only screen and (max-width: 768px) {
  .top-bar {
    padding: 0 1rem;
  }
  
  .dashboard-main {
    padding: calc(72px + 1rem) 1rem 1rem;
  }
  
  .room-header {
    padding: 0 1rem;
  }
  
  .player-section {
    padding: 1rem;
  }
  
  .control-btn.play-btn {
    width: 56px;
    height: 56px;
  }
  
  .auth-card {
    margin: 1rem;
    padding: 1.5rem;
  }
}

/* Mobile Navigation */
@media only screen and (orientation: portrait) and (max-width: 768px) {
  .mobile-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: var(--blur-glass);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  
  .mobile-nav-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 0.625rem;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.65rem;
    font-weight: 600;
  }
  
  .mobile-nav-btn.active {
    color: var(--accent);
  }
  
  .mobile-nav-btn svg {
    width: 22px;
    height: 22px;
  }
  
  body.has-mobile-nav {
    padding-bottom: 64px;
  }
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.animate-shimmer {
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* Loading States */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
