/* ==========================================================================
   HEARTBEAT.FM DJ QUEUE & PLAYLISTS DASHBOARD
   Direct Pixel-Perfect Clone of JustLyrics Desktop Spotify Dashboard
   ========================================================================== */

#screen-dj-queue {
  background-color: #000000;
  color: #ffffff;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 50;
  display: none;
}

#screen-dj-queue.active {
  display: block;
}

/* 2-Column Desktop Grid Layout (300px sidebar, 1fr main, 90px player bar) */
.spotify-layout {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 90px;
  grid-template-columns: 290px 1fr;
  height: 100vh;
  padding: 8px;
  gap: 8px;
  box-sizing: border-box;
  background-color: #000000;
}

/* ==========================================================================
   SIDEBAR (NAVIGATION & YOUR LIBRARY)
   ========================================================================== */
.spotify-sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  overflow: hidden;
}

.sidebar-nav,
.sidebar-library {
  background-color: #121212;
  border-radius: 8px;
  padding: 20px;
}

.sidebar-brand {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: #ffffff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.5px;
}

.sidebar-brand .brand-badge {
  background: #22c55e;
  color: #000000;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-nav a {
  color: #b3b3b3;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 4px 0;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: #ffffff;
}

.sidebar-nav i {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

/* Library Section */
.sidebar-library {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.library-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #b3b3b3;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.library-header:hover {
  color: #ffffff;
}

.library-header i.fa-plus {
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px;
  transition: color 0.2s;
}

.library-header i.fa-plus:hover {
  color: #ffffff;
  transform: scale(1.15);
}

.library-filters {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.library-filters::-webkit-scrollbar { display: none; }

.lib-chip {
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  color: #ffffff;
}
.lib-chip:hover,
.lib-chip.active {
  background: rgba(255, 255, 255, 0.22);
}

.library-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  flex: 1;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.library-list::-webkit-scrollbar { display: none; }

.lib-item {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s;
}
.lib-item:hover {
  background: rgba(255, 255, 255, 0.08);
}

.lib-item img,
.liked-icon {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.liked-icon {
  background: linear-gradient(135deg, #450af5, #c4efd9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #ffffff;
}

.lib-item-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex: 1;
}

.lib-item-info h4 {
  font-size: 0.92rem;
  margin: 0 0 3px 0;
  color: #ffffff;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lib-item-info p {
  font-size: 0.78rem;
  margin: 0;
  color: #b3b3b3;
  font-weight: 500;
}

/* ==========================================================================
   MAIN VIEW AREA
   ========================================================================== */
.spotify-main {
  background-color: #121212;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header */
.main-header.solid-bg {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(18, 18, 18, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

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

.nav-btn {
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  background: rgba(0, 0, 0, 0.6);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-size: 0.9rem;
}
.nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.05);
}

.return-studio-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 7px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
.return-studio-btn:hover {
  background: #22c55e;
  color: #000000;
  border-color: #22c55e;
}

.search-bar {
  background: #242424;
  border-radius: 24px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 320px;
  border: 1px solid transparent;
  transition: all 0.2s;
}
.search-bar:focus-within {
  border-color: rgba(255, 255, 255, 0.25);
  background: #2a2a2a;
}
.search-bar i {
  color: #b3b3b3;
  font-size: 0.95rem;
}
.search-bar input {
  background: transparent;
  border: none;
  color: #ffffff;
  outline: none;
  width: 100%;
  font-size: 0.88rem;
  font-family: inherit;
}
.search-bar input::placeholder {
  color: #888888;
}

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

.broadcast-live-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.broadcast-live-badge .pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  animation: pulse-badge 1.5s infinite;
}
@keyframes pulse-badge {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.add-track-btn {
  background: #ffffff;
  color: #000000;
  border: none;
  border-radius: 20px;
  padding: 8px 18px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.add-track-btn:hover {
  background: #22c55e;
  transform: scale(1.04);
}

/* Home View Content */
.home-content {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px 40px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}
.home-content::-webkit-scrollbar { width: 6px; }
.home-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

.top-chips {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.top-chips::-webkit-scrollbar { display: none; }

.top-chips .chip {
  background: rgba(255, 255, 255, 0.08);
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  color: #ffffff;
}
.top-chips .chip:hover {
  background: rgba(255, 255, 255, 0.16);
}
.top-chips .chip.active {
  background: #ffffff;
  color: #000000;
}

/* Quick Access 6-Card Recent Grid (2 rows x 3 columns) */
.recent-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 36px;
}

.recent-card {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 4px;
  overflow: hidden;
  cursor: pointer;
  transition: background 0.25s;
  position: relative;
  height: 64px;
}
.recent-card:hover {
  background: rgba(255, 255, 255, 0.18);
}
.recent-card.is-active {
  background: rgba(34, 197, 94, 0.15);
}

.recent-card img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  flex-shrink: 0;
}

.recent-card span {
  padding: 0 16px;
  font-weight: 700;
  font-size: 0.92rem;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.recent-card.is-active span {
  color: #22c55e;
}

.recent-card .play-overlay {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #1ed760;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  right: 14px;
  opacity: 0;
  transform: scale(0.9);
  transition: all 0.2s ease;
  box-shadow: 0 6px 14px rgba(0,0,0,0.5);
  font-size: 1rem;
}
.recent-card:hover .play-overlay {
  opacity: 1;
  transform: scale(1);
}
.recent-card .play-overlay:hover {
  transform: scale(1.1);
  background: #22c55e;
}

/* Shelf Sections */
.shelf {
  margin-bottom: 38px;
}

.shelf-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 16px;
}
.shelf-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
  color: #ffffff;
  letter-spacing: -0.3px;
}
.shelf-header span.shelf-sub {
  color: #b3b3b3;
  font-size: 0.85rem;
}

/* Queue Table */
.queue-table-container {
  width: 100%;
  overflow-x: auto;
}

.queue-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.queue-table thead th {
  color: #b3b3b3;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.queue-table tbody tr.queue-row {
  cursor: pointer;
  transition: background 0.2s ease;
  border-radius: 4px;
}
.queue-table tbody tr.queue-row:hover {
  background: rgba(255, 255, 255, 0.08);
}
.queue-table tbody tr.queue-row.is-active {
  background: rgba(34, 197, 94, 0.14);
}

.queue-table td {
  padding: 10px 14px;
  vertical-align: middle;
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.col-idx {
  width: 44px;
  text-align: center;
  color: #b3b3b3;
  font-size: 0.9rem;
}
.queue-row .col-idx .idx-number {
  display: block;
}
.queue-row .col-idx .idx-play-btn {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  font-size: 1rem;
}
.queue-row:hover .col-idx .idx-number {
  display: none;
}
.queue-row:hover .col-idx .idx-play-btn {
  display: inline-block;
}
.queue-row.is-active .col-idx {
  color: #22c55e;
}

.col-meta {
  display: flex;
  align-items: center;
  gap: 14px;
}

.queue-thumb {
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  border-radius: 4px;
  object-fit: cover;
  display: block;
  flex-shrink: 0;
}

.queue-track-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.queue-track-title {
  font-weight: 700;
  font-size: 0.94rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.queue-row.is-active .queue-track-title {
  color: #22c55e;
}
.queue-track-artist {
  font-size: 0.8rem;
  color: #b3b3b3;
  margin-top: 2px;
}

.genre-pill {
  font-size: 0.75rem;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  display: inline-block;
  font-weight: 600;
}

.col-duration {
  font-size: 0.85rem;
  color: #b3b3b3;
  font-variant-numeric: tabular-nums;
}

.col-actions {
  text-align: right;
  white-space: nowrap;
}
.action-icon-btn {
  background: none;
  border: none;
  color: #b3b3b3;
  cursor: pointer;
  padding: 6px 8px;
  font-size: 1rem;
  transition: color 0.2s, transform 0.15s;
}
.action-icon-btn:hover {
  color: #ffffff;
  transform: scale(1.1);
}
.action-icon-btn.liked {
  color: #1ed760;
}

/* Playlists Card Grid */
.cards-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 20px;
}

.song-card {
  background: #181818;
  padding: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s ease;
  position: relative;
}
.song-card:hover {
  background: #282828;
}

.song-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: block;
}

.song-card h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-card p {
  font-size: 0.8rem;
  color: #b3b3b3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.35;
}

.song-card .play-overlay {
  position: absolute;
  bottom: 84px;
  right: 24px;
  width: 46px;
  height: 46px;
  background: #1ed760;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000000;
  font-size: 1.15rem;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s ease;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}
.song-card:hover .play-overlay {
  opacity: 1;
  transform: translateY(0);
}
.song-card .play-overlay:hover {
  transform: scale(1.08);
  background: #22c55e;
}

/* ==========================================================================
   BOTTOM PLAYER CONTROLS (DIRECT JUSTLYRICS REPLICATION)
   ========================================================================== */
.spotify-player {
  grid-column: 1 / -1;
  background-color: #000000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  height: 90px;
  z-index: 100;
}

/* Left: Track Info */
.player-left {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 30%;
  min-width: 220px;
}

.player-left img {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

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

.player-song-info h4 {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-song-info p {
  margin: 3px 0 0 0;
  font-size: 0.78rem;
  color: #b3b3b3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-left i.fa-heart {
  color: #b3b3b3;
  cursor: pointer;
  font-size: 1.15rem;
  margin-left: 8px;
  transition: color 0.2s, transform 0.15s;
}
.player-left i.fa-heart:hover {
  color: #ffffff;
  transform: scale(1.15);
}
.player-left i.fa-heart.liked {
  color: #1ed760 !important;
}

/* Center: Controls & Scrubber */
.player-center {
  width: 40%;
  max-width: 650px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 22px;
}

.player-controls i {
  color: #b3b3b3;
  font-size: 1.1rem;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.15s;
}
.player-controls i:hover {
  color: #ffffff;
}
.player-controls i.active {
  color: #1ed760;
}

.play-pause-btn {
  background: #ffffff;
  color: #000000 !important;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s, background-color 0.15s;
}
.play-pause-btn:hover {
  transform: scale(1.08);
  background: #1ed760;
}
.play-pause-btn i {
  color: #000000 !important;
  font-size: 1rem;
}

.player-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.progress-time {
  font-size: 0.75rem;
  color: #b3b3b3;
  min-width: 36px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.progress-bar {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  transition: height 0.15s;
}
.progress-bar:hover {
  height: 6px;
}
.progress-bar::after {
  content: '';
  position: absolute;
  top: -8px;
  bottom: -8px;
  left: 0;
  right: 0;
}
.progress-fill {
  height: 100%;
  background: #ffffff;
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}
.progress-bar:hover .progress-fill {
  background: #1ed760;
}

/* Right: Tools & Volume */
.player-right {
  width: 30%;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 18px;
}

.player-right i {
  color: #b3b3b3;
  cursor: pointer;
  font-size: 1.1rem;
  transition: color 0.2s;
}
.player-right i:hover {
  color: #ffffff;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.volume-bar-container {
  width: 90px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  transition: height 0.15s;
}
.volume-bar-container:hover {
  height: 6px;
}
.volume-bar-container::after {
  content: '';
  position: absolute;
  top: -8px;
  bottom: -8px;
  left: 0;
  right: 0;
}
.volume-bar-fill {
  height: 100%;
  background: #ffffff;
  border-radius: 2px;
  width: 70%;
}
.volume-bar-container:hover .volume-bar-fill {
  background: #1ed760;
}

/* ==========================================================================
   MODAL DIALOG (ADD CUSTOM TRACK / STREAM)
   ========================================================================== */
.djq-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.djq-modal {
  background: #181818;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 30px;
  width: 92%;
  max-width: 520px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  color: #ffffff;
}

.djq-modal h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0;
}

.djq-modal-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 20px;
}

.djq-modal-form label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #b3b3b3;
  margin-bottom: 6px;
  display: block;
}

.djq-modal-form input {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 0.9rem;
  outline: none;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.djq-modal-form input:focus {
  border-color: #1ed760;
  background: rgba(255, 255, 255, 0.12);
}

.djq-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 10px;
}

.djq-btn-secondary {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 9px 20px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}
.djq-btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

.djq-btn-primary {
  background: #1ed760;
  border: none;
  color: #000000;
  padding: 9px 22px;
  border-radius: 20px;
  font-weight: 800;
  font-size: 0.85rem;
  cursor: pointer;
  transition: transform 0.15s, background 0.2s;
}
.djq-btn-primary:hover {
  background: #22c55e;
  transform: scale(1.04);
}
