/* ==== POLISHED ORANGE THEME ==== */
:root {
  color-scheme: dark;
  --primary: #ff9500;
  --primary-light: #ffb143;
  --primary-dark: #e68500;
  --primary-glow: rgba(255, 149, 0, 0.4);
  --bg-dark: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-card-light: #242424;
  --bg-card-hover: #2a2a2a;
  --text-primary: #ffffff;
  --text-secondary: #b0b0b0;
  --text-dim: #707070;
  --shadow: rgba(0, 0, 0, 0.6);
  --shadow-glow: rgba(255, 149, 0, 0.25);
  --border-subtle: rgba(255, 255, 255, 0.05);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family:
    "SF Pro Display",
    "Helvetica Neue",
    -apple-system,
    BlinkMacSystemFont,
    "Inter",
    Helvetica,
    Roboto,
    "Segoe UI",
    Arial,
    "Nimbus Sans",
    sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(135deg, var(--bg-dark) 0%, #0a0a0a 100%);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px;
  min-height: 100vh;
  line-height: 1.5;
}

/* ---- Header ---- */
.header {
  text-align: center;
  margin-bottom: 2.5rem;
}
.header h1 {
  color: var(--primary);
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow:
    0 0 20px var(--primary-glow),
    0 0 40px var(--primary-glow);
  font-size: 2.5rem;
  margin-bottom: 8px;
}
.header h3 {
  font-weight: 400;
  font-size: 0.9rem;
  color: var(--text-secondary);
  letter-spacing: 0.3px;
}

/* ---- Panels ---- */
#controls,
#playlist {
  width: 100%;
  max-width: 900px;
  background: var(--bg-card);
  padding: 28px;
  border-radius: 16px;
  margin: 16px 0;
  border: 1px solid var(--border-subtle);
  box-shadow:
    0 8px 24px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: transform 0.2s ease;
}

#controls:hover,
#playlist:hover {
  transform: translateY(-2px);
  box-shadow:
    0 12px 32px var(--shadow),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#fftCanvas {
  width: 100%;
  max-width: 900px;
  height: 220px;
  background: #000;
  border-radius: 12px;
  margin-top: 1.5rem;
  border: 2px solid rgba(255, 149, 0, 0.2);
  box-shadow:
    inset 0 0 20px rgba(0, 0, 0, 0.9),
    0 0 20px var(--primary-glow);
}

/* ---- Playlist ---- */
#playlist {
  max-width: 500px;
}
#playlist li {
  list-style: none;
  padding: 12px 18px;
  margin: 6px 0;
  background: var(--bg-card-light);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  border: 1px solid transparent;
}
#playlist li:hover {
  background: var(--bg-card-hover);
  transform: translateX(4px);
  border-color: var(--border-subtle);
}
#playlist li.active {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  color: #000;
  font-weight: 600;
  box-shadow: 0 4px 12px var(--primary-glow);
  border-color: var(--primary-light);
}

/* ---- General Controls ---- */
label {
  display: flex;
  align-items: center;
  margin-top: 6px;
  margin-bottom: 4px;
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
}
label span {
  flex: 1;
}

/* ==== ENHANCED SLIDERS ==== */
.slider-container {
  position: relative;
  width: 100%;
  margin: 10px 0 16px 0;
}

.slider-wrapper {
  position: relative;
  height: 24px;
  display: flex;
  align-items: center;
}

input[type="range"] {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: #333;
  outline: none;
  position: relative;
  z-index: 2;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  cursor: grab;
  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.4),
    0 0 12px var(--primary-glow);
  transition: all 0.2s ease;
  position: relative;
  z-index: 3;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.1),
    0 3px 12px rgba(0, 0, 0, 0.5),
    0 0 16px var(--primary-glow);
}

input[type="range"]::-webkit-slider-thumb:active {
  cursor: grabbing;
  transform: scale(1.05);
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  cursor: grab;
  border: none;
  box-shadow:
    0 0 0 3px rgba(0, 0, 0, 0.3),
    0 2px 8px rgba(0, 0, 0, 0.4),
    0 0 12px var(--primary-glow);
  transition: all 0.2s ease;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.1),
    0 3px 12px rgba(0, 0, 0, 0.5),
    0 0 16px var(--primary-glow);
}

input[type="range"]::-moz-range-thumb:active {
  cursor: grabbing;
  transform: scale(1.05);
}

.slider-track {
  position: absolute;
  height: 8px;
  border-radius: 4px;
  background: #333;
  width: 100%;
  z-index: 1;
}

.slider-fill {
  position: absolute;
  height: 8px;
  border-radius: 4px 0 0 4px;
  background: linear-gradient(
    90deg,
    var(--primary-dark) 0%,
    var(--primary) 100%
  );
  z-index: 1;
  transition: width 0.1s ease;
  box-shadow: 0 0 8px var(--primary-glow);
}

.slider-value {
  position: absolute;
  top: -24px;
  right: 0;
  font-size: 0.75rem;
  color: var(--primary);
  background: rgba(0, 0, 0, 0.85);
  padding: 3px 8px;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  font-weight: 600;
  border: 1px solid rgba(255, 149, 0, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.slider-container:hover .slider-value {
  opacity: 1;
}

/* ---- Buttons ---- */
.style-btn,
.space-btn {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: var(--bg-card-light);
  color: var(--text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 2px 6px rgba(0, 0, 0, 0.3);
  margin: 0 6px 8px 0;
  border: 1px solid var(--border-subtle);
  font-weight: 500;
}
.style-btn:hover,
.space-btn:hover:not(.active) {
  background: var(--bg-card-hover);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 4px 12px rgba(0, 0, 0, 0.4);
}
.style-btn:active,
.space-btn:active {
  transform: translateY(0);
}
.style-btn.active,
.space-btn.active {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  color: #000;
  font-weight: 600;
  box-shadow: 0 4px 16px var(--primary-glow);
  border-color: var(--primary-light);
}

/* ---- Grid & Cards ---- */
.controls-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 24px;
}
.control-card {
  background: var(--bg-card-light);
  padding: 18px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transition: all 0.2s ease;
}
.control-card:hover {
  transform: translateY(-2px);
  box-shadow:
    0 6px 18px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.small {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
  display: block;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}
.button-row {
  margin-top: 10px;
}

/* ---- Misc ---- */
#audioFile {
  color: var(--text-secondary);
  margin-bottom: 20px;
  width: 100%;
  background: var(--bg-card-light);
  border: 2px dashed var(--border-subtle);
  border-radius: 10px;
  padding: 14px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
#audioFile:hover {
  border-color: var(--primary);
  background: var(--bg-card-hover);
}
#audioPlayer {
  background: var(--bg-card-light);
  border-radius: 10px;
  padding: 6px;
  width: 100%;
  margin-top: 20px;
  border: 1px solid var(--border-subtle);
}

/* ==== LUFS METER (ORANGE GLOW STYLE) ==== */
#lufsMeterContainer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 24px auto 10px;
  width: 85%;
  max-width: 620px;
}

#lufsLabel {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  opacity: 0.8;
}

#lufsMeter {
  position: relative;
  width: 100%;
  height: 20px;
  border-radius: 9999px;
  background: rgba(255, 120, 0, 0.05);
  border: 1px solid rgba(255, 150, 60, 0.15);
  overflow: hidden;
  box-shadow:
    inset 0 0 12px rgba(0, 0, 0, 0.7),
    0 0 16px rgba(255, 120, 0, 0.25);
}

#lufsFill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff6600, #ff9500, #ffaa33);
  box-shadow: 0 0 25px rgba(255, 120, 0, 0.5);
  transition:
    width 0.12s ease-out,
    box-shadow 0.25s ease;
}

#lufsText {
  position: absolute;
  width: 100%;
  text-align: center;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  color: var(--text-primary);
  font-weight: 600;
  text-shadow: 0 0 8px rgba(255, 120, 0, 0.6);
  pointer-events: none;
}

/* subtle pulse when near clipping */
@keyframes lufsPulse {
  0%,
  100% {
    box-shadow: 0 0 25px rgba(255, 90, 0, 0.7);
  }
  50% {
    box-shadow: 0 0 40px rgba(255, 120, 0, 1);
  }
}

.credits {
  margin-top: 24px;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-align: center;
}
.credits a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s ease;
}
.credits a:hover {
  color: var(--primary-light);
  text-decoration: underline;
}

/* Compact layout adjustments */
#controls > div:not(.controls-grid) {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* Responsive design */
@media (max-width: 968px) {
  #controls,
  #playlist,
  #fftCanvas {
    max-width: 100%;
  }

  .controls-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .header h1 {
    font-size: 2rem;
  }
}

@media (max-width: 640px) {
  .controls-grid {
    grid-template-columns: 1fr;
  }

  body {
    padding: 20px 16px;
  }

  #controls,
  #playlist {
    padding: 20px;
  }
}

/* Added */
.analyzer {
  margin-top: 10px !important;
}
.analyzer-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 500;
  margin-top: 25px !important;
}
.link-muted {
  color: var(--text-dim) !important;
}
.link-muted:hover {
  color: var(--text-secondary) !important;
}
.built {
  display: block;
  margin-top: 1ex;
}

.ab-btn-wrapper {
  margin-top: 15px;
  margin-bottom: 15px;
}
.ab-btn {
  background: #4caf50;
  color: white;
  border: none;
  padding: 8px 16px;
  margin: 5px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.ab-btn.bypass {
  background: #f44336;
}

/* Rendering indicator */
.rendering-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  flex-direction: column;
}

.rendering-content {
  background: #2a2a2a;
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
  max-width: 400px;
  border: 1px solid #444;
}

.rendering-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #333;
  border-top: 4px solid #ff6b00;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.rendering-text {
  color: white;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.rendering-subtext {
  color: #ccc;
  font-size: 0.9rem;
}

/* Global button style */
.control-btn {
  outline: none;
  border: none;
  padding: 8px 15px 6px 15px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
  border: 1px solid #666;
  background-color: #222;
  color: whitesmoke;
}
/* Added */
