/* ==========================================================================
   SoundWave - YouTube Music Web Client Design System
   Sleek Dark Glassmorphism & Neon Aesthetics
   ========================================================================== */

:root {
  --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', sans-serif;

  /* Color Palette */
  --bg-base: #0a0c12;
  --bg-surface: #111420;
  --bg-surface-elevated: #181c2c;
  --bg-glass: rgba(18, 22, 36, 0.72);
  --bg-glass-card: rgba(26, 32, 52, 0.5);
  --bg-glass-hover: rgba(255, 255, 255, 0.08);

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(239, 44, 90, 0.5);

  --text-primary: #ffffff;
  --text-secondary: #9aa2b8;
  --text-muted: #5e667e;

  /* Neon Accents */
  --accent-red: #ff2d55;
  --accent-pink: #f43f5e;
  --accent-purple: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #ff2d55 0%, #ec4899 50%, #8b5cf6 100%);
  --accent-gradient-glow: 0 0 24px rgba(255, 45, 85, 0.45);

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* Layout dimensions */
  --sidebar-width: 260px;
  --player-height: 90px;
  --header-height: 72px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-base);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Glow Blobs */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  transition: opacity 1s ease;
}
.glow-1 {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, #ff2d55, transparent 70%);
  top: -100px;
  left: 20%;
}
.glow-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #7c3aed, transparent 70%);
  bottom: 0px;
  right: 15%;
}

/* App Container Layout */
.app-container {
  position: relative;
  display: flex;
  height: 100vh;
  width: 100vw;
  z-index: 1;
}

/* ==========================================================================
   SIDEBAR
   ========================================================================== */
.sidebar {
  width: var(--sidebar-width);
  height: calc(100vh - var(--player-height));
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  flex-shrink: 0;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: var(--accent-gradient-glow);
}
.brand-icon svg {
  width: 22px;
  height: 22px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #ffffff 0%, #d8b4fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 20px;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  padding: 16px 12px 6px 12px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  width: 100%;
}
.nav-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}
.nav-link:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}
.nav-link:hover svg {
  transform: scale(1.1);
}
.nav-link.active {
  background: linear-gradient(90deg, rgba(255, 45, 85, 0.15), rgba(139, 92, 246, 0.1));
  color: #fff;
  border-left: 3px solid var(--accent-red);
  font-weight: 600;
}
.nav-link.active svg {
  color: var(--accent-red);
}
.nav-link .badge {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.auth-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.auth-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}
.user-avatar svg {
  width: 18px;
  height: 18px;
}
.auth-details {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.auth-username {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.auth-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ==========================================================================
   MAIN WRAPPER & HEADER
   ========================================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--player-height));
  overflow: hidden;
  background: transparent;
}

.app-header {
  height: var(--header-height);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(10, 12, 18, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 5;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  max-width: 600px;
}

.search-bar-container {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 8px 18px;
  transition: all var(--transition-normal);
}
.search-bar-container:focus-within {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-focus);
  box-shadow: 0 0 16px rgba(255, 45, 85, 0.2);
}

.search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  margin-right: 10px;
}

#global-search-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: inherit;
}
#global-search-input::placeholder {
  color: var(--text-muted);
}

.search-clear-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
  font-size: 0.8rem;
}
.search-clear-btn:hover {
  color: var(--text-primary);
}

.search-kbd {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  margin-left: 8px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ==========================================================================
   BUTTONS & COMMON UI
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}
.btn svg {
  width: 18px;
  height: 18px;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 45, 85, 0.35);
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(255, 45, 85, 0.5);
  filter: brightness(1.08);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  backdrop-filter: blur(10px);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.btn-outline:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

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

.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.8rem;
}
.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.btn-icon svg {
  width: 20px;
  height: 20px;
}
.btn-icon:hover {
  background: var(--bg-glass-hover);
  color: var(--text-primary);
}

/* ==========================================================================
   CONTENT VIEWS & SCROLL AREA
   ========================================================================== */
.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  position: relative;
}

.view-panel {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
}
.view-panel.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* Section Common */
.section-container {
  margin-top: 36px;
}
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* Hero Section */
.hero-card {
  background: linear-gradient(135deg, rgba(255, 45, 85, 0.2) 0%, rgba(139, 92, 246, 0.15) 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.hero-content {
  max-width: 600px;
  z-index: 2;
}
.hero-tag {
  display: inline-block;
  background: rgba(255, 45, 85, 0.25);
  border: 1px solid rgba(255, 45, 85, 0.4);
  color: #ff7597;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
}
.hero-title {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 14px;
}
.hero-desc {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}
.hero-actions {
  display: flex;
  gap: 16px;
}

.hero-graphic {
  position: relative;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.vinyl-record {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, #1a1c24 30%, #0d0e12 60%, #000 100%);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 0 8px rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: spinSlow 16s linear infinite;
}
.vinyl-center {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--accent-gradient);
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.4);
}
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Grid & Cards */
.song-grid, .playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.song-card, .playlist-card {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
}
.song-card:hover, .playlist-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.4);
}

.card-art-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #181c2c;
}
.card-art-wrap img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}
.song-card:hover .card-art-wrap img, .playlist-card:hover .card-art-wrap img {
  transform: scale(1.05);
}

.card-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.song-card:hover .card-play-overlay, .playlist-card:hover .card-play-overlay {
  opacity: 1;
}

.play-circle-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-red);
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(255, 45, 85, 0.6);
  transform: scale(0.85);
  transition: transform var(--transition-fast);
}
.play-circle-btn svg {
  width: 22px;
  height: 22px;
  margin-left: 3px;
}
.song-card:hover .play-circle-btn {
  transform: scale(1);
}

.card-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.card-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Playlist Banner & Tracklist */
.playlist-banner {
  display: flex;
  align-items: flex-end;
  gap: 32px;
  padding: 32px;
  background: linear-gradient(180deg, rgba(255, 45, 85, 0.25) 0%, rgba(10, 12, 18, 0.6) 100%);
  border-radius: var(--radius-lg);
  margin-bottom: 28px;
}
.playlist-cover-large {
  width: 200px;
  height: 200px;
  border-radius: var(--radius-md);
  object-fit: cover;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6);
}
.playlist-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.playlist-type-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent-red);
}
.playlist-detail-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
}
.playlist-detail-meta {
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.playlist-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}

/* Tracklist Table */
.tracklist-container {
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  overflow: hidden;
}
.tracklist-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.tracklist-table th {
  padding: 12px 16px;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--border-subtle);
}
.tracklist-table td {
  padding: 12px 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.track-row {
  cursor: pointer;
  transition: background var(--transition-fast);
}
.track-row:hover {
  background: rgba(255, 255, 255, 0.06);
}
.track-row.playing {
  background: rgba(255, 45, 85, 0.12);
  color: #ff6b8b;
}

.track-title-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.track-table-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
}

/* Filter Chips */
.filter-chips {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}
.filter-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.filter-chip:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}
.filter-chip.active {
  background: var(--accent-red);
  color: #fff;
  border-color: var(--accent-red);
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--text-muted);
  text-align: center;
}
.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state h3 {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

/* Loading State */
.loading-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 14px;
  color: var(--text-muted);
}
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   QUEUE & NOW PLAYING CARD
   ========================================================================== */
.now-playing-card {
  background: linear-gradient(135deg, rgba(255, 45, 85, 0.15), rgba(24, 28, 44, 0.8));
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.q-np-left {
  display: flex;
  align-items: center;
  gap: 18px;
}
.q-np-left img {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
.badge-accent {
  background: var(--accent-red);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}
.queue-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}
.queue-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}
.queue-item:hover {
  background: rgba(255, 255, 255, 0.08);
}
.q-item-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.q-item-left img {
  width: 42px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
}
.q-item-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
}
.q-item-artist {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.q-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Lyrics Card */
.lyrics-card {
  max-width: 750px;
  margin: 0 auto;
  text-align: center;
  padding: 40px 20px;
}
.lyrics-header h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 6px;
}
.lyrics-header p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 36px;
}
.lyrics-body {
  font-size: 1.35rem;
  line-height: 2.2;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: pre-line;
}
.lyrics-placeholder {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* ==========================================================================
   VIDEO CINEMA DRAWER
   ========================================================================== */
.video-cinema-drawer {
  position: fixed;
  top: 0;
  right: -550px;
  width: 520px;
  height: calc(100vh - var(--player-height));
  background: rgba(14, 17, 26, 0.95);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-left: 1px solid var(--border-subtle);
  z-index: 99;
  display: flex;
  flex-direction: column;
  transition: right var(--transition-slow);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.6);
}
.video-cinema-drawer.open {
  right: 0;
}
.drawer-header {
  height: var(--header-height);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}
.drawer-title {
  font-weight: 700;
  font-size: 1.05rem;
}
.drawer-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 6px;
}
.drawer-close-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}
.drawer-video-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  overflow: hidden;
}
#yt-player-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* ==========================================================================
   BOTTOM PLAYER BAR
   ========================================================================== */
.player-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: var(--player-height);
  background: rgba(14, 17, 27, 0.88);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 100;
}

/* Player Left: Track Details */
.player-left {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 280px;
}
.track-thumb-container {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #181c2c;
  flex-shrink: 0;
}
#player-track-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.track-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.track-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
}
.track-artist {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.btn-like svg {
  width: 18px;
  height: 18px;
}
.btn-like.liked {
  color: var(--accent-red);
}
.btn-like.liked svg {
  fill: var(--accent-red);
}

/* Player Center: Controls & Progress Bar */
.player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 650px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 18px;
}
.control-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  transition: all var(--transition-fast);
}
.control-btn svg {
  width: 18px;
  height: 18px;
}
.control-btn:hover {
  color: #fff;
  transform: scale(1.1);
}
.control-btn.active {
  color: var(--accent-red);
}

.btn-play-pause {
  width: 44px;
  height: 44px;
  background: #fff;
  color: #000;
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.3);
}
.btn-play-pause:hover {
  background: #fff;
  color: #000;
  transform: scale(1.08);
  box-shadow: 0 6px 22px rgba(255, 255, 255, 0.5);
}
.btn-play-pause svg {
  width: 22px;
  height: 22px;
}

.progress-bar-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.time-current, .time-total {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  width: 36px;
  text-align: center;
}

.progress-slider-wrapper {
  position: relative;
  flex: 1;
  height: 6px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.progress-rail {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.15);
  overflow: hidden;
  transition: height var(--transition-fast);
}
.progress-fill {
  height: 100%;
  background: var(--accent-red);
  border-radius: 2px;
  transition: width 0.1s linear;
}
.progress-slider-wrapper:hover .progress-rail {
  height: 6px;
}

.progress-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* Player Right: Visualizer & Volume */
.player-right {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 280px;
  justify-content: flex-end;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 130px;
}
.volume-slider-wrapper {
  flex: 1;
  position: relative;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}
.volume-input {
  width: 100%;
  accent-color: var(--accent-red);
  cursor: pointer;
  height: 4px;
}

/* Visualizer Canvas */
#audio-visualizer {
  display: block;
  border-radius: 4px;
}

/* ==========================================================================
   MODALS
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  padding: 28px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}
.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ff0000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-logo-icon svg {
  width: 18px;
  height: 18px;
}
.modal-header h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}
.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
}
.modal-close-btn:hover {
  color: #fff;
}

.modal-desc {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.device-flow-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}
.step-card {
  display: flex;
  gap: 14px;
  background: var(--bg-glass-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
}
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-red);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.step-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.9rem;
}
.code-box-container {
  display: flex;
  align-items: center;
  gap: 12px;
}
.code-box {
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  padding: 8px 16px;
  font-family: monospace;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #ff3b69;
}

.waiting-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-red);
  animation: pulseDot 1.5s infinite;
}
@keyframes pulseDot {
  0% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 10px var(--accent-red); }
  100% { transform: scale(0.9); opacity: 0.5; }
}

.settings-group {
  margin-bottom: 20px;
}
.settings-label {
  font-weight: 600;
  font-size: 0.95rem;
  display: block;
  margin-bottom: 6px;
}
.settings-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.shortcuts-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}
kbd {
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: inherit;
  font-weight: 600;
  color: #fff;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: calc(var(--player-height) + 20px);
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 2000;
}
.toast {
  background: rgba(24, 28, 44, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-red);
  border-radius: var(--radius-md);
  padding: 12px 20px;
  color: #fff;
  font-size: 0.88rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  animation: toastIn 0.3s ease;
}
@keyframes toastIn {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ==========================================================================
   MOBILE NAVIGATION & FULL-SCREEN NOW PLAYING SHEET
   ========================================================================== */
.mobile-bottom-nav {
  display: none;
}
.mobile-player-sheet {
  display: none;
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0px;
    --player-height: 64px;
  }

  .sidebar {
    display: none !important;
  }

  .main-wrapper {
    height: calc(100vh - 128px);
    width: 100vw;
  }

  .app-header {
    padding: 0 16px;
    height: 60px;
  }
  .header-left {
    max-width: 100%;
  }
  .search-bar-container {
    padding: 6px 14px;
  }
  .search-kbd {
    display: none;
  }

  .content-area {
    padding: 16px;
    padding-bottom: 24px;
  }

  .hero-card {
    flex-direction: column;
    padding: 24px 16px;
    text-align: center;
  }
  .hero-content {
    max-width: 100%;
  }
  .hero-title {
    font-size: 1.8rem;
  }
  .hero-desc {
    font-size: 0.92rem;
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .hero-graphic {
    display: none;
  }

  .song-grid, .playlist-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }

  .playlist-banner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 16px;
  }
  .playlist-cover-large {
    width: 140px;
    height: 140px;
  }
  .playlist-detail-title {
    font-size: 1.6rem;
  }
  .playlist-actions {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }
  .playlist-actions .btn {
    flex: 1;
    min-width: 130px;
  }

  .tracklist-table th:nth-child(4),
  .tracklist-table td:nth-child(4) {
    display: none;
  }

  /* Player Bar on Mobile (Compact Mini-Player above bottom nav) */
  .player-bar {
    height: 64px;
    bottom: 64px;
    padding: 0 14px;
    background: rgba(14, 17, 27, 0.95);
    border-top: 1px solid var(--border-subtle);
  }
  .player-left {
    flex: 1;
    width: auto;
    cursor: pointer;
  }
  .player-center {
    flex: initial;
    max-width: none;
  }
  .player-center .player-controls {
    gap: 8px;
  }
  #btn-shuffle, #btn-repeat, #btn-prev, .progress-bar-container {
    display: none;
  }
  .player-right {
    display: none;
  }
  .btn-like {
    display: none;
  }

  /* Mobile Bottom Nav Bar */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100vw;
    height: 64px;
    background: rgba(10, 12, 18, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid var(--border-subtle);
    z-index: 105;
    justify-content: space-around;
    align-items: center;
    padding: 0 4px;
  }
  .mobile-nav-btn {
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
  }
  .mobile-nav-btn svg {
    width: 22px;
    height: 22px;
  }
  .mobile-nav-btn.active {
    color: var(--accent-red);
  }
  .mobile-nav-btn:hover {
    color: #fff;
  }

  /* Full Screen Now-Playing Sheet for Mobile */
  .mobile-player-sheet {
    display: flex;
    position: fixed;
    inset: 0;
    background: var(--bg-base);
    background: radial-gradient(circle at top, #1e1428 0%, #0a0c12 100%);
    z-index: 3000;
    flex-direction: column;
    padding: 24px 20px;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
  }
  .mobile-player-sheet.open {
    transform: translateY(0);
  }

  .sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
  }
  .sheet-drag-handle {
    width: 44px;
    height: 5px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    margin: 0 auto;
    cursor: pointer;
  }
  .sheet-close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 6px;
  }
  .sheet-art-container {
    width: 100%;
    aspect-ratio: 1 / 1;
    max-width: 320px;
    margin: 0 auto 24px auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  }
  .sheet-art-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .sheet-track-info {
    text-align: center;
    margin-bottom: 24px;
  }
  .sheet-track-info h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .sheet-track-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
  }
  .sheet-progress-container {
    margin-bottom: 24px;
    width: 100%;
  }
  .sheet-progress-container .progress-bar-container {
    display: flex !important;
  }
  .sheet-controls {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    max-width: 360px;
    margin: 0 auto 28px auto;
  }
  .sheet-controls .control-btn {
    display: flex !important;
  }
  .sheet-footer-actions {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: auto;
  }

  .video-cinema-drawer {
    width: 100vw;
    right: -100vw;
  }
  .video-cinema-drawer.open {
    right: 0;
  }

  .toast-container {
    bottom: 140px;
    right: 16px;
    left: 16px;
  }
}

