/* style.css - UI styles, clean and modern */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

body {
  background: #0a0a0a;
  overflow: hidden;
  font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
}

canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

/* ---------- UI Panel (collapsible) ---------- */
.ui-panel {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: 360px;
  background: rgba(18, 18, 24, 0.94);
  backdrop-filter: blur(18px);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 20;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.6);
}

.ui-panel.collapsed {
  transform: translateX(100%);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  background: rgba(0, 0, 0, 0.5);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-header h2 {
  font-size: 1.3rem;
  font-weight: 500;
  background: linear-gradient(135deg, #fff, #a0a0ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.toggle-panel-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 20px;
  width: 34px;
  height: 34px;
  border-radius: 30px;
  cursor: pointer;
  transition: 0.2s;
}

.toggle-panel-btn:hover {
  background: #5a6bc0;
  transform: scale(1.02);
}

/* Playlist section with custom scrollbar */
.playlist-section {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  scrollbar-width: thin;
  scrollbar-color: #5a6bc0 #1e1e2a;
}

.playlist-section::-webkit-scrollbar {
  width: 6px;
}

.playlist-section::-webkit-scrollbar-track {
  background: #1e1e2a;
  border-radius: 6px;
}

.playlist-section::-webkit-scrollbar-thumb {
  background: #5a6bc0;
  border-radius: 6px;
}

.empty-playlist {
  text-align: center;
  opacity: 0.6;
  padding: 30px 20px;
}

.playlist-item {
  background: rgba(30, 30, 40, 0.7);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: 0.15s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-left: 4px solid transparent;
}

.playlist-item:hover {
  background: rgba(70, 70, 100, 0.8);
  transform: translateX(2px);
}

.playlist-item.active {
  background: rgba(80, 100, 200, 0.7);
  border-left-color: #ffaa66;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.track-info {
  flex: 1;
  overflow: hidden;
}

.track-name {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #f0f0f0;
}

.track-duration {
  font-size: 11px;
  opacity: 0.7;
  margin-top: 4px;
}

.delete-track {
  background: none;
  border: none;
  color: #ff8a7a;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 20px;
}

.delete-track:hover {
  background: rgba(255, 80, 80, 0.3);
  color: #ffb5a5;
}

/* Control bar */
.controls {
  background: rgba(0, 0, 0, 0.65);
  padding: 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-area {
  margin-bottom: 15px;
}

.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 6px;
  color: #e0e0e0;
}

input[type="range"] {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  background: #3a3a4a;
  border-radius: 5px;
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px #5a6bc0;
  cursor: pointer;
}

.buttons-row {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin: 12px 0;
}

.ctrl-btn {
  background: rgba(40, 40, 55, 0.9);
  border: none;
  color: white;
  font-size: 22px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.1s;
}

.ctrl-btn:hover {
  background: #5a6bc0;
  transform: scale(1.03);
}

.mode-buttons {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}

.mode-btn {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 10px;
  border-radius: 40px;
  font-size: 12px;
  cursor: pointer;
  color: #ccc;
  flex: 1;
  text-align: center;
}

.mode-btn.active {
  background: #3b4f8c;
  border-color: #ffbb66;
  color: white;
}

.upload-area {
  margin-top: 14px;
}

.upload-btn {
  background: rgba(60, 70, 100, 0.8);
  border: 1px dashed #aaa;
  padding: 10px;
  border-radius: 40px;
  width: 100%;
  font-size: 12px;
  cursor: pointer;
  color: #ddd;
}

.upload-btn:hover {
  background: #2a3a60;
}

.now-playing {
  font-size: 12px;
  text-align: center;
  margin-top: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #cdcdff;
}

/* Edge reveal button (shown when panel collapsed) */
.edge-reveal {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  display: none;
  pointer-events: none;
}

.edge-reveal.show {
  display: block;
  pointer-events: auto;
}

.reveal-btn {
  background: #2a2a3cd9;
  backdrop-filter: blur(12px);
  border: none;
  border-radius: 30px 0 0 30px;
  padding: 12px 12px 12px 16px;
  font-size: 28px;
  cursor: pointer;
  color: white;
  box-shadow: -3px 0 15px rgba(0, 0, 0, 0.4);
  transition: 0.2s;
}

.reveal-btn:hover {
  background: #5a6bc0;
  padding-right: 18px;
}
