:root {
  --spotify-black: #000000;
  --spotify-dark: #0b0b0b;
  --spotify-bg: #121212;
  --spotify-surface: #181818;
  --spotify-elevated: #282828;
  --spotify-text: #ffffff;
  --spotify-muted: #b3b3b3;
  --spotify-green: #1ed760;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* ===== SCROLLBARS ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

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

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
}

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

html, body {
  width: 100%;
  height: 100%;
  background: var(--spotify-black);
  color: var(--spotify-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow: hidden;
}

button {
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

.app-frame {
  display: grid;
  grid-template-rows: 1fr 90px;
  height: 100vh;
  gap: 8px;
  padding: 8px;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width, 320px) 3px 1fr 300px;
  gap: 8px;
  min-height: 0;
}

.resizer {
  cursor: col-resize;
  transition: background-color 0.2s;
}
.resizer:hover {
  background-color: var(--spotify-green);
}

/* ===== LEFT SIDEBAR ===== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.sidebar-panel {
  background: var(--spotify-surface);
  border-radius: 8px;
}

.nav-panel {
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.library-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  gap: 8px;
  min-height: 0;
}

.library-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}

.library-content .sidebar-section {
  margin-top: 0;
}
.sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spotify-icon {
  font-size: 28px;
  color: var(--spotify-muted);
}

.sidebar-search {
  position: relative;
}

.sidebar-search input {
  width: 100%;
  padding: 10px 12px 10px 36px;
  background: var(--spotify-elevated);
  border: none;
  border-radius: 20px;
  color: var(--spotify-text);
  font-size: 14px;
}

.sidebar-search input::placeholder {
  color: var(--spotify-muted);
}

.sidebar-search input:focus {
  outline: none;
  border: 1px solid var(--spotify-muted);
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--spotify-muted);
  font-size: 14px;
}

.sidebar-section {
  margin-top: 12px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--spotify-muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
}

.playlists-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.library-panel {
  background: var(--spotify-sidebar);
  padding: 14px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
}
.sidebar-item {
  padding: 8px;
  background: none;
  border: none;
  color: var(--spotify-muted);
  text-align: left;
  cursor: pointer;
  border-radius: 6px;
  transition: background-color 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.sidebar-item:hover {
  color: var(--spotify-text);
  background: var(--spotify-elevated);
}
.playlist-link.active {
  color: var(--spotify-text);
  background: var(--spotify-elevated);
}
.sidebar-item-artwork {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 4px;
  background-color: var(--spotify-elevated);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}
.sidebar-item-text {
  overflow: hidden;
}

.album-link {
  /* Override playlist-link's muted color */
  color: var(--spotify-text);
}

.sidebar-item-title {
  color: var(--spotify-text);
  font-size: 16px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-item-subtitle {
  font-size: 12px;
  color: var(--spotify-muted) !important;
  transition: color 0.2s;
}

.album-link:hover .sidebar-item-subtitle {
  color: var(--spotify-text);
}

/* ===== MAIN CONTENT ===== */
.main-content {
  background: linear-gradient(180deg, #2a2a2a 0%, #121212 40%);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  position: relative;
  animation: fadeIn 0.3s ease-out;
}

.audio-visualizer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 250px;
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
  mix-blend-mode: screen;
}

.audio-visualizer.active {
  opacity: 0.15;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  gap: 16px;
  background: rgba(18, 18, 18, 0.6);
  position: relative;
  z-index: 10;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.main-view {
  position: relative;
  z-index: 1;
}

.topbar-left,
.topbar-right {
  display: flex;
  gap: 8px;
  align-items: center;
}
.topbar-search {
  position: relative;
  flex: 1;
  max-width: 480px; /* Bigger search bar container */
}
.topbar-search input {
  width: 100%;
  height: 48px;
  padding: 10px 16px 10px 48px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 20px;
  color: var(--spotify-text);
  font-size: 14px;
}

.topbar-search input::placeholder {
  color: var(--spotify-muted);
}

.topbar-search input:focus {
  outline: none;
  box-shadow: 0 0 0 2px var(--spotify-green);
}

/* Subtly scale artwork on hover */
.track-row-artwork, .queue-item-artwork, .sidebar-item-artwork {
  transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.6s ease-in-out !important;
}
.tracks-table tbody tr:hover .track-row-artwork {
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}
.queue-item:hover .queue-item-artwork {
  transform: scale(1.1);
}
.sidebar-item:hover .sidebar-item-artwork {
  transform: scale(1.05);
}

.topbar-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--spotify-muted);
  font-size: 16px;
  pointer-events: none;
}

.autocomplete-results {
  position: absolute;
  top: 100%;
  width: 100%;
  background: var(--spotify-elevated);
  border-radius: 6px;
  margin-top: 6px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.3);
  z-index: 100;
  max-height: 50vh;
  overflow-y: auto;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  cursor: pointer;
}

.autocomplete-item:hover {
  background: rgba(255,255,255,0.1);
}

.autocomplete-artwork {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background-color: var(--spotify-elevated);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.autocomplete-subtitle {
  font-size: 12px;
  color: var(--spotify-muted);
  text-transform: capitalize;
}

.autocomplete-item-none {
  padding: 16px;
  color: var(--spotify-muted);
  text-align: center;
}

.autocomplete-item-none strong {
  color: var(--spotify-text);
  font-weight: 500;
}

.topbar-icon-btn {
  background: transparent;
  border: none;
  color: var(--spotify-muted);
  font-size: 18px;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s, background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
}
.topbar-icon-btn:hover {
  color: var(--spotify-text);
  background: rgba(255, 255, 255, 0.1);
}
.topbar-icon-btn:active {
  transform: scale(0.92);
}
.topbar-icon-btn.active {
  color: var(--spotify-green);
}

.user-initial {
  width: 36px;
  height: 36px;
  background: var(--spotify-elevated);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.hero {
  padding: 40px 32px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--spotify-green) 20%, transparent) 0%, transparent 100%);
}

.hero h2 {
  font-size: 56px;
  font-weight: 900;
  margin-bottom: 8px;
  line-height: 1.1;
}

.hero-subtitle {
  color: var(--spotify-muted);
  font-size: 14px;
  margin-bottom: 24px;
}

.hero-controls {
  display: flex;
  gap: 12px;
}

.play-btn,
.shuffle-btn {
  padding: 12px 32px;
  background: var(--spotify-green);
  border: none;
  border-radius: 24px;
  color: var(--spotify-black);
  font-weight: 700;
  cursor: pointer;
  font-size: 16px;
  transition: transform 0.2s, background-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-btn:hover {
  transform: scale(1.04);
  filter: brightness(1.1);
}

.shuffle-btn {
  background: transparent;
  border: 1px solid var(--spotify-muted);
  color: var(--spotify-text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.shuffle-btn:hover {
  border-color: var(--spotify-text);
  color: var(--spotify-text);
}

.content-area {
  flex: 1;
  overflow-y: auto;
  padding: 0 32px 32px;
  min-height: 0;
}

.table-container {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  overflow: hidden;
}

.tracks-table {
  width: 100%;
  border-collapse: collapse;
}

.tracks-table thead {
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid var(--spotify-elevated);
}

.tracks-table th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--spotify-muted);
}

.col-num {
  width: 50px;
}

.track-equalizer {
  display: none;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 14px;
  width: 14px;
}

.eq-bar {
  width: 2px;
  background-color: var(--spotify-green);
  animation: equalize 1s ease-in-out infinite;
}

.eq-bar:nth-child(1) { animation-delay: 0.0s; }
.eq-bar:nth-child(2) { animation-delay: 0.3s; animation-duration: 0.9s; }
.eq-bar:nth-child(3) { animation-delay: 0.1s; animation-duration: 1.1s; }
.eq-bar:nth-child(4) { animation-delay: 0.4s; animation-duration: 0.8s; }

@keyframes equalize {
  0%, 100% { height: 2px; }
  50% { height: 14px; }
}

.track-play-icon {
  display: none;
  color: var(--spotify-text);
  font-size: 14px;
  cursor: pointer;
}

.tracks-table tbody tr:hover .track-index {
  display: none;
}

.tracks-table tbody tr:hover .track-play-icon {
  display: inline-block;
}

.tracks-table tbody tr.playing .track-index {
  display: none;
}

.tracks-table tbody tr.playing .track-equalizer {
  display: flex;
}

.tracks-table tbody tr.playing:hover .track-equalizer {
  display: none;
}

.tracks-table tbody tr.paused .eq-bar {
  animation: none;
  height: 2px;
}

.tracks-table tbody tr.playing .track-play-icon {
  color: var(--spotify-green);
}

.col-title {
  flex: 1;
}

.track-title-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.track-row-artwork {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background-color: var(--spotify-elevated);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

.track-title-wrapper {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.track-title-text {
  color: var(--spotify-text);
  font-size: 15px;
}

.track-artist-text {
  color: var(--spotify-muted);
  font-size: 13px;
}

.col-album {
  width: 30%;
}

.col-duration {
  width: 120px;
}

.tracks-table th.col-duration {
  text-align: right;
  padding-right: 48px;
}

.tracks-table td.col-duration {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.track-options-btn {
  opacity: 0;
  background: transparent;
  border: none;
  color: var(--spotify-muted);
  cursor: pointer;
  font-size: 16px;
}

.tracks-table tbody tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background-color 0.2s;
}

.tracks-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.08);
}

.tracks-table tbody tr:hover .track-options-btn {
  opacity: 1;
}

.track-options-btn:hover {
  color: var(--spotify-text);
}

.tracks-table td {
  padding: 12px 16px;
  font-size: 14px;
}

/* ===== COMPACT MODE ===== */
.tracks-table.compact-mode td {
  padding: 6px 16px;
}
.tracks-table.compact-mode .track-row-artwork {
  width: 32px;
  height: 32px;
}
.tracks-table.compact-mode .track-title-text {
  font-size: 14px;
}

.hero-card,
.subpanel,
.current-track-card,
.playlist-card,
/* === Old component styles removed - using new 3-column layout === */


.album-name,
.album-artist,
.player-title,
#playerMeta {
  margin: 0;
}

.album-name {
  font-size: 0.95rem;
  font-weight: 700;
}

.album-artist {
  font-size: 0.85rem;
}

.table-wrap {
  margin: 0 12px;
  overflow: auto;
  background: rgba(0, 0, 0, 0.06);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
}

thead th {
  padding: 0 16px 10px;
  text-align: left;
  color: var(--spotify-muted);
  font-size: 0.75rem;
  font-weight: 500;
  border-bottom: 1px solid var(--spotify-line);
}

tbody td {
  padding: 10px 16px;
  vertical-align: middle;
}

/* === Old track-row styles removed - using new tracks-table === */


.track-trigger {
  width: 100%;
  padding: 0;
  border: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.track-art {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  background: linear-gradient(135deg, #5b5b5b, #1c1c1c);
  flex: none;
}

.track-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.track-copy strong {
  font-size: 0.94rem;
  font-weight: 500;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 290px;
}

.mini-button {
  padding: 8px 10px;
}

.icon-mini {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.icon-mini.active {
  color: #8ef0af;
  background: rgba(30, 215, 96, 0.16);
}

.playlist-select {
  min-width: 150px;
  background: #2a2a2a;
}

.split-layout {
  padding: 0 12px;
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 16px;
}

.subpanel {
  padding: 18px;
  background: rgba(0, 0, 0, 0.18);
}

.form-stack textarea {
  min-height: 96px;
  resize: vertical;
}

.primary-button {
  width: 100%;
  padding: 12px 18px;
  border-radius: var(--radius-pill);
  background: var(--spotify-green);
  color: #000000;
  font-weight: 700;
  cursor: pointer;
}

.playlist-card {
  display: grid;
  gap: 10px;
}

.playlist-card-main {
  width: 100%;
  padding: 0;
  text-align: left;
  cursor: pointer;
}

.playlist-card-main strong,
.queue-copy strong {
  display: block;
}

/* ===== RIGHT SIDEBAR ===== */
.sidebar-right {
  background: var(--spotify-surface);
  border-radius: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.queue-header h3 {
  font-size: 16px;
  font-weight: 700;
}

.now-playing-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideUp 0.4s ease-out;
}

.now-playing-cover {
  width: 100%;
  aspect-ratio: 1;
  background: var(--spotify-elevated);
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  transition: opacity 0.6s ease-in-out;
  position: relative;
  z-index: 1;
}

.now-playing-cover::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: var(--dynamic-bg, none);
  background-size: cover;
  background-position: center;
  filter: blur(24px) saturate(1.5);
  opacity: 0.5;
  z-index: -1;
  border-radius: inherit;
  transform: scale(1.05) translateY(4px);
}

.now-playing-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.track-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow: hidden;
}

.now-playing-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-playing-artist {
  font-size: 14px;
  color: var(--spotify-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-playing-album {
  font-size: 12px;
  color: var(--spotify-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-playing-panel {
  background: var(--spotify-elevated);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideUp 0.5s ease-out;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-header h4 {
  font-size: 14px;
  font-weight: 700;
}

.control-btn {
  background: transparent;
  border: none;
  color: var(--spotify-muted);
  font-size: 16px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: color 0.2s, background-color 0.2s;
}

.control-btn:hover {
  color: var(--spotify-text);
  background: rgba(255, 255, 255, 0.1);
}

.queue-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.queue-header {
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--spotify-muted);
}

.queue-list {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  max-height: 400px;
}

.queue-item {
  padding: 8px;
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s;
  display: flex;
  align-items: center;
  gap: 12px;
}

.queue-item[draggable="true"] {
  cursor: grab;
}

.queue-item[draggable="true"]:active {
  cursor: grabbing;
}

.queue-item.dragging {
  opacity: 0.4;
  background: rgba(255, 255, 255, 0.1);
}

.queue-item.drag-over {
  border-top: 2px solid var(--spotify-green);
}

.queue-drag-handle {
  margin-left: auto;
  color: var(--spotify-muted);
  cursor: grab;
}

.queue-item-artwork {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 4px;
  background-color: var(--spotify-elevated);
  background-size: cover;
  background-position: center;
}

.queue-item-text {
  overflow: hidden;
}

.queue-item-title, .queue-item-artist {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.queue-item-index {
  font-size: 14px;
  color: var(--spotify-muted);
}

.queue-item-title {
  font-weight: 500;
}

/* ===== PLAYER FOOTER ===== */
.player-footer {
  background: rgba(18, 18, 18, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  display: grid;
  grid-template-columns: 30% 40% 30%;
  align-items: center;
  padding: 0 16px;
  height: 90px;
  z-index: 100;
}

.player-left {
  display: flex;
  align-items: center;
  min-width: 0;
}

.player-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 722px;
  width: 100%;
  margin: 0 auto;
}

.player-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}

.player-track-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-track-thumbnail {
  width: 56px;
  height: 56px;
  background: var(--spotify-elevated);
  border-radius: 4px;
  flex-shrink: 0;
  transition: opacity 0.6s ease-in-out;
  background-size: cover;
  background-position: center;
}

.player-track-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.player-track-title {
  color: var(--spotify-text);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}
.player-track-title:hover {
  text-decoration: underline;
}

.player-track-artist {
  color: var(--spotify-muted);
  font-size: 11px;
  cursor: pointer;
}
.player-track-artist:hover {
  text-decoration: underline;
  color: var(--spotify-text);
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.player-btn {
  background: transparent;
  border: none;
  color: var(--spotify-muted);
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s;
}

.player-btn:hover {
  color: var(--spotify-text);
}

.player-btn:active {
  transform: scale(0.92);
}

.play-pause-btn {
  width: 32px;
  height: 32px;
  background: var(--spotify-text);
  color: var(--spotify-black);
  border-radius: 50%;
  font-size: 14px;
  transition: transform 0.2s;
}

.play-pause-btn:hover {
  color: var(--spotify-black);
  transform: scale(1.05);
}

.play-pause-btn:active {
  transform: scale(0.98) !important;
}

.playback-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.player-time {
  font-size: 11px;
  color: var(--spotify-muted);
  min-width: 40px;
  text-align: center;
}

.progress-bar-container {
  height: 12px;
  width: 100%;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.progress-bar {
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.progress-bar-container:hover .progress-fill {
  background: var(--spotify-green);
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--spotify-text);
  border-radius: 2px;
  position: relative;
}

.progress-fill::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background-color: var(--spotify-text);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  display: none;
}

.progress-bar-container:hover .progress-fill::after {
  display: block;
}

.player-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 125px;
}

.volume-slider {
  height: 12px;
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  position: relative;
}

.volume-slider::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.volume-fill {
  height: 4px;
  width: 100%;
  background: var(--spotify-text);
  border-radius: 2px;
  position: relative;
  z-index: 1;
  transition: width 0.1s ease-out;
}

.volume-fill::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background-color: var(--spotify-text);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  display: none;
}

.player-volume:hover .volume-fill {
  background: var(--spotify-green);
}

.player-volume:hover .volume-fill::after {
  display: block;
}

.player-volume button {
  background: transparent;
  border: none;
  color: var(--spotify-muted);
  font-size: 16px;
  cursor: pointer;
}

.player-volume button:hover {
  color: var(--spotify-text);
}

/* ===== HOMEPAGE ===== */
.main-view {
  overflow-y: auto;
  padding: 0 24px;
}

.homepage-content {
  padding-top: 24px;
}

#greeting {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 24px;
}

.homepage-grid-section {
  margin-bottom: 32px;
}

.homepage-grid-section h2 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.homepage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
}

.homepage-card {
  background: var(--spotify-surface);
  border-radius: 8px;
  padding: 16px;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.2s;
  overflow: hidden;
  animation: slideUp 0.4s ease-out backwards;
}

.homepage-card:hover {
  background: var(--spotify-elevated);
  transform: translateY(-4px);
}

.homepage-card-artwork {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  background-color: var(--spotify-elevated);
  background-size: cover;
  background-position: center;
  margin-bottom: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.homepage-card-title {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.homepage-card-subtitle {
  font-size: 14px;
  color: var(--spotify-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 4px 12px;
  height: 48px;
  border-radius: 6px;
  color: var(--spotify-muted);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  transition: color 0.2s;
}
.sidebar-nav-item > i {
  font-size: 28px;
  width: 28px;
}

.sidebar-nav-item:hover,
.sidebar-nav-item.active {
  color: var(--spotify-text);
}

.sidebar-icon-container {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 2px;
  background: linear-gradient(135deg, #450af5, #c4efd9);
  flex-shrink: 0;
}

.empty-state {
  padding: 18px;
  background: rgba(255, 255, 255, 0.04);
}

.compact-empty {
  padding: 14px;
}

.empty-note {
  margin: 0;
  padding: 8px 4px;
}

@media (max-width: 1200px) {
  .app-shell {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .queue {
    display: none;
  }
}

@media (max-width: 860px) {
  body {
    overflow: auto;
  }

  .app-frame {
    height: auto;
    min-height: 100vh;
    grid-template-rows: auto auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    grid-template-columns: 1fr;
  }

  .icon-rail {
    display: none;
  }

  .split-layout {
    grid-template-columns: 1fr;
  }

  .player {
    grid-template-columns: 1fr;
  }

  .player-side {
    justify-self: start;
    text-align: left;
  }
}

@media (max-width: 720px) {
  .app-frame {
    padding: 0 0 92px;
    gap: 0;
  }

  .app-shell {
    gap: 0;
  }

  .panel,
  .player {
    border-radius: 0;
  }

  .topbar {
    display: grid;
    gap: 10px;
  }

  .topbar-actions {
    max-width: none;
  }

  .view-header {
    padding: 16px 16px 0;
  }

  .view-header h2 {
    font-size: 2.4rem;
  }

  .hero-card h3 {
    font-size: 2rem;
  }

  .stats,
  .dual-buttons {
    grid-template-columns: 1fr;
  }

  .player {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
  }
}

/* ===== SHORTCUTS MENU ===== */
.shortcuts-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.7);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease-out;
}

.shortcuts-modal {
  background: var(--spotify-surface);
  border-radius: 8px;
  padding: 24px;
  width: 400px;
  max-width: 90vw;
  position: relative;
  box-shadow: 0 16px 24px rgba(0, 0, 0, 0.5);
  animation: popIn 0.3s ease-out;
}

.shortcuts-modal h2 {
  font-size: 24px;
  margin-bottom: 20px;
  font-weight: 700;
}

.shortcuts-modal ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shortcuts-modal li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  color: var(--spotify-muted);
}

.shortcuts-modal li strong {
  color: var(--spotify-text);
  background: var(--spotify-elevated);
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: normal;
}

.close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  background: transparent;
  border: none;
  color: var(--spotify-muted);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: var(--spotify-text);
}

/* ===== CONTEXT MENU ===== */
.context-menu {
  position: fixed;
  background: var(--spotify-elevated);
  border-radius: 4px;
  padding: 4px;
  min-width: 180px;
  box-shadow: 0 16px 24px rgba(0,0,0,0.5);
  z-index: 1000;
  transform-origin: top left;
  animation: popIn 0.15s ease-out;
}

.context-menu-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--spotify-text);
  text-align: left;
  font-size: 14px;
  cursor: pointer;
  border-radius: 2px;
}

.context-menu-item:hover {
  background: rgba(255,255,255,0.1);
}

.context-menu-divider {
  height: 1px;
  background: rgba(255,255,255,0.1);
  margin: 4px 0;
}

.context-menu-submenu-parent {
  position: relative;
}

.context-menu-submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  background: var(--spotify-elevated);
  border-radius: 4px;
  padding: 4px;
  min-width: 160px;
  box-shadow: 0 16px 24px rgba(0,0,0,0.5);
}

.context-menu-submenu-parent:hover .context-menu-submenu {
  display: block;
}

.context-menu-text {
  padding: 10px 12px;
  color: var(--spotify-muted);
  font-size: 14px;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: var(--spotify-surface);
  padding: 24px;
  border-radius: 8px;
  width: 400px;
  max-width: 90%;
  animation: popIn 0.25s ease-out;
}

.modal-content h2 { margin-bottom: 16px; font-weight: 700; font-size: 24px; }

.modal-content input {
  width: 100%;
  padding: 12px;
  margin-bottom: 24px;
  background: rgba(255,255,255,0.1);
  border: 1px solid transparent;
  border-radius: 4px;
  color: white;
}

.modal-content input:focus { border-color: var(--spotify-muted); outline: none; }

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

.modal-actions button {
  padding: 12px 24px;
  border-radius: 24px;
  font-weight: 700;
  border: none;
  cursor: pointer;
}

/* ===== SETTINGS POPOVER ===== */
.settings-popover-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: transparent;
  z-index: 2000;
}

  .settings-popover-content {
  position: absolute;
  bottom: 100px;
  right: 24px;
  background: var(--spotify-surface);
  padding: 24px;
  border-radius: 8px;
  width: 360px;
  max-width: 90vw;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6);
  transform-origin: bottom;
  animation: slideUpPopover 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ===== SETTINGS MENU & SLIDERS ===== */
.settings-section h3 {
  font-size: 16px;
  margin-bottom: 16px;
  color: var(--spotify-text);
  border-bottom: 1px solid var(--spotify-elevated);
  padding-bottom: 8px;
}

.setting-row {
  display: grid;
  grid-template-columns: 80px 1fr 60px;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.setting-row label {
  color: var(--spotify-muted);
  font-size: 14px;
}

.eq-val {
  text-align: right;
  color: var(--spotify-muted);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.settings-select {
  background: var(--spotify-elevated);
  color: var(--spotify-text);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 8px 12px;
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}

.settings-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--spotify-green);
  cursor: pointer;
}

/* Custom Range Input */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  background: transparent;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 14px;
  width: 14px;
  border-radius: 50%;
  background: var(--spotify-text);
  cursor: pointer;
  margin-top: -5px;
}
input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  background: var(--spotify-elevated);
  border-radius: 2px;
}
input[type="range"]:focus { outline: none; }
input[type="range"]:focus::-webkit-slider-runnable-track { background: rgba(255, 255, 255, 0.3); }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes popIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideUpPopover {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
