:root {
  --primary-color: #6a11cb;
  --secondary-color: #2575fc;
  --text-color: #f8f9fa;
  --bg-color: #121212;
  --card-bg: rgba(255, 255, 255, 0.08);
  --hover-color: rgba(255, 255, 255, 0.15);
  --progress-color: #4a00e0;
  --spotify-green: #1DB954;
  --dark-gray: #535353;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
}

.container {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr auto;
  height: 100vh;
  overflow: hidden;
  position: relative;
}
.logo-container {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
}
.logo {
  width: 40px;
  height: 40px;
  margin-right: 10px;
  border-radius: 50%;
}
.sidebar h1 {
  font-size: 1.7rem;
  font-family: 'Lobster', sans-serif;;
  font-weight: 700;
}

.mobile-bottom-menu {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #000;
  z-index: 1000;
  padding: 10px 0;
  border-top: 1px solid var(--dark-gray);
}

.mobile-bottom-menu .menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-color);
  font-size: 12px;
  cursor: pointer;
  padding: 5px 0;
}

.mobile-bottom-menu .menu-item i {
  font-size: 20px;
  margin-bottom: 5px;
}

.mobile-search-container {
  position: fixed;
  top: -60px;
  left: 0;
  right: 0;
  background-color: #000;
  padding: 10px 15px;
  z-index: 1001;
  transition: top 0.3s ease;
  display: none;
}

.mobile-search-container.active {
  top: 0;
}

#mobile-search-form {
  position: relative;
  width: 100%;
}

#mobile-search-input {
  width: 100%;
  padding: 8px 16px 8px 16px;
  border-radius: 18px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 14px;
  outline: none;
}

#close-mobile-search {
  position: absolute;
  font-size: 25px;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}

.main-content {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
  padding: 10px 10px;
}

.header {
  display: flex;
  justify-content: center;
  padding: 16px 32px;
  background-color: rgba(0, 0, 0, 0.6);
  position: sticky;
  top: 0;
  z-index: 10;
}

.search-container {
  display: flex;
  justify-content:space-between;
  align-items: center;
}

#search-form {
  position: relative;
  width: 70%;
}
#search-form i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #b3b3b3;
}

#live {
  width: 100%;
  padding: 12px 20px 12px 40px;
  border-radius: 50px;
  border: none;
  background-color: #282828;
  color: #ffffff;
  font-size: 17px;
  line-height: 1.4;
  box-sizing: border-box;
}

#live:focus {
  outline: none;
  background-color: #3e3e3e;
}

#live::placeholder {
  color: rgba(255, 255, 255, 0.5);
}
.status{
  background: var(--secondary-color);
  color: var(--text-color);
  border: none;
  padding: 5px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: bold;
  transition: all 0.3s;
}
.user{
  display: flex;
  flex-direction: column;
}
.user-menu {
  display: flex;
  align-items: center;
}
.username {
  margin-right: 15px;
  font-size: 0.9rem;
  color: #ffffff;
}
.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: #535353;
  margin-left: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.content {
  flex: 1;
  padding: 5px 5px;
  min-height: 0;
  padding-bottom: 150px;
}

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

#song-list li {
  background-color: var(--card-bg);
  padding: 16px;
  border-radius: 6px;
  transition: all 0.3s ease;
  cursor: pointer;
  list-style: none;
  position: relative;
  display: flex;
  align-items: center;
}

#song-list li:hover {
  background-color: var(--hover-color);
}

#song-list li.active {
  background-color: var(--hover-color);
}

#song-list li .song-icon {
  margin-right: 12px;
  font-size: 16px;
}

#song-list li .song-name {
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#song-list li .fa-heart {
  margin-left: 12px;
  color: rgba(255, 255, 255, 0.3);
  transition: all 0.2s ease;
}

#song-list li .fa-heart.liked {
  color: var(--spotify-green);
}

#song-list li .fa-heart:hover {
  transform: scale(1.1);
}

#song-list li.error,
#song-list li.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 20px;
  color: rgba(255, 255, 255, 0.5);
  background: none;
  cursor: default;
}

.player {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: transform 0.3s ease;
}
.player.active {
  display: block;
}

.mobile-player{
  margin-left: 5px;
  margin-right: 5px;
}

.player-expanded {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: rgb(96, 56, 48);
  height: 100%;
  margin-bottom: -75px;
  margin-left: -5px;
  margin-right: -5px;
  color: white;
}

.player-minimized {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  border-radius: 12px;
  background-color: rgb(96, 56, 48);
}

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

.expanded-header i {
  font-size: 20px;
  cursor: pointer;
}

.expanded-album-art {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

.expanded-album-art img {
  width: 80%;
  max-width: 300px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.expanded-song-info {
  text-align: center;
  margin: 20px 0;
}

.expanded-song-info h4 {
  font-size: 24px;
  margin-bottom: 5px;
}

.expanded-song-info p {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
}

.expanded-progress {
  width: 100%;
  margin: 20px 0;
}

.expanded-progress .progress-bar {
  width: 100%;
  height: 4px;
  background-color: var(--dark-gray);
  border-radius: 2px;
  margin-bottom: 10px;
}

.expanded-progress .time-display {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.expanded-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 30px;
}

.expanded-controls button {
  background: none;
  border: none;
  color: white;
  font-size: 30px;
  cursor: pointer;
}

.expanded-controls #expanded-play-btn {
  background-color: white;
  color: black;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 24px;
}

.minimized-song-info {
  display: flex;
  align-items: center;
  flex: 1;
}

.minimized-song-info img {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  margin-right: 10px;
}

.minimized-song-details h4 {
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.minimized-song-details p {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.minimized-controls {
  display: flex;
  align-items: center;
}

.minimized-controls button {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  margin-left: 15px;
  cursor: pointer;
}

.minimized-controls #minimized-play-btn {
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 30px;
}

.footer {
  background-color: rgba(0, 0, 0, 0.3);
  padding: 2rem;
  text-align: center;
  border-top: 1px solid var(--dark-gray);
  margin-top: 50px;
  padding-bottom: 100px;
  width: 100%;
}

.random-play {
  background: var(--secondary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 20px;
  margin: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.random-play:hover {
  transform: scale(1.05);
}
.most-played-container {
  margin: 20px 0;
  padding: 15px;
  background: var(--card-bg);
  border-radius: 8px;
}

.most-played-container h2 {
  margin-bottom: 10px;
  font-size: 18px;
  color: var(--secondary-color);
}

#most-played-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
}

#most-played-list li:last-child {
  border-bottom: none;
}

#most-played-list li span {
  color: var(--text-color);
}

.icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.icons img {
  width: 32px;
  height: 32px;
  transition: all 0.2s ease;
}

.icons img:hover {
  transform: scale(1.1);
}

.footer p {
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.7);
}

.footer a {
  color: var(--secondary-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

.footer a:hover {
  text-decoration: underline;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  backdrop-filter: blur(5px);
  display: none;
}

.popup {
  background: white;
  margin-top: -70%;
  padding: 2rem 3rem;
  border-radius: 15px;
  color: black;
  text-align: center;
  font-size: larger;
  font-weight: bold;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@media (max-width: 576px) {
  .content {
    padding-bottom: 210px;
  }

  .mobile-player {
    margin-left: 5px;
    margin-right: 5px;
    margin-bottom: 0; /* Remove problematic margin */
  }
  .player.active {
    bottom: 75px; /* Matches mobile menu height */
  }
  .content {
    padding-bottom: 120px; /* Player (60px) + Menu (60px) */
  }
  .player.active.player-expanded-open {
    bottom: 0;
  }

  .header {
    display: none;
  }
  
  .mobile-bottom-menu {
    display: flex;
    justify-content: space-around;
  }
  #song-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: none;
    border-radius: 0;
}

#song-list li .fa-heart {
    font-size: 16px;
}

#song-list li .song-info {
    flex: 1;
    overflow: hidden;
}

#song-list li .song-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#song-list li .song-artist {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#song-list li .song-duration {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin: 0 12px;
}

#song-list li .song-actions {
    color: rgba(255,255,255,0.7);
}

#song-list li.active .song-title {
    color: var(--secondary-color);
}
  
  #song-list li .fa-link {
    margin-left: 12px;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.2s ease;
  }
  
  #song-list li .fa-link:hover {
    color: var(--secondary-color)
  }
  #song-list li:active {
    background-color: var(--hover-color);
  }

  #song-list li .song-info {
    flex: 1;
    overflow: hidden;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
  }

  #song-list li .song-title {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #song-list li .song-artist {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #song-list li .song-duration {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin: 0 12px;
  }

  #song-list li .song-actions {
    color: rgba(255,255,255,0.7);
  }

  #song-list li.active .song-title {
    color: var(--secondary-color);
  }

  .player.player-expanded-open .player-expanded {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    margin: 0;
    border-radius: 0;
  }
  
  .player.player-expanded-open .player-minimized {
    display: none;
  }
  
  .player:not(.player-expanded-open) .player-expanded {
    display: none;
  }
  
  .player:not(.player-expanded-open) .player-minimized {
    display: flex;
  }

  .song-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .footer{
    padding-bottom: 150px;
  }

  #song-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    background: none;
    border-radius: 0;
  }

  /* Remove the song icon and other elements 
  #song-list li .fa-heart,
  */
  #song-list li .song-icon {
    display: none;
  }
  
  .song-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
  .expanded-header .fa-link {
    font-size: 20px;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 15px;
  }
  
  .expanded-header .fa-link:hover {
    color: var(--secondary-color);
  }
  .popup {
    background: white;
    margin-top: -100%;
    padding: 2rem 3rem;
    border-radius: 15px;
    color: black;
    text-align: center;
    font-size: medium;
    font-weight: bold;
  }
}
.sidebar {
  display: none;
  background-color: rgba(0, 0, 0, 0.6);
  width: 200px;
  padding: 20px 0;
}

.song-action-menu {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    border-radius: 8px;
    padding: 8px 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    min-width: 150px;
    z-index: 1001;
}

.song-action-menu .menu-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
}

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

.song-action-menu .menu-item i {
    margin-right: 12px;
    width: 16px;
    text-align: center;
}

.song-action-menu .menu-item .fa-heart {
    color: var(--spotify-green);
}

@media (min-width: 577px) {
  .container {
    grid-template-columns: 200px 1fr;
  }
  
  .sidebar {
    display: block;
  }
  
  .menu-item {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
  }
  
  .menu-item:hover {
    background-color: var(--hover-color);
  }
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 22%;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--secondary-color);
  color: black;
  padding: 10px 20px;
  width: fit-content;
  border-radius: 20px;
  z-index: 2000;
  display: none;
  font-size: 16px;
  font-weight: bold;
}

.desktop-player {
  display: none;
  grid-column: 1 / -1;
  background-color: rgb(96, 56, 48);
  border-top: 1px solid var(--dark-gray);
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  height: 80px;
  width: 100%;
}

.song-info {
  display: flex;
  align-items: center;
  width: 25%;
  min-width: 200px;
}

.song-info img {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  margin-right: 16px;
  object-fit: cover;
}

.song-details h4 {
  font-size: 14px;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.song-details p {
  font-size: 12px;
  color: var(--text-color);
  opacity: 0.7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 150px;
}

.like {
  background: none;
  border: none;
  color: var(--text-color);
  margin-left: 16px;
  cursor: pointer;
  opacity: 0.7;
  font-size: 16px;
}

.like:hover {
  opacity: 1;
}

.like.liked {
  color: var(--spotify-green);
  opacity: 1;
}

.player-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 50%;
}

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

.controls button {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 16px;
  margin: 0 12px;
  cursor: pointer;
}

.controls button:hover {
  color: var(--secondary-color);
}

.controls #desktop-play-btn {
  background-color: var(--text-color);
  color: var(--bg-color);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.controls #desktop-play-btn:hover {
  transform: scale(1.05);
  background-color: var(--secondary-color);
  color: white;
}

.progress-bar {
  display: flex;
  align-items: center;
  width: 100%;
}

.progress-bar .time {
  font-size: 12px;
  color: var(--text-color);
  opacity: 0.7;
  width: 40px;
}

.progress-bar .bar {
  flex: 1;
  height: 4px;
  background-color: var(--dark-gray);
  border-radius: 2px;
  margin: 0 8px;
  cursor: pointer;
  -webkit-appearance: none;
}

.progress-bar .bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background-color: var(--text-color);
  border-radius: 50%;
  cursor: pointer;
}

.volume-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  width: 25%;
}

.volume-controls #desktop-sound-btn {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 16px;
  margin-right: 8px;
  cursor: pointer;
}

.volume-controls #desktop-volume-bar {
  width: 100px;
  height: 4px;
  background-color: var(--dark-gray);
  border-radius: 2px;
  cursor: pointer;
  -webkit-appearance: none;
}

.volume-controls #desktop-volume-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background-color: var(--text-color);
  border-radius: 50%;
  cursor: pointer;
}

.shuffle.active, .repeat.active {
  color: var(--spotify-green);
}

@media (min-width: 577px) {
  .desktop-player {
    display: flex;
  }
  
  .mobile-player {
    display: none;
  }
  
  .player.player-expanded-open .player-expanded {
    display: none;
  }
}

@media (max-width: 576px) {
  .desktop-player {
    display: none;
  }
  
  .mobile-player {
    display: block;
  }
  
  .player-minimized {
    display: flex;
  }
  
  .player-expanded {
    display: none;
  }
  
  .player.player-expanded-open .player-expanded {
    display: flex;
  }
  
  .player.player-expanded-open .player-minimized {
    display: none;
  }
  
  #minimized-expand-btn {
    display: block;
  }
  
  #minimized-like-btn {
    display: block;
  }
}

.minimized-controls .like {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  margin-left: 15px;
}

.minimized-controls .like.liked {
  color: var(--spotify-green);
}

.expanded-header .fa-heart {
  font-size: 20px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
}

.expanded-header .fa-heart.liked {
  color: var(--spotify-green);
}