:root {
  --bg-base: #0a0a0c;
  --bg-surface: #121216;
  --bg-card: #181820;
  --bg-hover: #22222c;
  --accent-primary: #1DB954;
  --accent-hover: #1ed760;
  --text-primary: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #666678;
  --danger: #ff4757;
  --danger-hover: #ff6b81;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

.app-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* SIDEBAR */
.sidebar {
  width: 280px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 24px 20px;
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-icon {
  font-size: 28px;
  background: linear-gradient(135deg, #1DB954, #1ed760);
  border-radius: 12px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(29, 185, 84, 0.3);
}

.brand-text h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-text .subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

/* STATUS CARD */
.status-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #f1c40f;
  box-shadow: 0 0 10px rgba(241, 196, 15, 0.5);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.status-indicator.online {
  background-color: var(--accent-primary);
  box-shadow: 0 0 10px rgba(29, 185, 84, 0.7);
}

.status-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.status-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
}

.status-channel {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-menu {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.nav-item:hover {
  background-color: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background-color: var(--bg-card);
  color: var(--accent-primary);
  border: 1px solid var(--border);
}

.sidebar-footer {
  margin-top: auto;
}

.discord-invite-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  background-color: #5865F2;
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.discord-invite-btn:hover {
  background-color: #4752c4;
}

/* MAIN CONTENT */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at top right, #1a1e28 0%, #0a0a0c 60%);
  overflow-y: auto;
  position: relative;
}

.top-header {
  padding: 24px 36px;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  background: rgba(10, 10, 12, 0.7);
  border-bottom: 1px solid var(--border);
}

.search-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 6px 8px 6px 20px;
  max-width: 720px;
  gap: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.search-box input {
  flex-grow: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

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

.primary-btn {
  background-color: var(--accent-primary);
  color: black;
  border: none;
  border-radius: 20px;
  padding: 10px 22px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.primary-btn:hover {
  background-color: var(--accent-hover);
  transform: scale(1.02);
}

/* VIEW SECTIONS */
.view-section {
  padding: 36px;
  display: none;
}

.view-section.active {
  display: block;
}

/* NOW PLAYING HERO */
.now-playing-hero {
  display: flex;
  gap: 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow);
  margin-bottom: 40px;
  align-items: center;
}

.album-art-wrap {
  width: 240px;
  height: 240px;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

.album-art-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* EQUALIZER ANIMATION */
.equalizer {
  position: absolute;
  bottom: 12px;
  right: 12px;
  display: flex;
  gap: 3px;
  background: rgba(0, 0, 0, 0.6);
  padding: 6px 8px;
  border-radius: 6px;
}

.equalizer span {
  width: 4px;
  height: 16px;
  background-color: var(--accent-primary);
  animation: eqBounce 1s infinite ease-in-out;
}

.equalizer span:nth-child(2) { animation-delay: 0.2s; }
.equalizer span:nth-child(3) { animation-delay: 0.4s; }
.equalizer span:nth-child(4) { animation-delay: 0.1s; }

@keyframes eqBounce {
  0%, 100% { height: 4px; }
  50% { height: 18px; }
}

.track-details {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.track-tag {
  align-self: flex-start;
  font-size: 11px;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--accent-primary);
  background: rgba(29, 185, 84, 0.12);
  padding: 4px 10px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.track-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 8px;
  line-height: 1.2;
}

.track-artist {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.requester-badge {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* TIMELINE */
.timeline-container {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.time {
  font-size: 12px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  min-width: 40px;
}

.progress-bar-bg {
  flex-grow: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  cursor: pointer;
  position: relative;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-primary);
  border-radius: 3px;
  transition: width 0.3s linear;
}

/* CONTROLS */
.control-panel {
  display: flex;
  align-items: center;
  gap: 20px;
}

.ctrl-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.ctrl-btn:hover {
  background: var(--bg-hover);
  transform: scale(1.05);
}

.ctrl-btn.play-main-btn {
  background: var(--accent-primary);
  color: black;
  width: 60px;
  height: 60px;
  font-size: 24px;
  border: none;
  box-shadow: 0 8px 24px rgba(29, 185, 84, 0.4);
}

.ctrl-btn.play-main-btn:hover {
  background: var(--accent-hover);
  transform: scale(1.08);
}

.ctrl-btn.danger {
  color: var(--danger);
}

.ctrl-btn.danger:hover {
  background: rgba(255, 71, 87, 0.15);
}

/* QUICK PRESETS */
.quick-presets-section h2 {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 20px;
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.preset-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-card:hover {
  background: var(--bg-hover);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.2);
}

.preset-icon {
  font-size: 28px;
  width: 52px;
  height: 52px;
  background: var(--bg-card);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.preset-info h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}

.preset-info p {
  font-size: 12px;
  color: var(--text-secondary);
}

.preset-play-btn {
  margin-left: auto;
  background: var(--accent-primary);
  border: none;
  color: black;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.2s ease;
}

.preset-card:hover .preset-play-btn {
  opacity: 1;
}

/* QUEUE VIEW */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.secondary-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.secondary-btn:hover {
  background: var(--bg-hover);
}

.queue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.queue-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  transition: background 0.2s ease;
}

.queue-item:hover {
  background: var(--bg-hover);
}

.queue-num {
  font-size: 14px;
  color: var(--text-muted);
  width: 24px;
  text-align: center;
}

.queue-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
}

.queue-info {
  flex-grow: 1;
  overflow: hidden;
}

.queue-title {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-artist {
  font-size: 12px;
  color: var(--text-secondary);
}

.queue-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.queue-duration {
  font-size: 13px;
  color: var(--text-secondary);
}

.queue-del-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.queue-del-btn:hover {
  color: var(--danger);
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 15px;
}

/* SEARCH RESULTS MODAL */
.search-results {
  position: absolute;
  top: 90px;
  left: 36px;
  right: 36px;
  max-width: 720px;
  background: var(--bg-surface);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  z-index: 200;
  padding: 20px;
  max-height: 480px;
  overflow-y: auto;
}

.search-results.hidden {
  display: none;
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

.search-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s ease;
}

.search-card:hover {
  background: var(--bg-hover);
}

.search-thumb {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
}

.search-card-info {
  flex-grow: 1;
}

.search-card-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
}

.search-card-artist {
  font-size: 12px;
  color: var(--text-secondary);
}

/* TOAST */
.toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--accent-primary);
  color: black;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 30px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .app-layout {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    padding: 16px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .now-playing-hero {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  .track-tag {
    align-self: center;
  }
  .control-panel {
    justify-content: center;
  }
}

/* CHANNEL SELECTOR */
.channel-selector-card {
  margin: 12px 0 16px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.channel-label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.channel-select-row {
  display: flex;
  gap: 6px;
}
.channel-select {
  flex: 1;
  background: #121216;
  border: 1px solid var(--border);
  color: #fff;
  border-radius: 6px;
  padding: 6px 8px;
  font-size: 0.82rem;
  font-weight: 500;
  outline: none;
}
.channel-select:focus {
  border-color: var(--primary);
}
.channel-join-btn, .channel-leave-btn {
  background: var(--surface-light);
  border: 1px solid var(--border);
  color: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
}
.channel-join-btn:hover {
  background: var(--primary);
  color: #000;
}
.channel-leave-btn:hover {
  background: #ff4757;
  color: #fff;
}

/* CACHE BADGE */
.cache-badge-card {
  margin: 12px 0;
  padding: 8px 12px;
  background: rgba(29, 185, 84, 0.08);
  border: 1px solid rgba(29, 185, 84, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cache-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.cache-stats {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

/* MODAL */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}
.modal.hidden {
  display: none !important;
}
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: 90%;
  max-width: 480px;
  padding: 20px;
  box-shadow: 0 16px 36px rgba(0,0,0,0.5);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
}
.modal-label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 700;
  margin: 12px 0 4px 0;
  text-transform: uppercase;
}
.modal-input {
  width: 100%;
  background: #121216;
  border: 1px solid var(--border);
  color: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 0.9rem;
  outline: none;
  box-sizing: border-box;
}
.modal-input:focus {
  border-color: var(--primary);
}
.modal-footer {
  margin-top: 20px;
}
.preset-del-btn {
  background: transparent;
  border: none;
  color: #ff4757;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s;
  opacity: 0.6;
}
.preset-del-btn:hover {
  opacity: 1;
  background: rgba(255, 71, 87, 0.15);
}
