:root {
  --spotify-green: #1db954;
  --spotify-green-hover: #1ed760;
  --spotify-black: #000000;
  --spotify-base: #121212;
  --spotify-highlight: #1a1a1a;
  --spotify-elevated: #242424;
  --spotify-text: #ffffff;
  --spotify-text-secondary: #b3b3b3;
  --spotify-divider: rgba(255, 255, 255, 0.1);
  --player-height: 90px;
  --sidebar-width: 240px;
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--spotify-black);
  color: var(--spotify-text);
  overflow: hidden;
}

::-webkit-scrollbar {
  width: 12px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  border: 3px solid var(--spotify-base);
}
::-webkit-scrollbar-thumb:hover {
  background-color: rgba(255, 255, 255, 0.5);
}

.spotify-layout {
  display: flex;
  height: calc(100vh - var(--player-height));
}

.sidebar {
  width: var(--sidebar-width);
  background-color: var(--spotify-black);
  display: flex;
  flex-direction: column;
  padding: 24px 12px;
  flex-shrink: 0;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 32px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links {
  list-style: none;
  margin-bottom: 24px;
}

.nav-links li a {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--spotify-text-secondary);
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  padding: 12px;
  border-radius: 4px;
  transition: color 0.2s;
}

.nav-links li a:hover,
.nav-links li a.active {
  color: var(--spotify-text);
}

.library-section {
  flex: 1;
  background-color: var(--spotify-base);
  border-radius: 8px;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.library-header {
  color: var(--spotify-text-secondary);
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 0 8px;
}

.library-links {
  margin-bottom: 16px;
}

.upload-wrapper {
  margin-bottom: 16px;
}

#filePicker {
  display: none;
}

.upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background-color: var(--spotify-elevated);
  color: var(--spotify-text);
  padding: 10px 16px;
  border-radius: 500px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background-color 0.2s,
    transform 0.1s;
}

.upload-btn:hover {
  background-color: #2a2a2a;
  transform: scale(1.02);
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.btn-action {
  background-color: transparent;
  border: 1px solid var(--spotify-divider);
  color: var(--spotify-text-secondary);
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.btn-action:hover {
  color: var(--spotify-text);
  border-color: var(--spotify-text-secondary);
  background-color: rgba(255, 255, 255, 0.05);
}

.external-imports {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.external-imports .btn-action {
  flex: 1;
  justify-content: center;
}

.btn-yt:hover {
  color: #ff0000;
  border-color: #ff0000;
}
.btn-sc:hover {
  color: #ff5500;
  border-color: #ff5500;
}

.status-text {
  font-size: 12px;
  color: var(--spotify-text-secondary);
  text-align: center;
  padding: 8px;
  margin-top: auto;
}

.main-view {
  flex: 1;
  background-color: var(--spotify-base);
  border-radius: 8px;
  margin: 8px 8px 8px 0;
  overflow-y: auto;
  position: relative;
  background: linear-gradient(to bottom, #4a4a4a 0%, var(--spotify-base) 300px);
}

.playlist-header {
  display: flex;
  align-items: flex-end;
  gap: 24px;
  padding: 40px 24px 24px;
}

.playlist-art {
  width: 232px;
  height: 232px;
  background: linear-gradient(135deg, #282828, #181818);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  color: var(--spotify-text-secondary);
  overflow: hidden;
}

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

.playlist-info {
  display: flex;
  flex-direction: column;
}

.playlist-type {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.playlist-title {
  font-size: 4rem;
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 16px;
  letter-spacing: -0.04em;
}

.playlist-desc {
  color: var(--spotify-text-secondary);
  font-size: 14px;
}

.content-spacing {
  padding: 0 24px 32px;
  background: rgba(0, 0, 0, 0.2);
  min-height: 100%;
}

.action-bar {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 24px 0;
}

.btn-play-large {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--spotify-green);
  color: var(--spotify-black);
  border: none;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition:
    transform 0.2s,
    background-color 0.2s;
}

.btn-play-large:hover {
  transform: scale(1.05);
  background-color: var(--spotify-green-hover);
}

.btn-icon {
  background: transparent;
  border: none;
  color: var(--spotify-text-secondary);
  font-size: 32px;
  cursor: pointer;
  transition: color 0.2s;
}

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

.current-album-text {
  font-size: 14px;
  font-weight: 700;
  color: var(--spotify-text-secondary);
}

.search-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  max-width: 300px;
}

.search-input-wrapper i {
  position: absolute;
  left: 12px;
  color: var(--spotify-text-secondary);
  font-size: 14px;
}

.search-filters input {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--spotify-text);
  padding: 10px 16px 10px 36px;
  border-radius: 500px;
  font-size: 13px;
  font-family: inherit;
}

.search-filters input:focus {
  outline: none;
  background-color: rgba(255, 255, 255, 0.2);
}

.btn-clear {
  background: transparent;
  border: none;
  color: var(--spotify-text-secondary);
  font-size: 16px;
  cursor: pointer;
  padding: 0 8px;
}

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

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

.table th {
  color: var(--spotify-text-secondary);
  font-weight: 400;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--spotify-divider);
}

.table td {
  padding: 8px 16px;
  font-size: 14px;
  color: var(--spotify-text-secondary);
  vertical-align: middle;
}

.table tr {
  border-radius: 4px;
  transition: background-color 0.2s;
}

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

.table tbody tr:hover td {
  color: var(--spotify-text);
}

.table tbody tr.album-highlight {
  background-color: rgba(255, 255, 255, 0.15);
}

.table tbody tr.album-highlight .track-name {
  color: var(--spotify-green);
}

.col-num {
  width: 40px;
  text-align: center;
}
.col-title {
  width: 45%;
}
.col-album {
  width: 30%;
}
.col-like {
  width: 40px;
  text-align: center;
}
.col-duration {
  width: 10%;
  text-align: right;
}

.table td:last-child {
  text-align: right;
}

.track-num-col {
  position: relative;
  text-align: center;
}

.track-num {
  display: block;
}

.play-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--spotify-text);
  font-size: 14px;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.table tbody tr:hover .track-num {
  display: none;
}
.table tbody tr:hover .play-btn {
  display: block;
}

.track-title-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.track-name {
  color: var(--spotify-text);
  font-size: 16px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-artist {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-heart {
  background: transparent;
  border: none;
  color: var(--spotify-text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition:
    color 0.2s,
    transform 0.1s;
}
.btn-heart:hover {
  color: var(--spotify-text);
  transform: scale(1.1);
}
.btn-heart.liked {
  color: var(--spotify-green);
}

.empty-state {
  text-align: center !important;
  padding: 40px !important;
  color: var(--spotify-text-secondary);
}

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

.grid-item {
  background-color: var(--spotify-elevated);
  padding: 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  display: flex;
  flex-direction: column;
}

.grid-item:hover {
  background-color: #333;
}

.grid-item-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 16px;
  background-color: #282828;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--spotify-text-secondary);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.grid-item-img.artist-img {
  border-radius: 50%;
}

.grid-item-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--spotify-text);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid-item-subtitle {
  font-size: 14px;
  color: var(--spotify-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-playing-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--player-height);
  background-color: #181818;
  border-top: 1px solid #282828;
  padding: 0 16px;
  z-index: 1000;
  display: none;
}

.now-playing-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.now-playing-info {
  display: flex;
  align-items: center;
  width: 30%;
  min-width: 180px;
}

.album-art-placeholder {
  width: 56px;
  height: 56px;
  background: #282828;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 14px;
  color: var(--spotify-text-secondary);
  overflow: hidden;
}

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

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

.song-title {
  font-size: 14px;
  color: var(--spotify-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.song-artist {
  font-size: 12px;
  color: var(--spotify-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playback-controls-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 40%;
  max-width: 722px;
}

.playback-controls-main {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 8px;
}

.btn-control {
  background: transparent;
  border: none;
  color: var(--spotify-text-secondary);
  font-size: 16px;
  cursor: pointer;
  transition: color 0.2s;
}

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

.btn-play-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--spotify-text);
  color: var(--spotify-black);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s;
}

.btn-play-circle:hover {
  transform: scale(1.06);
}

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

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

.progress-bar {
  flex: 1;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.progress-fill {
  height: 100%;
  background-color: var(--spotify-text);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

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

.extra-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 30%;
  min-width: 180px;
  gap: 16px;
  color: var(--spotify-text-secondary);
}

.volume-bar {
  width: 90px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.volume-fill {
  width: 50%;
  height: 100%;
  background-color: var(--spotify-text);
  border-radius: 2px;
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  .main-view {
    margin: 0;
    border-radius: 0;
  }
  .playlist-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .playlist-title {
    font-size: 3rem;
  }
  .col-album {
    display: none;
  }
  .now-playing-info {
    width: auto;
    flex: 1;
  }
  .extra-controls {
    display: none;
  }
  .playback-controls-container {
    width: auto;
    flex: 2;
  }
}
