:root {
  --bg-primary: #0a0d14;
  --bg-secondary: #101622;
  --bg-tertiary: #172033;
  --bg-surface: rgba(23, 32, 51, 0.7);
  --bg-hover: rgba(255, 255, 255, 0.06);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(16, 185, 129, 0.5);

  --accent-primary: #10b981;
  --accent-hover: #059669;
  --accent-glow: rgba(16, 185, 129, 0.25);
  --accent-cyan: #06b6d4;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --danger: #ef4444;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --sidebar-width: 250px;
  --player-height: 84px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  height: 100vh;
  overflow: hidden;
  user-select: none;
}

/* Glassmorphism Panel */
.glass-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
}

/* Equalizer Bars Animation */
.brand-icon {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
  width: 24px;
}
.brand-icon.small {
  height: 18px;
  width: 18px;
}
.brand-icon .bar {
  width: 3.5px;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-primary));
  border-radius: var(--radius-full);
  animation: equalize 1.2s ease-in-out infinite alternate;
}
.brand-icon .bar1 { height: 60%; animation-delay: 0.1s; }
.brand-icon .bar2 { height: 100%; animation-delay: 0.3s; }
.brand-icon .bar3 { height: 40%; animation-delay: 0.5s; }
.brand-icon .bar4 { height: 80%; animation-delay: 0.2s; }

@keyframes equalize {
  0% { height: 25%; }
  100% { height: 100%; }
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  color: #041014;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: rgba(255, 255, 255, 0.2);
}
.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
}
.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}
.btn-block {
  width: 100%;
}
.btn-icon {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.btn-icon:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

/* ==================== AUTH VIEW ==================== */
.auth-container {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: radial-gradient(circle at 50% 20%, #152238 0%, #0a0d14 70%);
  padding: 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  padding: 36px 32px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}
.brand-header {
  text-align: center;
  margin-bottom: 28px;
}
.brand-header .brand-icon {
  margin: 0 auto 12px auto;
  transform: scale(1.3);
}
.brand-header h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 40%, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.brand-header .tagline {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  transition: all 0.2s;
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.alert-box {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  line-height: 1.4;
  margin-bottom: 16px;
}
.alert-box.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.alert-box.info {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: #a5f3fc;
}

.quick-credentials {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}
.quick-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.btn-badge {
  background: var(--bg-hover);
  border: 1px dashed var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}
.btn-badge:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==================== MAIN DASHBOARD LAYOUT ==================== */
.app-container {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: 1fr var(--player-height);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* SIDEBAR */
.sidebar {
  grid-row: 1 / 2;
  grid-column: 1 / 2;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  z-index: 10;
}
.sidebar-header {
  margin-bottom: 28px;
}
.brand-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-badge h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 40%, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}
.nav-item:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.nav-item.active {
  color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.12);
  border-left: 3px solid var(--accent-primary);
}

.sidebar-footer {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}
.user-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  color: #041014;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}
.user-info {
  flex: 1;
  min-width: 0;
}
.user-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 0.7rem;
  color: var(--accent-cyan);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
}

/* MAIN CONTENT */
.main-content {
  grid-row: 1 / 2;
  grid-column: 2 / 3;
  overflow-y: auto;
  padding: 24px 32px 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* TOPBAR */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 8px 14px;
  border-radius: var(--radius-full);
  width: 360px;
  transition: all 0.2s;
}
.search-box:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
  width: 420px;
}
.search-box input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.88rem;
  width: 100%;
}
.search-box input:focus {
  outline: none;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* SECTION HERO */
.section-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}
.hero-text h1 {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.hero-text p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 4px;
}
.hero-stats {
  display: flex;
  gap: 20px;
}
.stat-item {
  text-align: right;
}
.stat-value {
  display: block;
  font-size: 1.25rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}
.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

/* TRACKLIST TABLE */
.tracklist-container {
  display: flex;
  flex-direction: column;
}
.tracklist-header {
  display: grid;
  grid-template-columns: 44px 3fr 2fr 100px 100px;
  padding: 10px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}
.track-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.track-row {
  display: grid;
  grid-template-columns: 44px 3fr 2fr 100px 100px;
  align-items: center;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  transition: all 0.15s ease;
  cursor: pointer;
}
.track-row:hover {
  background: var(--bg-hover);
}
.track-row.active {
  background: rgba(16, 185, 129, 0.1);
  border-left: 2px solid var(--accent-primary);
}
.col-num {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
}
.col-title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.track-thumb {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1.1rem;
  overflow: hidden;
}
.track-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.track-texts {
  min-width: 0;
}
.track-name {
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}
.track-row.active .track-name {
  color: var(--accent-primary);
}
.track-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.col-album {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.col-dur {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.col-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* PLAYLISTS GRID */
.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 16px;
}
.playlist-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}
.playlist-card:hover {
  background: var(--bg-tertiary);
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.15);
}
.playlist-card-art {
  width: 100%;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #1e293b, #0f172a);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.playlist-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.playlist-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.playlist-card-foot {
  margin-top: auto;
  padding-top: 10px;
  font-size: 0.72rem;
  color: var(--accent-cyan);
  font-weight: 600;
  text-transform: uppercase;
}

/* PLAYLIST DETAIL VIEW */
.playlist-detail-modal {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.btn-back {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.btn-back:hover {
  color: var(--text-primary);
}
.playlist-detail-hero {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 24px;
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}
.playlist-art {
  width: 120px;
  height: 120px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  flex-shrink: 0;
}
.playlist-meta {
  flex: 1;
}
.playlist-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--accent-primary);
}
.playlist-meta h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 4px 0;
}
.playlist-meta p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.pl-detail-info {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.pl-actions-bar {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

/* UPLOAD VIEW */
.upload-container {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}
.tab-switchers {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.sub-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.15s;
}
.sub-tab-btn.active {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}
.card-form {
  padding: 24px;
  border-radius: var(--radius-lg);
}
.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all 0.2s;
  margin-bottom: 20px;
}
.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent-primary);
  background: rgba(16, 185, 129, 0.04);
}
.drop-zone input[type="file"] {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  opacity: 0;
  cursor: pointer;
}
.drop-zone h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 10px 0 4px 0;
}
.drop-zone p {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.selected-file {
  margin-top: 12px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--accent-cyan);
}

/* USERS TABLE */
.users-management-grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 24px;
}
.user-table-wrap {
  overflow-x: auto;
  margin-top: 12px;
}
.user-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.user-table th {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
}
.user-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

/* ==================== BOTTOM AUDIO PLAYER ==================== */
.player-bar {
  grid-row: 2 / 3;
  grid-column: 1 / 3;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 36px 0 24px;
  height: var(--player-height);
  background: rgba(9, 14, 23, 0.96);
  backdrop-filter: blur(20px);
  z-index: 100;
}
.player-left {
  flex: 0 1 280px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  cursor: pointer;
}
.track-artwork {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
}
.track-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.track-meta {
  min-width: 0;
}
.track-title-wrap {
  white-space: nowrap;
  overflow: hidden;
}
.player-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  display: inline-block;
}
.player-artist {
  display: block;
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* CENTER CONTROLS & TIMELINE */
.player-center {
  flex: 1 1 auto;
  max-width: 500px;
  min-width: 180px;
  margin: 0 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.player-buttons {
  display: flex;
  align-items: center;
  gap: 14px;
}
.control-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: var(--radius-full);
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.control-btn:hover {
  color: var(--text-primary);
  transform: scale(1.08);
}
.control-btn.active {
  color: var(--accent-primary);
}
.control-btn.play-circle {
  width: 38px;
  height: 38px;
  background: #ffffff;
  color: #041014;
  border-radius: var(--radius-full);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}
.control-btn.play-circle:hover {
  transform: scale(1.1);
  background: var(--accent-cyan);
}

.timeline-container {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.time-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  width: 38px;
  text-align: center;
  flex-shrink: 0;
}
.progress-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  position: relative;
  cursor: pointer;
}
.progress-bar-wrap:hover {
  height: 8px;
}
.progress-buffered {
  position: absolute;
  top: 0; left: 0; height: 100%;
  background: rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-full);
  width: 0%;
}
.progress-current {
  position: absolute;
  top: 0; left: 0; height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
  border-radius: var(--radius-full);
  width: 0%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}
.scrubber-knob {
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: var(--radius-full);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
  transform: translateX(50%);
  opacity: 0;
  transition: opacity 0.15s;
}
.progress-bar-wrap:hover .scrubber-knob {
  opacity: 1;
}

/* RIGHT: VOLUME & VISUALIZER */
.player-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-right: 8px;
  flex-shrink: 0;
}
.player-right > * {
  flex-shrink: 0;
}
#audio-visualizer {
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}
.volume-container {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 130px;
  min-width: 125px;
  margin: 0 4px;
  flex-shrink: 0;
}
#volume-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 85px;
  width: 85px;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.28);
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
  transition: background 0.2s;
}
#volume-slider:hover {
  background: rgba(255, 255, 255, 0.45);
}
#volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  transition: transform 0.15s;
}
#volume-slider:hover::-webkit-slider-thumb {
  transform: scale(1.25);
}
#volume-slider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #ffffff;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}
#volume-slider::-moz-range-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 4px;
}

/* MODAL OVERLAY (ALWAYS ON TOP OF FULLSCREEN PLAYER) */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100vw; height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999 !important;
  padding: 20px;
}
.modal-card {
  width: 100%;
  max-width: 480px;
  padding: 24px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.modal-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}
.playlist-select-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}
.playlist-select-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.15s;
}
.playlist-select-item:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
}

/* TOAST NOTIFICATION */
.toast {
  position: fixed;
  bottom: 100px;
  right: 24px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 9999;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* UTILITY CLASSES */
.hidden { display: none !important; }
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px auto;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.loading-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ==================== IN-APP SEARCH & BATCH IMPORT ==================== */
.inapp-search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.inapp-search-box input {
  flex: 1;
}
.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.search-result-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}
.search-result-card:hover {
  background: var(--bg-tertiary);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.search-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.search-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.search-info {
  flex: 1;
  min-width: 0;
}
.search-track-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-track-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.search-card-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* BATCH PROGRESS CARD */
.batch-progress-card {
  margin-top: 20px;
  padding: 20px;
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  border: 1px solid var(--border-focus);
}
.batch-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.batch-status-badge {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-primary);
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.batch-progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
  margin-bottom: 10px;
}
.batch-progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-cyan));
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
  width: 0%;
}
.batch-current-track {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==================== AUTH TABS & DIRECT ACCESS ==================== */
.auth-tabs {
  display: flex;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: 4px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}
.auth-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}
.auth-tab-btn.active {
  background: var(--bg-tertiary);
  color: var(--accent-primary);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.auth-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 16px 0;
  color: var(--text-muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.auth-divider::before, .auth-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}
.auth-divider span {
  padding: 0 10px;
}

/* ==================== RESPONSIVE & ADVANCED PLAYER STYLES ==================== */

/* LIKE BUTTON & ANIMATION */
.btn-like-track, .btn-like-row {
  color: var(--text-muted);
  transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.btn-like-track:hover, .btn-like-row:hover {
  transform: scale(1.15);
  color: #f43f5e;
}
.btn-like-track.liked, .btn-like-row.liked {
  color: #f43f5e;
}
.btn-like-track.liked svg, .btn-like-row.liked svg {
  fill: #f43f5e;
}

/* PLAYER SPEED BADGE */
.btn-badge-player {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
  min-width: 44px;
  white-space: nowrap;
  text-align: center;
}
.btn-badge-player:hover {
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* ==================== FULLSCREEN NOW PLAYING MODAL ==================== */
.fullscreen-player {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2000;
  background: #080b11;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUpModal 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideUpModal {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.fs-backdrop-blur {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background-size: cover;
  background-position: center;
  filter: blur(80px) brightness(0.25);
  opacity: 0.7;
  pointer-events: none;
  transition: all 0.5s ease;
}

.fs-container {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 24px 36px 24px;
  justify-content: space-between;
}

.fs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-align: center;
}
.fs-header-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.fs-subtitle {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-muted);
}
.fs-album-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

/* ARTWORK & AMBIENT GLOW (SPOTIFY / APPLE MUSIC STYLE) */
.fs-artwork-area {
  position: relative;
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  margin: 16px auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fs-art-glow {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  border-radius: 28px;
  background: radial-gradient(circle, var(--accent-primary) 0%, transparent 70%);
  opacity: 0.35;
  filter: blur(40px);
  pointer-events: none;
  transition: all 0.5s ease;
}
.fs-artwork {
  width: 100%;
  height: 100%;
  border-radius: 24px;
  background: var(--bg-tertiary);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5rem;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
}
.fs-artwork img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.fs-artwork.playing {
  transform: scale(1.02);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(16, 185, 129, 0.2);
}

.fs-track-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.fs-track-texts {
  min-width: 0;
}
.fs-track-texts h2 {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fs-track-texts p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* TIMELINE FULLSCREEN */
.fs-timeline {
  margin-bottom: 24px;
}
.fs-progress-wrap {
  height: 6px;
  cursor: pointer;
}
.fs-progress-wrap:hover {
  height: 8px;
}
.fs-timestamps {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* CONTROLS FULLSCREEN */
.fs-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 0 8px;
}
.fs-nav-btn {
  color: var(--text-primary);
}
.fs-play-circle {
  width: 60px;
  height: 60px;
  background: #ffffff;
  color: #041014;
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.25);
}

.fs-footer-tools {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}
.fs-tool-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all 0.15s;
}
.fs-tool-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

/* SLEEP TIMER MODAL */
.sleep-timer-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.btn-timer-opt {
  padding: 12px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.btn-timer-opt:hover {
  background: var(--bg-hover);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}
.btn-timer-opt.text-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* QUEUE LIST MODAL */
.queue-card {
  max-width: 540px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.queue-list-container {
  overflow-y: auto;
  max-height: 55vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
}
.queue-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.1);
}
.queue-item.active {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.35);
}
.queue-idx {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  width: 20px;
  text-align: center;
}
.queue-item.active .queue-idx {
  color: var(--accent-primary);
  font-weight: 700;
}
.queue-art {
  width: 38px;
  height: 38px;
  border-radius: 6px;
  overflow: hidden;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.queue-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.queue-texts {
  flex: 1;
  min-width: 0;
}
.queue-name {
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}
.queue-item.active .queue-name {
  color: var(--accent-primary);
}
.queue-sub {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-dur {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-left: auto;
}

/* MOBILE BOTTOM NAV */
.mobile-bottom-nav {
  display: none;
}

/* ==================== RESPONSIVE MEDIA QUERIES ==================== */

/* TABLETS & LAPTOPS (Max 1200px) */
@media (max-width: 1200px) {
  #audio-visualizer {
    display: none !important;
  }
  .player-bar {
    padding: 0 20px 0 16px;
  }
}

/* TABLETS (Max 1024px) */
@media (max-width: 1024px) {
  :root {
    --sidebar-width: 200px;
  }
  .tracklist-header, .track-row {
    grid-template-columns: 36px 3fr 1fr 80px 80px;
  }
  .search-box {
    width: 240px;
  }
}

/* MOBILE PHONES (Max 768px) */
@media (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  .app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
  }

  /* Hide Desktop Sidebar */
  .sidebar {
    display: none !important;
  }

  /* Main Content Adjustments */
  .main-content {
    flex: 1;
    padding: 16px 16px 150px 16px; /* Extra bottom padding for player + mobile nav */
    gap: 16px;
  }

  /* Topbar Mobile */
  .topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .search-box {
    width: 100% !important;
  }
  .topbar-actions {
    justify-content: space-between;
  }

  /* Hero Stats */
  .section-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .hero-stats {
    align-self: flex-start;
  }

  /* Tracklist Table Mobile */
  .tracklist-header {
    display: none;
  }
  .col-album {
    display: none;
  }
  .track-row {
    grid-template-columns: 28px 1fr 50px 70px;
    padding: 8px 10px;
  }
  .col-title {
    gap: 10px;
  }
  .track-thumb {
    width: 36px;
    height: 36px;
  }
  .track-name {
    font-size: 0.88rem;
  }
  .track-sub {
    font-size: 0.74rem;
  }
  .col-dur {
    font-size: 0.75rem;
  }

  /* Bottom Player Mobile */
  .player-bar {
    position: fixed;
    bottom: 56px; /* Right above mobile bottom nav */
    left: 0;
    width: 100%;
    height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 14px;
    background: rgba(10, 14, 22, 0.96);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    z-index: 1200;
  }
  .player-left {
    flex: 1;
    min-width: 0;
    cursor: pointer;
  }
  .player-center {
    display: none !important;
  }
  .player-right {
    flex: 0 0 auto;
    gap: 8px;
    padding-right: 0;
  }
  .player-right .desktop-only,
  #audio-visualizer,
  #btn-speed,
  #btn-sleep-timer,
  #btn-open-queue {
    display: none !important;
  }
  .mobile-only {
    display: flex !important;
  }
  .btn-expand-player {
    display: flex !important;
  }
  .player-artwork {
    width: 44px;
    height: 44px;
  }

  /* Mobile Bottom Navigation Bar */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 56px;
    background: rgba(10, 13, 20, 0.98);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border-color);
    z-index: 1500;
    justify-content: space-around;
    align-items: center;
  }
  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.7rem;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    transition: all 0.15s;
  }
  .mobile-nav-item.active {
    color: var(--accent-primary);
  }

  /* Fullscreen Player Mobile Height */
  .fs-container {
    padding: 20px 16px 28px 16px;
  }
  .fs-artwork-area {
    max-width: 270px;
  }

  /* Users grid mobile */
  .users-management-grid {
    grid-template-columns: 1fr;
  }

  /* Upload container mobile */
  .tab-switchers {
    overflow-x: auto;
    padding-bottom: 6px;
  }
  .sub-tab-btn {
    white-space: nowrap;
    font-size: 0.8rem;
    padding: 8px 12px;
  }
}
