/* Playlist Header Styling */
/* Playlist Header Styling */

.song-art-previews {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Space between album cover and fullscreen bg previews */
    flex-shrink: 0;
}

/* Container for the fullscreen background preview */
.fullscreen-bg-preview {
    width: 100%;
    height: 100%;
    background-color: #333;
    border-radius: 8px;
    overflow: hidden; /* Important for keeping video inside */
}

.fullscreen-bg-preview img,
.fullscreen-bg-preview video,
#modalSongAlbumCover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius:8px;
}

.playlist-header {
  display: grid;
  grid-template-columns: 40px 3fr 2fr 150px 50px 30px; /* # | Title/Artist | Album | Date added | Length | Threedots */
  align-items: center;
  padding: 10px 20px;
  background-color: #1F1F1F; /* Same as sidebar background */
  color: #B3B3B3; /* Lighter color for headers */
  font-weight: bold;
  position: sticky;
  top: 0;
  z-index: 10; /* Ensure it stays above list items */
  border-bottom: 1px solid #333;
}

.three-dots-button {
  background: none;
  border: none;
  color: #bbb;
  font-size: 20px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  line-height: 0;        /* So the dots stay centered */
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
  outline: none;
  min-width:28px;
}

.three-dots-button:hover {
  background-color: #333;
  color: #fff;
}

/* Ensure the playlist container has a relative position for sticky */
/* Fullscreen Background Divs */
.fullscreen-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover; /* Ensures the image covers the entire area */
  background-position: center; /* Centers the image */
  background-repeat: no-repeat; /* Prevents the image from repeating */
  opacity: 0; /* Initially hidden */
  transition: opacity 1s ease-in-out; /* Fade transition */
  z-index: -1; /* Behind the content */
}

/* Initially show bg1 and hide bg2 */
.fullscreen-background.bg1 {
  opacity: 1;
}

.fullscreen-background.bg2 {
  opacity: 0;
}

/* Reset some default styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-user-select: none;
  user-select:none;
  -webkit-touch-callout: none;
}
html, body {
margin: 0;
padding: 0;
height: 100%;
}

body {
  font-family: 'Roboto', sans-serif;
  background-color: #121212;
  color: #FFFFFF;
  height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
}

/* Top Navigation Bar */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #1F1F1F;
  padding: 8px 16px; /* Reduced padding for less height */
  border-bottom: 2px solid #333;
  position: relative;
  z-index: 100;
  height: 50px; /* Set a fixed height for the nav */
}

/* Container holding sidebar and main content */
.player-container {
  flex: 1;
  display: flex;
  overflow: hidden;
  transition: margin-left 0.3s ease;
}

/* Fullscreen Player Overlay */
.fullscreen-player {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Set Background Image */
  background-size: cover; /* Ensures the image covers the entire area */
  background-position: center; /* Centers the image */
  background-repeat: no-repeat; /* Prevents the image from repeating */
  
  /* Optional: Add a semi-transparent overlay for better text readability */
  background-color: rgba(18, 18, 18, 0.6); /* Adjust the opacity as needed */
  background-blend-mode: overlay; /* Blends the background color and image */
  color: #FFFFFF;
  display: flex;
  align-items: flex-end; /* Align content to the bottom */
  justify-content: flex-start; /* Align content to the left */
  z-index: 3000; /* Higher than existing z-index to ensure it's on top */
padding: 40px;
}

.fullscreen-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start; /* Align items to the start (left) */
  width: 100%;
  padding: 20px;
z-index:69;
}

/* Close Button */
.close-fullscreen-button {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 30px;
  cursor: pointer;
  color: #FFFFFF;
}

.close-fullscreen-button:hover {
  color: #1DB954;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Semi-transparent black */
  z-index: 900; /* Just below the sidebar's z-index */
  display: none; /* Hidden by default */
  transition: opacity 0.3s ease;
  opacity: 0;
}

/* Show Overlay */
.overlay.active {
  display: block;
  opacity: 1;
}

/* Album Art and Song Info Container */
.fullscreen-info-container {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
}

/* Album Cover */
.fullscreen-album-cover-container img {
  width: 250px;
  height: 250px;
  object-fit: cover;
  border-radius: 10px;
  margin-right: 30px;
}

/* Song Info */
#fullscreenSongInfo {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

#fullscreenSongInfo h2 {
  font-size: 36px;
  margin-bottom: 15px;
}

#fullscreenSongInfo p {
  font-size: 24px;
  color: #AAA;
}

/* Media Controls */
.fullscreen-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%; /* Take full width */
  padding: 20px 0;
}

.fullscreen-controls button {
  background: none;
  border: none;
  cursor: pointer;
  margin: 0 20px;
  width: 45px;
  height: 45px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-controls button img {
  width: 25px;
  height: 25px;
  filter: invert(100%); /* Make SVG icons white */
  transition: filter 0.3s;
}

.fullscreen-controls button:hover img {
  filter: invert(59%) sepia(29%) saturate(1078%) hue-rotate(89deg) brightness(95%) contrast(94%); /* Spotify Green */
}

.fullscreen-controls button.active img {
  filter: invert(59%) sepia(29%) saturate(1078%) hue-rotate(89deg) brightness(95%) contrast(94%); /* Spotify Green */
}

.fullscreen-control-item {
  position: relative;
}

.fullscreen-control-item .indicator {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 12px;
  background-color: #1DB954;
  border-radius: 50%;
  display: none;
}

.fullscreen-control-item.active .indicator {
  display: block;
}

.fullscreen-volume-control {
  display: flex;
  align-items: center;
  margin-left: 30px;
}

.fullscreen-volume-control label {
  margin-right: 10px;
  font-size: 14px;
}

#fullscreenVolumeSlider {
  width: 150px;
}

/* Progress Bar Styling */
.fullscreen-progress-container {
  display: flex;
  align-items: center;
  width: 100%;
margin-bottom:30px;
padding:10px 0;
}

#fullscreenCurrentTime, #fullscreenTotalTime {
  font-size: 18px;
  color: #AAA;
  width: 80px;
  text-align: center;
}

#fullscreenProgressBar {
  flex: 1;
  margin: 0 15px;
}

/* Sidebar Styling */
.sidebar {
  width: 250px;
  background-color: #1F1F1F;
  padding: 20px;
  display: flex;
  flex-direction: column;
  border-right: 2px solid #333;
  position: relative;
  transition: transform 0.3s ease, width 0.3s ease, padding 0.3s ease, border 0.3s ease;
  flex-shrink: 0;
}

.sidebar h2 {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 30px;
  font-size: 24px;
}

.sidebar.hidden-sidebar {
  transform: translateX(-100%);
  width: 0;
  padding: 0;
  border: none;
}

.sidebar h2 .logo {
  width: 30px; /* Adjust size as needed */
  height: 30px;
  margin-right: 10px; /* Space between logo and text */
  vertical-align: middle;
}

/* Mode Selector Styling */
.mode-selector {
  display: flex;
  justify-content: space-between;
}

.mode-selector button {
  flex: 1;
  padding: 10px;
  margin: 0 5px;
  background-color: #333;
  border: none;
  color: #FFF;
  cursor: pointer;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.mode-selector button.active, .mode-selector button:hover {
  background-color: #555;
}

/* Playlist Section Styling */
#playlistSection {
  flex: 1;
  overflow-y: auto;
}

#homeSection {
line-height: 2;
padding: 20px;
padding-bottom:150px;
}

#playlistSection h3 {
  margin-bottom: 10px;
  font-size: 18px;
  border-bottom: 1px solid #333;
}

#playlistList {
  list-style: none;
}

#playlistList li {
  padding: 10px;
  cursor: pointer;
  border-radius: 5px;
  margin-bottom: 5px;
  transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
  display: flex;
  justify-content: space-between; /* For the three dots */
}

#playlistList li:hover, #playlistList li.active {
  background-color: #333;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* Large Album Art Toggle Icon */
.album-art-toggle {
  position: absolute;
  bottom: 20px;
  right: 20px;
  cursor: pointer;
  color: #FFF;
}

.album-art-toggle:hover {
  color: #1DB954;
}

/* Large Album Art Display */
.large-album-art {
    position: relative;
    overflow: hidden;   /* Hides the inactive image */
    aspect-ratio: 1 / 1;
    border-radius: 10px; /* From your original styling */
    border: solid 2px rgb(51,51,51);
}

.album-art-slider {
    display: flex;
    width: 200%; /* Contains two images side-by-side */
    height: 100%;
    transform: translateX(0); /* Default position */
    transition: transform 0.5s ease-in-out; /* The slide animation */
}

#albumArtImg1, #albumArtImg2 {
    width: 50%; /* Each image takes up half of the slider's width */
    height: 100%;
    object-fit: cover;
}

/* Main Content Styling */
.main-content {
  flex: 1;
  overflow-y: auto;
  transition: margin-left 0.3s ease;
}

/* Playlist Styling */
.playlist {
  list-style: none;
  padding: 0;
  overflow-y: auto;
}

.playlist li {
  padding: 10px;
  margin-bottom: 5px;
  background-color: #1E1E1E;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: space-between; /* For the three dots */
  cursor: pointer;
  transition: background-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

/* Song Item Styling */
.playlist .song-details {
  display: flex;
  align-items: center;
  width: 100%;
}

.playlist .song-details img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 5px;
  margin-right: 15px;
}

.playlist .song-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.playlist .song-info .title-artist {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.playlist .song-info .title-artist h4 {
  font-size: 16px;
  margin-bottom: 5px;
  color: #FFF; /* Default color */
}

.playlist .song-info .title-artist h4.playing {
  color: #1DB954; /* Green color for currently playing song */
}

.playlist .song-info p {
  font-size: 14px;
  color: #AAA;
}

.playlist .song-info .additional-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #BBB;
  margin-top: 5px;
}

.playlist .three-dots {
  cursor: pointer;
  font-size: 18px;
  color: #BBB;
  transition: color 0.3s;
}

.playlist .three-dots:hover {
  color: #FFF;
}

/* Footer Styling */
.footer {
  background-color: #1F1F1F;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 2px solid #333;
  flex-wrap: wrap;
  transition: left 0.3s ease;
  z-index: 100;
}

.sidebar.hidden-sidebar ~ .footer {
  left: 0;
}

/* Smooth Transitions */
.sidebar,
.footer {
  transition: all 0.3s ease;
}

.now-playing {
  display: flex;
  align-items: center;
  flex: 1 1 30%; /* Flex-grow, flex-shrink, flex-basis. Defines the left column size. */
  min-width: 200px;
  margin-right: 20px;
  overflow: hidden;
  justify-content: flex-start; /* Aligns content to the left */
}

.now-playing img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 5px;
  margin-right: 15px;
  position: relative; /* For the icon */
}

.now-playing img .album-icon {
  position: absolute;
  bottom: 5px;
  right: 5px;
  background-color: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  padding: 2px;
  cursor: pointer;
  display: none;
}

.now-playing img:hover .album-icon {
  display: block;
}

.auth-button {
  margin-top: 20px;
  padding: 10px;
  background-color: #FF4C4C; /* Red for logout */
  border: none;
  border-radius: 5px;
  color: #FFF;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
  width: 100%;
}

.auth-button.login {
  background-color: #1DB954; /* Green for login */
}

.auth-button:hover {
  opacity: 0.8;
}

#songInfo {
  display: flex;
  flex-direction: column;
  min-width:0;
  overflow:hidden;
}

#songTitle, 
#songArtist {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
/*width: 200px;           /* or 100%, or any max width you want them to have */
}

#songInfo h3 {
  font-size: 18px;
  margin-bottom: 5px;
}

#songInfo p {
  font-size: 14px;
  color: #AAA;
}

#playlistEditModal .modal-content {
    max-width: 550px;
}

.playlist-edit-body {
    display: flex;
    margin-top:20px;
    gap: 20px;
    align-items: flex-start;
}

.playlist-edit-art-container {
    position: relative;
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.art-actions {
    position: absolute;
    bottom: 8px;
    right: 8px;
    display: flex;
    gap: 8px;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.3s ease;
    pointer-events: none; /* Allows hover on the container itself */
}

#editPlaylistCover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    background-color: #333; /* Placeholder color */
}

.art-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* Let clicks pass through to the container */
}

.playlist-edit-art-container:hover .art-overlay {
    opacity: 1;
}

.playlist-edit-art-container:hover .art-actions {
    opacity: 1; /* Revealed on hover */
    pointer-events: auto; /* Buttons become clickable */
}

.art-action-button {
    width: 32px;
    height: 32px;
    background-color: rgba(0, 0, 0, 0.7);
    border: none;
    border-radius: 50%;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.art-action-button:hover {
    background-color: rgba(0, 0, 0, 0.9);
}

.art-overlay i {
    font-size: 24px;
    margin-bottom: 8px;
}

.art-overlay span {
    font-size: 14px;
    font-weight: bold;
}

.playlist-edit-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 15px;
}

#playlistEditModal #playlistNameInput,
#playlistEditModal #playlistDescriptionInput {
    background: #3e3e3e;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 12px;
    color: #FFF;
    width: 100%;
    box-sizing: border-box;
}

#playlistEditModal #playlistNameInput {
    font-size: 16px;
    font-weight: bold;
}

#playlistEditModal #playlistDescriptionInput {
    resize: vertical;
    min-height: 80px;
    font-family:sans-serif;
    height:120px;
}

#playlistEditModal #savePlaylistChangesBtn {
    align-self: flex-end; /* Align button to the right */
    padding: 10px 25px;
    width: auto; /* Override default 100% width */
}

/* Remove old form-row styling from this modal */
#playlistEditModal .form-row {
    display: none; 
}

#playlistEditForm {
  text-align: center;
}

#savePlaylistChangesBtn {
  margin-top: 20px;
  padding: 10px;
  background-color: #1DB954;
  border: none;
  border-radius: 5px;
  color: #FFF;
  font-size: 16px;
  cursor: pointer;
  width: 100%;
  text-align: center;
}

#savePlaylistChangesBtn:hover {
  background-color: #17a74a;
}

.close-playlist-edit-button {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #FFF;
}

.close-playlist-edit-button:hover {
  color: #1DB954;
}

.controls button {
  background: none;
  border: none;
  cursor: pointer;
  margin: 0 10px;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.controls button img {
  width: 15px;
  height: 15px;
  filter: invert(100%); /* Make SVG icons white */
  transition: filter 0.3s;
}

.controls button:hover img {
  filter: invert(59%) sepia(29%) saturate(1078%) hue-rotate(89deg) brightness(95%) contrast(94%); /* Spotify Green */
}

/* Active Shuffle/Repeat Buttons */
.controls button.active img {
  filter: invert(59%) sepia(29%) saturate(1078%) hue-rotate(89deg) brightness(95%) contrast(94%); /* Spotify Green */
}

.control-item {
  position: relative;
}

.control-item .indicator {
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 8px;
  background-color: #1DB954;
  border-radius: 50%;
  display: none;
}

.player-controls {
  flex: 1 1 40%; /* Takes up more space in the middle */
  display: flex;
  align-items: center;
  justify-content: flex-start; /* This perfectly centers the buttons */
}

/* The new right-aligned container for volume/fullscreen */
.extra-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* Pushes content to the far right */
}

/* Generic button styling, applies to buttons in both new divs */
.player-controls button,
.extra-controls button {
  background: none;
  border: none;
  cursor: pointer;
  margin: 0 10px;
  width: 32px;
  height: 32px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.player-controls button img,
.extra-controls button img {
  width: 15px;
  height: 15px;
  filter: invert(100%);
  transition: filter 0.3s;
}

.player-controls button:hover img,
.extra-controls button:hover img {
  filter: invert(59%) sepia(29%) saturate(1078%) hue-rotate(89deg) brightness(95%) contrast(94%);
}

.player-controls button.active img {
  filter: invert(59%) sepia(29%) saturate(1078%) hue-rotate(89deg) brightness(95%) contrast(94%);
}

.control-item.active .indicator {
  display: block;
}

.volume-control label {
  margin-right: 10px;
  font-size: 14px;
}

#volumeSlider {
  width: 100px;
}

/* Progress Bar Styling */
.progress-container {
  display: flex;
  align-items: center;
  flex: 1 1 100%;
  margin-top: 10px;
}

#currentTime, #totalTime {
  font-size: 12px;
  color: #AAA;
  width: 50px;
  text-align: center;
}

#progressBar {
  flex: 1;
  margin: 0 10px;
}

/* Modal Styling */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background-color: #2C2C2C;
  padding: 20px;
  border-radius: 10px;
  color: #FFF;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.close-button {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 24px;
  cursor: pointer;
  color: #FFF;
}

.close-button:hover {
  color: #1DB954;
}

.uploadButton {
  padding: 10px 20px;
  background-color: #1DB954;
  border: none;
  border-radius: 5px;
  color: #FFF;
  cursor: pointer;
  transition: background-color 0.3s;
}

/* New Styles for Homepage Enhancements */

/* Homepage Playlist Heading */
.home-playlist-heading {
  margin-bottom: 20px;
  color: #FFFFFF;
}

/* Home Playlists Container */
.home-playlists-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px; /* Space before the GIF */
}

/* Playlist Card Styling */
.playlist-card {
  background-color: #1E1E1E;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.playlist-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Playlist Artwork */
.playlist-art {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

/* Playlist Information */
.playlist-info {
  padding: 15px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.playlist-name {
  font-size: 18px;
  margin-bottom: 10px;
  color: #FFFFFF;
}

.up-next-container {
  position: absolute;
  top: 20px;
  right: 30px;
  background-color: rgba(0,0,0,0.8);
  padding: 10px;
  border-radius: 5px;
  text-align: left;
  color: #FFFFFF;
  z-index: 2000;
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.up-next-container .up-next-title {
  font-weight: bold;
  font-size: 14px;
  letter-spacing: 1px;
  color: #1DB954;
  margin-bottom: 5px;
}

.up-next-container .up-next-info {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.up-next-container .up-next-info img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 5px;
}

.playlist-description {
  font-size: 14px;
  color: #AAA;
  flex: 1;
}

/* Ensure the GIF is placed at the end */
.homeSection {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.homeSection .home-playlist-heading,
.homeSection .home-playlists-container,
.homeSection .homepage-gif {
  width: 100%;
  max-width: 1200px; /* Adjust based on desired maximum width */
  padding: 0 20px;
}

.track-title.playing {
  color: #1DB954; /* Spotify Green */
}

/* Responsive Enhancements for Homepage */
@media (max-width: 768px) {
  .home-playlists-container {
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      gap: 15px;
  }

  .playlist-art {
      height: 120px;
  }

  .playlist-name {
      font-size: 16px;
  }

  .playlist-description {
      font-size: 12px;
  }

  .homepage-gif {
      max-width: 300px;
  }
}

/* Optional: Add transitions for smoother hover effects */
.playlist-card,
#playlistList li {
  transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s;
}

.playlist-card:hover,
#playlistList li:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* Optional: Scrollbar Styling for Playlists */
#playlistList,
.home-playlists-container {
  scrollbar-width: thin;
  scrollbar-color: #555 #1F1F1F;
}

#playlistList::-webkit-scrollbar,
.home-playlists-container::-webkit-scrollbar {
  width: 8px;
}

#playlistList::-webkit-scrollbar-track,
.home-playlists-container::-webkit-scrollbar-track {
  background: #1F1F1F;
}

#playlistList::-webkit-scrollbar-thumb,
.home-playlists-container::-webkit-scrollbar-thumb {
  background-color: #555;
  border-radius: 4px;
}

/* Styles for the playlist title when it's the playback playlist */
#playlistList li.playing-playlist {
  color: #1DB954; /* Spotify Green */
  font-weight: bold;
}

/* Ensure the active playlist (viewed playlist) has a different background */
#playlistList li.active {
  background-color: #333;
}

.fullscreen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5); /* Adjust the 0.5 value to control opacity */
  z-index: 1; /* Ensure the overlay is above the background but below the content */
}

/* Settings Button Styling */
.settings-button {
  background: none;
  border: none;
  color: #FFF;
  font-size: 20px;
  cursor: pointer;
  position: absolute;
  right: 10px;
  transform: translateX(-50%);
  padding: 10px;
  border-radius: 50%;
  transition: background-color 0.3s;
}

.settings-button:hover {
  background-color: #333;
}

/* Settings Panel Styling */
.settings-panel {
  position: absolute;
  top: 60px; /* Position below the header */
  right: 20px; /* Align to the right */
  background-color: #1F1F1F;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  width: calc(100% - 30px);
  max-width: 600px;
  height:420px;
  z-index: 200; /* Higher z-index to appear above other elements */
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.settings-logo {
  display: flex;
  align-items: center;
}

.settings-logo .logo {
  width: 30px;
  height: 30px;
  margin-right: 10px;
}

.nav-left, .nav-center, .nav-right {
  display: flex;
  align-items: center;
}

.nav-left .hamburger-menu {
  background: none;
  border: none;
  color: #FFF;
  font-size: 20px;
  margin-right: 15px; /* Reduced margin */
  cursor: pointer;
}

.nav-left .brand {
  display: flex;
  align-items: center;
}

.nav-left .brand .logo {
  width: 30px;
  height: 30px;
  margin-right: 10px;
}

.nav-left .brand .brand-name {
  font-size: 20px;
  font-weight: bold;
}

.nav-center .mode-selector {
  display: flex;
}

.nav-center .mode-selector button {
  background-color: #333;
  border: none;
  color: #FFF;
  padding: 8px 20px; /* Increased padding for wider buttons */
  margin: 0 5px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px; /* Adjust font size as needed */
}

.nav-center .mode-selector button.active,
.nav-center .mode-selector button:hover {
  background-color: #555;
}

.nav-right .settings-button {
  background: none;
  border: none;
  color: #FFF;
  font-size: 20px;
  cursor: pointer;
  margin-left: 15px; /* Add some spacing if needed */
}

.settings-text span:first-child {
  font-size: 16px;
  color: #FFF;
}

.settings-text .version {
  font-size: 12px;
  color: #AAA;
  display: block;
}

@media (max-width: 1023px) {
  /* Hide the "Album" cell in each song row */
  .track-date-added, .header-date-added {
    display: none;
  }

  /* Adjust the grid for the header to remove the album column */
  .playlist-header {
    grid-template-columns: 40px 3fr 2fr 50px 30px; /* # | Title/Artist | Album | Date added | Length | Threedots */
  }

  /* Adjust the grid for each song row. 
     !important is used to override the inline style set by JavaScript. */
  #onlinePlaylist li {
    grid-template-columns: 40px 3fr 2fr 50px 30px !important; /* # | Title/Artist | Album | Date added | Length | Threedots */
  }
}

@media (max-width: 800px) {
  /* Hide the "Album" cell in each song row */
  .track-album, .header-album, .track-date-added {
    display: none;
  }

  /* Adjust the grid for the header to remove the album column */
  .playlist-header {
    grid-template-columns: 40px auto 50px 30px;
  }

  /* Adjust the grid for each song row. 
     !important is used to override the inline style set by JavaScript. */
  #onlinePlaylist li {
    grid-template-columns: 40px 1fr 50px 30px !important;
  }
}

@media (max-width: 800px) {
  .playlist-edit-body {
    flex-direction: column;
  }

  .song-art-previews {
    flex-direction: row;
  }
}

@media (max-width: 800px) {
  /* Sidebar Hidden by Default */
  .sidebar {
      position: fixed; /* Fix the sidebar over the content */
      top: 0;
      left: 0;
      height: 100%;
      width: 250px;
      transform: translateX(-100%); /* Hide sidebar */
      transition: transform 0.3s ease;
      z-index: 1000; /* Above the overlay */
  }

  /* Sidebar Visible */
  .sidebar.hidden-sidebar {
      transform: translateX(-100%); /* Ensure sidebar is hidden */
  }

  .sidebar:not(.hidden-sidebar) {
      transform: translateX(0); /* Slide sidebar into view */
  }

  /* Overlay Styling */
  .overlay {
      display: none; /* Hidden by default */
  }

  .overlay.active {
      display: block;
      opacity: 1;
  }

  /* Main Content Adjustment */
  .main-content {
      margin-left: 0; /* Allow sidebar to overlay without pushing content */
  }

  /* Footer Adjustment */
  .footer {
      left: 0; /* Allow footer to span full width */
      transition: left 0.3s ease;
  }

  /* Sidebar and Overlay Transitions */
  .sidebar,
  .overlay {
      transition: transform 0.3s ease, opacity 0.3s ease;
  }
  .brand-name{display:none;}
}

/* Media Query for Screens Wider Than 800px */

/* Responsive Adjustments */

/* ... Existing CSS Content ... */

/* Custom Context Menu Styling */
.custom-context-menu {
  position: absolute;
  background-color: #2C2C2C;
  border: 1px solid #444;
  border-radius: 5px;
  width: 200px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.custom-context-menu ul {
  list-style: none;
  margin: 0;
  padding: 5px 0;
}

.custom-context-menu ul li {
  padding: 10px 20px;
  cursor: pointer;
  color: #FFF;
  transition: background-color 0.2s;
  position: relative;
}

.custom-context-menu ul li:hover {
  background-color: #1DB954;
}

/* Prevent text selection on context menu */
.custom-context-menu, .custom-context-menu ul, .custom-context-menu ul li {
  user-select: none;
  -webkit-user-select:none;
}

/* Example Spotify-like Styles for li */
#onlinePlaylist li, .home-playlists-container .playlist-card li, #localPlaylist li {
  display: grid;
  grid-template-columns: 40px 3fr 2fr 150px 50px 30px; /* # | Title/Artist | Album | Date added | Length | Threedots */
  align-items: center;
  padding: 5px 0;
  font-size: 14px;
  color: #FFF;
  cursor: pointer;
  border-bottom: 1px solid #333;
  transition: background-color 0.2s;
}

/* Hover effect similar to Spotify */
#onlinePlaylist li:hover {
  background-color: #282828;
}

/* Track Index (Number) */
.track-index {
  text-align: right;
  color: #B3B3B3;
  font-size: 14px;
  padding-right: 10px;
}

/* Title & Artist Container */
.track-title-artist {
  display: flex;
  align-items: center;
  gap: 15px;
}

/* Album Cover */
.track-cover {
  width: 45px;
  height: 45px;
 /* object-fit: cover;*/
  border-radius: 4px;
}

/* Title and Artist Text */
.track-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.track-title {
  font-size: 14px;
  color: #FFFFFF;
  font-weight: 500;
}

.track-artist {
  font-size: 12px;
  color: #B3B3B3;
  margin-top: 2px;
}

/* Album Column */
.track-album, .track-date-added {
  color: #B3B3B3;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Length Column */
.track-length {
  text-align: right;
  color: #B3B3B3;
  font-size: 14px;
  padding-right: 10px;
}

/* Optional: Adjusting Playlist Container Styling */
#onlinePlaylist {
  width: 100%;
  background-color: #121212;
  padding: 0 20px;
  position: relative;
  padding-top: 10px;
  padding-bottom:10px;
}

#onlinePlaylist li:first-child {
  border-top: none;
}

.modal-album-cover {
  width: 175px; /* or any size you like */
  height: 175px;
  object-fit: cover;
  border-radius: 8px;
  /* If you want a border: */
  /* border: 2px solid #333; */
}

.modal-body {
  display: flex;
  align-items: flex-start;
  margin-top: 20px;
}

@media (max-width: 800px) {
  /* Make the fullscreen player resemble a mobile Spotify Now Playing screen */
  .fullscreen-player {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center; /* Changed from flex-start to center */
      padding: 20px;
      background: #1db954; /* Will be overridden dynamically */
      background-image: none; /* Remove background images */
      background-color: #1db954; /* Default solid color */
  }
  .fullscreen-overlay,
  .fullscreen-background {
      display: none; /* Hide overlay backgrounds on small screens */
  }

  .close-fullscreen-button {
      top: 20px;
      right: 20px;
      font-size: 24px;
      color: #fff;
  }

  .fullscreen-content {
      width: 100%;
      max-width: 400px;
      display: flex;
      flex-direction: column;
      align-items: center;
      padding: 0;
      /* Removed margin-top to center vertically */
  }

  .fullscreen-info-container {
      flex-direction: column;
      align-items: center;
      margin-bottom: 20px;
  }

  .fullscreen-album-cover-container img {
      width: 300px;
      height: 300px;
      object-fit: cover; /* Maintains aspect ratio by cropping if necessary */
      border-radius: 8px;
      margin-bottom: 20px;
      min-width: 300px;
      min-height: 300px;
      margin-right: 0px;
  }

  #fullscreenSongInfo h2 {
      font-size: 24px;
      text-align: center;
      color: #fff;
      margin-bottom: 8px;
  }

  #fullscreenSongInfo p {
      font-size: 16px;
      color: #f0f0f0;
      text-align: center;
      margin-bottom: 20px;
  }

  .fullscreen-progress-container {
      display: flex;
      align-items: center;
      width: 100%;
      margin-bottom: 10px;
      padding: 0 10px;
  }

  #fullscreenCurrentTime, #fullscreenTotalTime {
      width: 40px;
      font-size: 12px;
      color: #fff;
  }

  #fullscreenProgressBar {
      flex: 1;
      margin: 0 10px;
  }

  .fullscreen-controls {
      width: 100%;
      display: flex;
      flex-direction: row;
      align-items: center;
      justify-content: space-evenly;
      margin-bottom: 20px;
  }

  .fullscreen-controls button {
      margin: 0;
  }

  .fullscreen-volume-control {
      display: none; /* Hide volume control for a cleaner mobile look */
  }

  #fullscreenPlayPauseBtn img {
      width: 40px;
      height: 40px;
  }

  /* Hide up next container on small screens to simplify UI */
  #upNextContainer {
      display: none;
  }
  .fullscreen-controls button:hover img {
      filter: invert(100%); /* Maintain the default icon color without change */
  }

  /* Optionally, remove cursor pointer if desired */
  .fullscreen-controls button {
      cursor: default;
  }

  /* Ensure no transition effects on hover */
  .fullscreen-controls button img {
      transition: none;
  }
}

.upload-area {
  border: 2px dashed #555;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
  cursor: pointer;
  color: #AAA;
  transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}

.upload-area.dragover {
  border-color: #1DB954;
  background-color: #333;
  color: #FFF;
}

.upload-instructions {
  margin-bottom: 10px;
}

#uploadButton {
  padding: 10px 20px;
  background-color: #1DB954;
  border: none;
  border-radius: 5px;
  color: #FFF;
  cursor: pointer;
  transition: background-color 0.3s;
}

#uploadButton:hover {
  background-color: #17a74a;
}

#songInfoForm {
  display: flex;
  flex-direction: column;
  gap: 15px; /* Adds space between form elements */
  width: 100%;
}

#songInfoForm .form-row {
  display: flex;
  align-items: center;
  gap: 10px; /* Space between label and input */
}

/* Style the labels */
#songInfoForm .form-row label {
  width: 70px; /* Fixed width for labels */
  text-align: right;
  color: #FFF; /* Ensures label text is visible against dark background */
}

/* Style the input fields */
#songInfoForm .form-row input[type="text"] {
  flex-grow: 1; /* Allows input to take up remaining space */
  padding: 8px;
  border: 1px solid #555;
  border-radius: 4px;
  background-color: #2C2C2C;
  color: #FFF;
  font-size: 14px;
}

/* Style the Song ID span */
#songInfoForm .form-row span#modalSongID {
  flex-grow: 1; /* Aligns with input fields */
  padding: 8px;
  background-color: #444;
  border-radius: 4px;
  color: #FFF;
}

/* Style the Save button */
#saveSongInfoBtn {
  align-self: flex-start; /* Aligns the button to the */
  padding: 10px 20px;
  background-color: #1DB954;
  color: #FFF;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

#saveSongInfoBtn:hover {
  background-color: #17a74a;
}

.playlist-header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}

.add-playlist-btn {
  background: none;
  border: none;
  color: #FFF;
  cursor: pointer;
  padding: 0;
  margin: 0;
  font-size: 16px;
}

.add-playlist-btn:hover {
  color: #1DB954;
}

.custom-context-menu ul li ul {
position: absolute;
background: #2C2C2C;
border: 1px solid #444;
border-radius: 5px;
padding: 5px 0;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
white-space: nowrap;
z-index: 1001;
display: none;

/* Align the sub-menu to the right edge of the parent <li> */
top: 0;
right: 100%;
}

.custom-context-menu ul li:hover > ul {
  display: block;
}

.custom-context-menu ul li ul li {
  padding: 10px 20px;
}

  .profile-container {
    position: relative;
    display: inline-block;
  }
  .profile-button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
  }
  .profile-pic {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
  }
  .profile-menu {
    position: absolute;
    right: 0;
    top: 45px;
    background: #2C2C2C;
    border: 1px solid #444;
    border-radius: 5px;
    min-width: 200px;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  }
  .profile-menu-item {
    padding: 10px 15px;
    color: #FFF;
    cursor: pointer;
    border-bottom: 1px solid #444;
  }
  .profile-menu-item:last-child {
    border-bottom: none;
  }
  .profile-menu-item:hover {
    background-color: #1DB954;
  }
  .profile-info {
    display: flex;
    align-items: center;
  }
  .profile-pic-small {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
  }

  #playlist-view {
  display: flex;
  position: relative;
  align-items: flex-start;
  margin: 20px;
  /* max-width: 600px;  If needed, you can uncomment and adjust */
}

#playlist-cover-art {
  width: 20vw;
  max-width: 200px;
  background-color: darkgray;
  border-radius: 7px;
  min-width: 100px;
  flex-shrink: 0;
  margin-right: 15px;
  max-height:200px;
  aspect-ratio: 1 / 1;
}

.playlist-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  justify-content: space-between;
}

#playlist-name {
  margin: 15px 0 10px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#playlist-description {
  margin: 0 0 10px 0;
  text-overflow: ellipsis;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.playlist-meta {
  align-items: center;
  margin-bottom: 5px;
  flex-shrink: 0;
  bottom: 0;
  display: inline-flex;
}

.playlist-meta img {
  width: 25px;
  border-radius: 50%;
  margin: 0 5px;
}

/* Hide the context menu by default */
.hidden {
  display: none !important;
}

.separator {
  margin-left:5px;
  margin-right:5px;
}

.settings-modal {
    background-color: #2f2f2f;
    width: 600px; 
    height: 420px;
    border-radius: 8px;
    display: flex; 
    flex-direction: column;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 12px rgba(0,0,0,0.4);
  }
  .modal-header {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    background-color: #2f2f2f;
    padding: 16px;
    border-bottom: 1px solid #444;
  }
  .modal-header h2 {
    margin: 0; 
    color: #fff; 
    font-size: 18px;
  }
  .close-button {
    background: none; 
    border: none; 
    color: #fff; 
    font-size: 18px; 
    cursor: pointer;
  }
  .modal-body2 {
    display: flex; 
    flex: 1;
  }
  .sidebar2 {
    width: 180px;
    background-color: #1f1f1f;
    border-right: 1px solid #3a3a3a;
    padding: 8px 0;
    display: flex; 
    flex-direction: column;
  }
  .tab-button {
    background: none; 
    border: none; 
    text-align: left; 
    color: #ccc;
    padding: 12px 16px; 
    cursor: pointer;
    font-size: 14px;
    width: 100%;
  }
  .tab-button i {
    margin-right: 8px;
  }
  .tab-button:hover {
    background-color: #333;
    color: #fff;
  }
  .tab-button.active {
    background-color: #444;
    color: #fff; 
    font-weight: bold;
    border-left: 4px solid #1fcc67;
  }
  .tab-content {
    flex: 1; 
    padding: 16px; 
    color: #ccc;
  }
  .tab-content h3 {
    margin-top: 0; 
    margin-bottom: 16px; 
    color: #fff;
    font-size: 16px;
  }
.content-panel label.toggle-switch-label {
display: flex;
align-items: center;
justify-content: space-between; /* text left, toggle right */
margin: 10px 0;
color: #fff;  /* text color (if needed) */
font-size: 14px;
}

/* Container for the actual slider input */
.toggle-switch {
position: relative;
display: inline-block;
width: 40px;
height: 20px;
}

/* Hide default checkbox */
.toggle-switch input[type="checkbox"] {
opacity: 0;
width: 0;
height: 0;
}

/* Slider background */
.slider {
position: absolute;
cursor: pointer;
top: 0; 
left: 0; 
right: 0;
bottom: 0;
background-color: #bbb; 
transition: 0.4s;
border-radius: 20px;
width: 40px;
}

/* Knob/circle inside the slider */
.slider:before {
content: "";
position: absolute;
height: 14px;
width: 14px;
left: 3px;
bottom: 3px;
background-color: #fff;
border-radius: 50%;
transition: 0.4s;
}

/* When checked, move the knob and change background color */
.toggle-switch input:checked + .slider {
background-color: #1DB954;
}
.toggle-switch input:checked + .slider:before {
transform: translateX(20px);
}

li.disabled-offline {
    opacity: 0.4;
    pointer-events: none; /* Prevents clicking */
}

.status-icon {
  width: 14px; height: 14px; margin-right: 5px; vertical-align: middle;
}

#songModalCloseBtn {
  position: absolute;
  right: 20px;
}