/* Global styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background: #3e005a; /* Purple background */
  color: #ffffff;
  margin: 0;
  padding: 0;
  padding-bottom: 80px; /* Adjust as needed */
  height: auto;
  min-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch; /* for momentum scrolling on iOS */
}

/* Top Bar */
.top-bar {
  display: flex;
  justify-content: flex-start;
  background-color: #320046;
  padding: 10px;
  gap: 10px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000; /* ensures it stays on top */
}

.top-bar button {
  background-color: #5e00a1;
  border: none;
  padding: 10px 15px;
  cursor: pointer;
  color: #ffffff;
  font-size: 14px;
  border-radius: 4px;
}

.top-bar button:hover {
  background-color: #7500cc;
}

/* Main Container */
.main-container {
  padding-top: 50px; /* Adjust as needed */
  padding-left: 20px;
  padding-right: 20px;
  min-height: 100vh;
}

/* Left Section */
.left-section {
  background-color: #4e007a;
  padding: 20px;
  border-radius: 8px;
}

.track-info h2 {
  margin-bottom: 5px;
  font-size: 20px;
}

.sub-info {
  margin-bottom: 15px;
  opacity: 0.9;
}

/* Waveform Container */
.waveform-container {
  width: 100%;
  height: 120px;
  margin-bottom: 10px;
  background: #6f009e;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
}

/* Time Container */
.time-container {
  display: flex;
  justify-content: center;
  margin-bottom: 15px;
  gap: 5px;
  font-size: 14px;
}

/* Presets */
.preset-container {
  margin-bottom: 15px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.preset-label {
  font-weight: bold;
}

.preset-btn {
  background-color: #5e00a1;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: #fff;
}
#addPlaylistBtn {
  background-color: #00a100;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: #fff;
}

#irSelect {
  display: block;
  margin: 0px auto;
  border: 1px solid #ccc;
  border-radius: 2px;
  color: #000000;
  background-color: #00a100;
  font-size: 12px;
  padding: 3px;
  text-align: center;
}

.preset-btn:hover {
  background-color: #7500cc;
}

#addPresetToPlaylistBtn {
  background-color: #009688;
  border: none;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  color: #fff;
}

/* Sliders */
.sliders {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.slider-group {
  margin-bottom: 5px;
}

.slider-group label {
  font-size: 14px;
  margin-bottom: 3px;
  display: block;
  opacity: 0.9;
}

.slider-group input[type="range"] {
  width: 100%;
  cursor: pointer;
}

/* Playlists Container */
.playlists-container {
  padding: 20px;
  background-color: #4e007a;
  margin: 20px;
  border-radius: 8px;
  margin-bottom: 80px; /* Add enough margin so they are not masked */
}

.playlists-container h3 {
  margin-bottom: 10px;
}

#playlists {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Each playlist item */
.playlist {
  background-color: #5e00a1;
  padding: 10px;
  border-radius: 4px;
}

.playlist.active {
  border: 4px solid #fff;
}

.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
}

.playlist-header h4 {
  flex-grow: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0 5px; /* optional, add spacing between text and buttons */
  cursor: pointer;
}

.playlist-header button {
  background-color: #7500cc;
  border: none;
  padding: 4px 4px;
  margin: 4px;
  cursor: pointer;
  color: #fff;
  font-size: 12px;
  border-radius: 4px;
}

.song-list {
  margin-top: 10px;
  list-style-type: none;
  padding-left: 0;
}

.song-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.song-list li button {
  background-color: #009688;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  color: #fff;
  font-size: 12px;
  border-radius: 4px;
}

/* Bottom Player */
.bottom-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #320046;
  padding: 10px;
  display: block;
  align-items: center;
  justify-content: space-between;
  color: #ffffff;
  z-index: 1000; /* ensures it stays on top */
}

.bottom-track-info {
  font-size: 16px;
  margin-left: 10px;
}

.player-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.player-controls button {
  background-color: #5e00a1;
  border: none;
  padding: 8px 12px;
  cursor: pointer;
  color: #ffffff;
  font-size: 14px;
  border-radius: 4px;
}

.player-controls button:hover {
  background-color: #7500cc;
}

/* Volume Container */
.volume-container {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.volume-container label {
  font-size: 12px;
  margin-bottom: 2px;
}

.volume-container input[type="range"] {
  width: 100px;
}

/* Responsive for Mobile */
@media (max-width: 600px) {
  .main-container {
    padding-top: 40px;
    padding-left: 10px;
    padding-right: 10px;
    overflow-y: auto; /* Enable vertical scrolling */
    -webkit-overflow-scrolling: touch; /* Enable smooth touch scrolling */
    height: calc(100vh - 130px);
  }
  .playlists-container {
    max-height: 500px; /* Limit height to enable internal scrolling */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .bottom-player {
    padding: 10px;
  }
  .player-controls {
    flex-wrap: wrap;
    justify-content: center;
  }
}
.dropdown-toggle {
  font-size: 16px;
  user-select: none;
}
.playing {
  background-color: rgba(255, 255, 255, 0.2);
}

.dragging {
  opacity: 0.5;
}

.dragover {
  border: 1px dashed #fff;
}

.custom-alert-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5); /* semi-transparent background */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

.custom-alert {
  background: #fff;
  color: #000;
  padding: 20px;
  border-radius: 8px;
  max-width: 90%;
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.custom-alert-message {
  margin-bottom: 15px;
  font-size: 16px;
}

.custom-alert button {
  background: #320046;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
}

.custom-alert button:hover {
  background: #5e00a1;
}
