/* ===== VARIABLES ===== */
:root {
  --primary-color: #FD3DB5;     /* Bright Pink */
  --secondary-color: #8C1946;   /* Burgundy */
  --background-color: #1e1219;  /* Dark background for contrast */
  --text-color: #ffffff;
  --accent-color: #FD3DB5;      /* Bright Pink */
  --hover-color: #8C1946;       /* Burgundy */
  --gradient-start: #8C1946;    /* Burgundy */
  --gradient-end: #FD3DB5;      /* Bright Pink */
  --card-bg: rgba(255, 255, 255, 0.08);
  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(0, 0, 0, 0.3);
  --sidebar-height: 75px;
  --music-player-height: 100px;
}

/* ===== BASE STYLES ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
}

/* Reset for lists */
ul, li {
  list-style: none;
  padding: 0;
  margin: 0;
}

body {
  background: var(--background-color);
  color: var(--text-color);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.main-wrapper {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  width: 100vw; /* Full viewport width */
  max-width: 100%; /* Ensure it doesn't overflow */
}

/* ===== NAVBAR STYLES ===== */
.sidebar {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  height: var(--sidebar-height);
  padding: 15px 0;
  background: rgba(140, 25, 70, 0.15);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 12px var(--shadow-color);
  z-index: 1000;
  margin-top: 0; /* Remove any top margin since header is gone */
  display: flex;
  align-items: center;
}

.playlist-list-container {
  position: relative;
  width: 100%; /* Use full width */
  max-width: 100%; /* Use full width */
  margin: 0 auto; /* Center the container */
  padding: 5px 5px;
  overflow-x: auto;
  overflow-y: hidden;
}

.playlist-list-container::-webkit-scrollbar{
  display: none;
}

.playlist-list {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  list-style: none;
  flex-wrap: wrap; /* Allow items to wrap */
  width: 100%;
}

.playlist-item {
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(140, 25, 70, 0.2) 0%, rgba(253, 61, 181, 0.2) 100%);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  white-space: nowrap;
  list-style-type: none;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px; /* Set fixed minimum width for all items */
  width: 120px; /* Set fixed width for all items */
  height: 45px; /* Set fixed height for all items */
}

.playlist-item:hover,
.playlist-item.active {
  transform: translateY(-1px);
  background: linear-gradient(135deg, rgba(140, 25, 69, 0.526) 0%, rgba(253, 61, 179, 0.471) 100%);
  box-shadow: 0 6px 15px rgba(140, 25, 70, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.playlist-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
  text-align: center; /* Center text */
  overflow: hidden;
  text-overflow: ellipsis; /* Add ellipsis for long text */
  width: 100%; /* Use full width */
}

/* ===== PLAYLIST STYLES ===== */
.main-container {
  position: relative;
  flex: 1;
  /* padding: 20px; */
  padding-bottom: 15px;
  margin-top: var(--sidebar-height);
  margin-bottom: var(--music-player-height); /* Use variable for consistency */
  width: 90%; /* Reduced from 100vw */
  max-width: 1200px; /* Added max width */
  box-sizing: border-box;
  height: auto;
  min-height: calc(100vh - var(--sidebar-height) - var(--music-player-height)); /* Use CSS variables */
  margin-left: auto; /* Center the container */
  margin-right: auto; /* Center the container */
  overflow-y: visible; /* Remove scrollbar */
}

/* Override Bootstrap container */
.container {
  max-width: 90% !important;
  padding-left: 15px !important;
  padding-right: 15px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.playlist {
  list-style: none;
  padding: 0;
  margin: 0;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  max-height: 100%;
  scrollbar-width: none;
}

.playlist::-webkit-scrollbar{
  display: none;
}

.playlist li {
  padding: 12px 15px;
  margin: 7px;
  background: rgba(140, 25, 70, 0.1);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.playlist li:hover {
  transform: translateX(5px);
  background: rgba(140, 25, 70, 0.2);
  border: 1px solid rgba(253, 61, 181, 0.3);
  box-shadow: 0 4px 8px var(--shadow-color);
}

/* .playlist li.playing {
  background: linear-gradient(to right, var(--gradient-start) 0%, var(--gradient-end) 100%);
  box-shadow: 0 4px 12px var(--shadow-color);
} */

@keyframes futuristicPulse {
  0% {
    box-shadow:
      0 0 4px var(--gradient-start),
      0 0 8px var(--gradient-end),
      inset 0 0 2px var(--gradient-start);
  }
  50% {
    box-shadow:
      0 0 6px var(--gradient-start),
      0 0 12px var(--gradient-end),
      inset 0 0 4px var(--gradient-end);
  }
  100% {
    box-shadow:
      0 0 4px var(--gradient-start),
      0 0 8px var(--gradient-end),
      inset 0 0 2px var(--gradient-start);
  }
}

.playlist li.playing {
  background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
  animation: futuristicPulse 1.8s ease-in-out infinite;
  border: 1px solid var(--gradient-end);
  box-shadow:
    0 0 6px var(--gradient-start),
    0 0 10px var(--gradient-end),
    inset 0 0 2px rgba(255,255,255,0.05);
  transition: background 0.4s ease, box-shadow 0.3s ease;
}


.track-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-color);
}

.artist {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.track-duration {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

/* ===== MUSIC PLAYER STYLES ===== */
.music-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #8C1946 0%, #FD3DB5 100%);
  padding: 15px;
  box-shadow: 0 -5px 15px var(--shadow-color);
  z-index: 100;
  /* height: var(--music-player-height); */
  min-height: 100px;
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.player-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  /* position: relative; */
  flex-wrap: nowrap;
  gap: 5px;
}

.track-image-container {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  position: relative;
}

.track-image-container img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 8px var(--shadow-color);
  object-fit: cover;
  transition: all 0.3s ease;
}

.track-image-container::before {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: linear-gradient(135deg, #FD3DB5 0%, #8C1946 100%);
  border-radius: 50%;
  z-index: -1;
  opacity: 0.6;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.4;
  }
  100% {
    transform: scale(1);
    opacity: 0.6;
  }
}

.track-info {
  flex: 0 1 20%;
  /* min-width: 100px; */
  /* max-width: 200px; */
  overflow: hidden;
}

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

.track-info h3 {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.controls-and-timer {
  flex: 0 1 60%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 20px; /* Add space for the volume control */
  min-width: 200px;
}

.buttons-container {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 6px;
}

.control-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  backdrop-filter: blur(5px);
}

.control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
  box-shadow: 0 0 10px rgba(253, 61, 181, 0.4);
}

.control-btn.active {
  background: #FD3DB5;
  color: var(--background-color);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

#play-pause-btn {
  width: 50px;
  height: 50px;
  font-size: 20px;
  background: #8C1946;
  border: none;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

#play-pause-btn::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(253, 61, 181, 0.7) 0%, rgba(140, 25, 70, 0) 70%);
  z-index: -1;
  animation: rotate 10s linear infinite;
  opacity: 0.6;
}

#play-pause-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 15px rgba(253, 61, 181, 0.5);
}

.seek-container {
  width: 100%;
  display: flex;
}

.time-info {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.seek-bar {
  -webkit-appearance: none;
  width: 75%;
  height: 6px;
  background: linear-gradient(to right, #ff66cc, #ff33cc);
  border-radius: 3px;
  outline: none;
  position: relative;
  z-index: 0;
}

/* Webkit (Chrome, Safari) */
.seek-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 11px;
  height: 11px;
  background: white;
  border: 2px solid #ff33cc;
  border-radius: 50%;
  position: relative;
  z-index: 2;
}

#seek-bar {
  transition: background 0.3s ease;
}

.volume-control {
  position: absolute;
  right: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 30px;
  height: 100%;
  justify-content: center;
}

.volume-icon {
  color: var(--text-color);
  font-size: 16px;
  margin-bottom: 5px;
}

.volume-bar {
  -webkit-appearance: none;
  width: 6px;
  height: 80px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  transform: rotate(0deg);
}

.volume-bar::-webkit-slider-thumb {
  visibility: hidden;
}

/* ===== UTILITY CLASSES ===== */
.hidden {
  display: none;
}

/* ===== ANIMATIONS ===== */
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Apply rotation animation to the album cover when song is playing */
.playing .track-image-container img {
  animation: rotate 20s linear infinite;
}

/* Remove scrollbar styles */
.seek-bar::-webkit-slider-thumb, .volume-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #FD3DB5;
  border: 2px solid var(--text-color);
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  visibility: hidden;
}
