/* Base styles */
:root {
    --primary-color: #5755d9;
    --secondary-color: #f1f1fe;
    --text-color: #454545;
    --light-text: #7a7a7a;
    --bg-color: #ffffff;
    --border-radius: 8px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  }
  
  body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
  }
  
  /* Enhanced Player Container */
  .enhanced-player {
    display: flex;
    flex-direction: column;
    background-color: var(--bg-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin: 2rem 0;
    overflow: hidden;
  }
  
  .player-container {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: linear-gradient(145deg, #fdfdfd, #f5f5f5);
  }
  
  @media (min-width: 768px) {
    .player-container {
      flex-direction: row;
    }
  }
  
  /* Album Art */
  .album-art {
    flex: 0 0 auto;
    width: 100%;
    max-width: 300px;
    margin: 0 auto 1.5rem auto;
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
  }
  
  @media (min-width: 768px) {
    .album-art {
      margin: 0 1.5rem 0 0;
    }
  }
  
  .album-art img {
    width: 100%;
    height: auto;
    display: block;
  }
  
  .track-info {
    padding: 1rem 0;
  }
  
  .album-art .track-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 1rem;
  }
  
  .album-art .track-info h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1.25rem;
  }
  
  .album-art .track-info p {
    margin: 0;
    opacity: 0.8;
    font-size: 0.9rem;
  }
  
  /* Player Controls */
  .player-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  .progress-container {
    margin-bottom: 1rem;
  }
  
  .waveform {
    display: flex;
    align-items: flex-end;
    height: 60px;
    margin-bottom: 0.5rem;
    padding: 0.5rem 0;
  }
  
  .waveform-bar {
    flex: 1;
    background-color: var(--primary-color);
    opacity: 0.5;
    margin: 0 1px;
    transition: height 0.2s ease;
  }
  
  .progress-bar {
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
  }
  
  .progress {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.1s linear;
  }
  
  .time-info {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--light-text);
  }
  
  .controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
  }
  
  .control-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-color);
    cursor: pointer;
    padding: 0.5rem;
    transition: all 0.2s ease;
  }
  
  .control-btn:hover {
    color: var(--primary-color);
  }
  
  .control-btn.play-pause {
    background-color: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .control-btn.play-pause:hover {
    background-color: #4745c0;
    transform: scale(1.05);
  }
  
  .control-btn.active {
    color: var(--primary-color);
  }
  
  /* Volume Control */
  .volume-control {
    display: flex;
    align-items: center;
    position: relative;
  }
  
  .volume-control i {
    margin-right: 0.5rem;
    cursor: pointer;
  }
  
  .volume-slider-container {
    width: 80px;
  }
  
  input[type="range"] {
    appearance: none;
    width: 100%;
    height: 5px;
    border-radius: 5px;
    background: #e0e0e0;
    outline: none;
  }
  
  input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
  }

  /* Format Selector Styles */
.format-selector {
  margin-bottom: 1rem;
  padding: 0 1.5rem;
}

.format-selector select {
  appearance: none;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border: 1px solid #e0e0e0;
  border-radius: var(--border-radius);
  background-color: var(--bg-color);
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23454545' viewBox='0 0 16 16'><path d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.format-selector select:hover {
  border-color: #d0d0d0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.format-selector select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--secondary-color);
}

/* Format badge styles */
.format-badge {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  background-color: var(--secondary-color);
  color: var(--primary-color);
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* Format label for the selector */
.format-selector label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--light-text);
}

/* Format Selector Styles */
.format-selector {
  margin: 0 1.5rem 1rem;
  position: relative;
}

.format-selector label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  color: var(--light-text);
}

.format-selector select {
  appearance: none;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  border: 1px solid #e0e0e0;
  border-radius: var(--border-radius);
  background-color: var(--bg-color);
  color: var(--text-color);
  cursor: pointer;
  transition: all 0.2s ease;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23454545' viewBox='0 0 16 16'><path d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.format-selector select:hover {
  border-color: #d0d0d0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.format-selector select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px var(--secondary-color);
}

/* Playlist container adjustments to incorporate format selector */
.playlist-container {
  background-color: #f5f5f5;
  border-top: 1px solid #e0e0e0;
  padding-top: 1rem;
}

.playlist-container h3 {
  margin: 0 0 1rem 1.5rem;
  font-size: 1.1rem;
  color: var(--text-color);
}

/* Playlist styles to match the overall aesthetic */
.playlist {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 300px;
  overflow-y: auto;
}

.playlist li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid #e0e0e0;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.playlist li:hover {
  background-color: rgba(87, 85, 217, 0.05);
}

.playlist li.active {
  background-color: rgba(87, 85, 217, 0.1);
  border-left: 3px solid var(--primary-color);
}

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

.playlist .track-title {
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.playlist .track-artist {
  font-size: 0.85rem;
  color: var(--light-text);
}

.playlist .track-duration {
  font-size: 0.85rem;
  color: var(--light-text);
}

/* Scrollbar styling for playlist */
.playlist::-webkit-scrollbar {
  width: 6px;
}

.playlist::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.playlist::-webkit-scrollbar-thumb {
  background: #cccccc;
  border-radius: 3px;
}

.playlist::-webkit-scrollbar-thumb:hover {
  background: #b3b3b3;
}



/* Format and Download Container */
.format-download-container {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  margin: 0 1.5rem 1rem;
}

/* Update format selector to work in the container */
.format-selector {
  flex: 1;
  margin: 0;
}

/* Download Button Styles */
.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.75rem 1.25rem;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(87, 85, 217, 0.25);
  white-space: nowrap;
}

.download-btn:hover {
  background-color: #4745c0;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(87, 85, 217, 0.3);
}

.download-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(87, 85, 217, 0.2);
}

.download-btn i {
  font-size: 1rem;
}

.download-btn:disabled {
  background-color: #aaa;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}



/* Improved responsiveness for format selector and download button */
/* Base styles remain unchanged */

/* Format and Download Container - Adding responsive behavior */
.format-download-container {
  display: flex;
  flex-direction: column; /* Stack vertically on mobile */
  gap: 1rem;
  margin: 0 1.5rem 1rem;
}

/* Make format selectors and buttons full width on mobile */
.format-selector {
  flex: 1;
  margin: 0;
  width: 100%;
}

.format-selector select {
  width: 100%;
  min-height: 44px; /* Improve touch target size */
  padding: 0.75rem 2rem 0.75rem 1rem; /* Increase padding for better touch */
}

/* Download Button Styles - Improved for mobile */
.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius);
  padding: 0.85rem 1.25rem; /* Slightly taller for better touch target */
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(87, 85, 217, 0.25);
  white-space: nowrap;
  width: 100%; /* Full width on mobile */
  min-height: 44px; /* Improve touch target size */
}

/* Media query to revert to horizontal layout on larger screens */
@media (min-width: 576px) {
  .format-download-container {
    flex-direction: row;
    align-items: flex-end;
  }
  
  .download-btn {
    width: auto; /* Auto width on desktop */
  }
}

/* Additional mobile optimizations */
@media (max-width: 575px) {
  .format-selector label {
    font-size: 1rem; /* Slightly larger labels on mobile */
    margin-bottom: 0.5rem;
  }
  
  .download-btn {
    margin-top: 0.5rem;
  }
  
  /* Improve touch target sizes in the playlist */
  .playlist li {
    padding: 1rem 1.5rem;
  }
  
  /* Make volume slider a bit taller for easier touch */
  input[type="range"] {
    height: 7px;
  }
  
  input[type="range"]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
  }
}

/* Enhance focus states for accessibility */
.format-selector select:focus,
.download-btn:focus,
.control-btn:focus,
input[type="range"]:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}