/* Ergänzungen zu Tailwind: alles, was sich mit Utility-Klassen schlecht
   ausdrücken lässt (Scrollbars, native Controls, Canvas-Rendering). */

:root {
  color-scheme: dark;
}

html,
body {
  min-height: 100%;
}

/* Dezente Scrollbar im Dark Mode */
* {
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: #334155;
  border: 3px solid transparent;
  border-radius: 9999px;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background-color: #475569;
}

/* Das native Such-X von WebKit passt farblich nicht ins Layout. */
input[type='search']::-webkit-search-cancel-button {
  -webkit-appearance: none;
  height: 14px;
  width: 14px;
  cursor: pointer;
  background: currentColor;
  color: #64748b;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M6 6l8 8M14 6l-8 8' stroke='black' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Spinner der BPM-Felder ausblenden – die Pfeile sind bei 3-stelligen
   Werten mehr im Weg als hilfreich. */
input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type='number'] {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* Waveform: das Canvas skaliert über devicePixelRatio, darum hier nur
   die CSS-Größe festnageln. */
#waveform {
  display: block;
  width: 100%;
  height: 48px;
  touch-action: none;
}

/* Volume-Slider in beiden Engines gleich schlank */
input[type='range'] {
  height: 4px;
  border-radius: 9999px;
  background: #334155;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 14px;
  width: 14px;
  border-radius: 9999px;
  background: #a78bfa;
  cursor: pointer;
}

input[type='range']::-moz-range-thumb {
  height: 14px;
  width: 14px;
  border: none;
  border-radius: 9999px;
  background: #a78bfa;
  cursor: pointer;
}

/* Dropzone-Feedback beim Drag & Drop */
#dropzone * {
  pointer-events: none;
}

/* ---- Navigation ---- */
.nav-item {
  color: #cbd5e1;
}

.nav-item:hover {
  background-color: #1e293b;
}

.nav-item.active {
  background-color: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  font-weight: 600;
}

/* Umbenennen/Löschen erst beim Hovern zeigen, damit die Liste ruhig bleibt. */
.nav-item .nav-actions {
  opacity: 0;
  transition: opacity 0.12s;
}

.nav-item:hover .nav-actions,
.nav-item:focus-within .nav-actions {
  opacity: 1;
}

/* Ziel-Hervorhebung, wenn Tracks auf einen Ordner gezogen werden. */
.nav-item.drop-target {
  background-color: rgba(139, 92, 246, 0.28);
  outline: 1px dashed #a78bfa;
}

/* Sidebar als Overlay auf schmalen Screens */
@media (max-width: 1023px) {
  #sidebar.open {
    display: block;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 45;
    width: 16rem;
    overflow-y: auto;
    padding: 1rem;
    background-color: #0f172a;
    border-right: 1px solid #1e293b;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
