/* multitrack-dark.css - Studio Dark Theme */
:root {
  /* Studio Dark Theme: Colores principales */
  --color-primary: #43b5b1;
  --color-primary-light: #52ddda;
  --color-primary-dark: #235759;
  --color-secondary: #10b981;
  --color-error: #ef4444;

  /* Escala de grises: Paleta Studio */
  --color-text-primary: #e2e8f0;
  --color-text-secondary: #9ca3af;

  --color-background: #1e2126;
  /* --bg-main */
  --color-surface-dark: #1a1d22;
  /* --bg-panel (Controles principales) */
  --color-surface: #22262b;
  /* --bg-sidebar (Sidebar) */

  --color-card-bg: #262a30;
  /* --bg-track */
  --color-card-hover: #2c3138;

  --color-border: #374151;

  /* Bordes y sombras */
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-button: 0 4px 15px rgba(67, 181, 177, 0.2);
  --shadow-button-hover: 0 6px 20px rgba(67, 181, 177, 0.4);

  /* Pistas individuales Acents */
  --track-teal: #43b5b1;
  --track-orange: #f97316;
  --track-yellow: #f59e0b;
  --track-purple: #8b5cf6;
}

/* Estructura base */
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background-color: var(--color-background);
  color: var(--color-text-primary);
  font-family: "Inter", sans-serif;
  position: relative;
  overflow-x: hidden;
}

.multitrack-container {
  display: flex;
  flex-grow: 1;
  padding: 0;
  box-sizing: border-box;
  height: calc(100vh - 40px);
  overflow: hidden;
}

/* Sidebar de canciones */
#multitrack-list-container {
  width: 300px;
  min-width: 300px;
  background-color: var(--color-surface);
  border-right: 1px solid #1f2328;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.3);
  overflow-y: hidden;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  z-index: 10;
}

.sidebar-header {
  padding: 1.5rem 1.5rem 0.5rem 1.5rem;
}

.sidebar-header h2 {
  font-size: 0.8rem;
  color: var(--color-text-secondary);
  margin-bottom: 1.5rem;
  text-align: center;
  font-weight: 500;
  font-family: "Inter", sans-serif;
  letter-spacing: 0.2em;
  line-height: 1.4;
}

.upload-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem;
  background-color: var(--color-primary-dark);
  color: var(--color-primary);
  border: 1px solid rgba(67, 181, 177, 0.3);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  transition:
    background-color 0.2s,
    opacity 0.2s;
}

.upload-btn:hover {
  opacity: 0.8;
}

.search-container {
  position: relative;
  margin-bottom: 1rem;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: #6b7280;
}

#song-search {
  width: 100%;
  background-color: #16181b;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  color: var(--color-text-primary);
  font-size: 0.875rem;
  outline: none;
  transition: border-color 0.2s ease;
  box-sizing: border-box;
}

#song-search::placeholder {
  color: #6b7280;
}

#song-search:focus {
  border-color: var(--color-primary);
}

#multitrack-list {
  list-style: none;
  padding: 0 1rem 1rem 1rem;
  margin: 0;
  overflow-y: auto;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}



#multitrack-list li {
  padding: 0.75rem 1rem;
  background-color: var(--color-card-bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease;
  font-size: 0.875rem;
  text-align: left;
  border: 1px solid transparent;
  color: var(--color-text-secondary);
}

#multitrack-list li:hover {
  background-color: var(--color-card-hover);
}

#multitrack-list li.active {
  background-color: #273135;
  color: var(--color-text-primary);
  border-color: var(--color-primary);
  font-weight: normal;
}

/* Contenedor principal del reproductor */
#multitrack-player-container {
  flex-grow: 1;
  padding: 4rem 2rem 1.5rem 2rem;
  margin-left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: transparent;
  width: auto;
  height: 100%;
  min-height: 0;
}

#multitrack-player-title {
  font-size: 2.2rem;
  font-family: "AtomicMarker", sans-serif;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--color-text-primary);
  text-transform: uppercase;
  margin-bottom: 1rem;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}

/* Lista de pistas de audio */
#multitrack-player {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 0 0.5rem;
  background: none;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.track-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1.25rem;
  background-color: var(--color-card-bg);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 768px;
  /* max-w-3xl */
  box-sizing: border-box;
  transition: background-color 0.2s ease;
  height: 70px;
  min-height: 70px;
  flex-shrink: 0;
}

.track-card:hover {
  background-color: var(--color-card-hover);
}

/* M-07: Mini-waveform decorativo */
.track-waveform {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% - 180px);
  /* No invadir zona de botones MUTE/SOLO */
  height: 100%;
  opacity: 0.08;
  /* Muy sutil, solo decorativo */
  pointer-events: none;
  /* No interfiere con clics */
  z-index: 0;
}

.track-color-border {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
}

.track-info {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  width: 250px;
  padding-left: 0.75rem;
}

.track-icon-svg {
  min-width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.track-name-vu-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
}

.track-name {
  color: #e5e7eb;
  /* text-gray-200 */
  font-size: 0.95rem;
  /* text-base equivalent */
  font-weight: 500;
  letter-spacing: 0.025em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-sub-name {
  color: #9ca3af;
  /* Gris claro */
  font-size: 0.8rem;
  /* Un poco más pequeño que el 0.95rem principal */
  font-style: italic;
  margin-left: 2px;
}

/* VU Meters Simulation */
.track-vu-container {
  display: flex;
  gap: 3px;
  align-items: center;
}

.vu-bar {
  width: 4px;
  height: 8px;
  border-radius: 2px;
  background-color: #374151;
}

.vu-green {
  background-color: #43b5b1;
  box-shadow: 0 0 4px rgba(67, 181, 177, 0.4);
}

.vu-yellow {
  background-color: #f59e0b;
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.4);
}

.vu-orange {
  background-color: #ef4444;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
}

/* Sliders */
.track-slider-container {
  width: 140px;
  padding: 0 1rem;
  position: relative;
  display: flex;
  align-items: center;
}

.track-volume {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  background: transparent;
  outline: none;
  margin: 0;
}

.track-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 5px;
  background: linear-gradient(180deg, #e5e7eb, #9ca3af);
  box-shadow:
    inset 0 -1px 1px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    0 2px 4px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  margin-top: -5px;
  border: 1px solid #4b5563;
  position: relative;
  z-index: 20;
}

.track-volume::-moz-range-thumb {
  height: 16px;
  width: 16px;
  border-radius: 5px;
  background: linear-gradient(180deg, #e5e7eb, #9ca3af);
  box-shadow:
    inset 0 -1px 1px rgba(0, 0, 0, 0.3),
    inset 0 1px 1px rgba(255, 255, 255, 0.7),
    0 2px 4px rgba(0, 0, 0, 0.6);
  cursor: pointer;
  border: 1px solid #4b5563;
  position: relative;
  z-index: 20;
}

.track-volume::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: linear-gradient(to right,
      var(--color-primary) 0%,
      var(--color-primary) var(--progress, 80%),
      #111316 var(--progress, 80%),
      #111316 100%);
  border-radius: 4px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

.track-volume::-moz-range-track {
  width: 100%;
  height: 6px;
  cursor: pointer;
  background: linear-gradient(to right,
      var(--color-primary) 0%,
      var(--color-primary) var(--progress, 80%),
      #111316 var(--progress, 80%),
      #111316 100%);
  border-radius: 4px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

/* Mute / Solo Buttons */
.track-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.track-btn {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.375rem 0;
  width: 70px;
  /* Fixed width to prevent shifting layout */
  text-align: center;
  border-radius: 9999px;
  /* rounded-full */
  text-transform: capitalize;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--color-border);
  outline: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

.mute-btn {
  background-color: #272a30;
  color: #9ca3af;
  border-color: #374151;
}

.mute-btn::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #4b5563;
  transition: background-color 0.2s ease;
}

.mute-btn.user-muted {
  background-color: #2e2024;
  color: #e5e7eb;
  border-color: #5c2020;
}

.mute-btn.user-muted::before {
  background-color: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
}

.solo-btn {
  background-color: #272a30;
  color: #9ca3af;
  border-color: #374151;
}

.solo-btn::after {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #4b5563;
  transition: background-color 0.2s ease;
}

.solo-btn.active {
  background-color: #202e24;
  color: #e5e7eb;
  border-color: #205c31;
}

.solo-btn.active::after {
  background-color: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

/* Responsividad Track Cards */
@media (max-width: 992px) {
  .track-card {
    flex-wrap: wrap;
    padding: 1rem;
    gap: 0.5rem;
    height: auto;
  }

  .track-info {
    width: 100%;
    margin-bottom: 0.5rem;
  }

  .track-vu-container {
    display: none;
    /* Hide VU meters on tablet/mobile to save space */
  }

  .track-slider-container {
    flex: 1;
  }
}

/* Bottom Control Panel */
.bottom-control-panel {
  background-color: var(--color-surface-dark);
  /* Using project variable */
  border-radius: 1rem;
  padding: 1.5rem;
  border: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 10;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
  margin-top: auto;
  width: 100%;
  max-width: 1024px;
  box-sizing: border-box;
  overflow: hidden;
  flex-shrink: 0;
}

#visualizer-container {
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.15;
  pointer-events: none;
  border-radius: 1rem;
  overflow: hidden;
  mix-blend-mode: screen;
}

#visualizer-container canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.control-panel-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 10;
}

/* Top Buttons */
.top-reset-buttons {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  justify-content: center;
}

.reset-action-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: #25282e;
  border: 1px solid #4b5563;
  /* gray-600 */
  color: #d1d5db;
  /* gray-300 */
  padding: 0.375rem 1rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  /* text-xs */
  cursor: pointer;
  transition: background-color 0.2s;
}

.reset-action-btn:svg {
  width: 12px;
  height: 12px;
}

.reset-action-btn:hover {
  background-color: #30343a;
}

/* Generate Button Row */
.generate-btn-wrapper {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 2rem;
}

.glow-btn {
  background-color: #2b686b;
  color: #f3f4f6;
  padding: 0.5rem 2rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  border: 1px solid rgba(67, 181, 177, 0.3);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 0 15px rgba(43, 104, 107, 0.4);
}

.glow-btn:hover {
  background-color: #367d80;
  box-shadow: 0 0 25px rgba(67, 181, 177, 0.8);
}

.glow-btn:disabled {
  background-color: #1f2937;
  color: #9ca3af;
  border-color: #374151;
  box-shadow: none;
  cursor: not-allowed;
}

/* Timeline Row */
.timeline-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 1.5rem;
  padding: 0 2.5rem;
  /* px-10 */
  box-sizing: border-box;
}

.timeline-row span[id="current-time"],
.timeline-row span[id="total-duration"] {
  font-variant-numeric: tabular-nums;
  min-width: 38px;
  text-align: center;
}

.progress-bar-wrapper {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  height: 1rem;
}

.progress-range-input {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 20;
}

.progress-track-bg {
  position: absolute;
  width: 100%;
  height: 6px;
  background-color: #111316;
  border-radius: 9999px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  z-index: 10;
  pointer-events: none;
}

.progress-fill-active {
  height: 100%;
  background-color: #43b5b1;
}

.progress-thumb-custom {
  position: absolute;
  height: 12px;
  width: 12px;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  border: 1px solid #9ca3af;
  z-index: 10;
  pointer-events: none;
  margin-top: -1px;
  /* visual center */
}

/* Volume Control */
.master-volume-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 8rem;
  /* w-32 */
  margin-left: 1rem;
}

.volume-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
  display: flex;
  align-items: center;
}

.volume-btn:hover {
  color: white;
}

.master-volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right,
      #43b5b1 0%,
      #43b5b1 var(--progress, 80%),
      #374151 var(--progress, 80%),
      #374151 100%);
  border-radius: 2px;
  outline: none;
}

.master-volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #9ca3af;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s;
}

.master-volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #d1d5db;
}

/* Bottom Controls */
.bottom-controls-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2.5rem 0.5rem 2.5rem;
  /* px-10 pb-2 */
  box-sizing: border-box;
}

.master-vu-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: 16rem;
  /* w-64 */
}

.vu-label {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-bottom: 0.5rem;
}

.vu-meters-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vu-meter-row {
  display: flex;
  gap: 2px;
}

.master-vu-bar {
  width: 8px;
  height: 12px;
  background-color: #374151;
  border-radius: 1px;
}

.master-vu-green {
  background-color: #10b981;
  box-shadow: 0 0 4px rgba(16, 185, 129, 0.4);
}

.master-vu-yellow {
  background-color: #f59e0b;
  box-shadow: 0 0 4px rgba(245, 158, 11, 0.4);
}

.master-vu-orange {
  background-color: #ef4444;
  box-shadow: 0 0 4px rgba(239, 68, 68, 0.4);
}

.vu-labels {
  display: flex;
  justify-content: space-between;
  width: 156px;
  font-size: 8px;
  color: #6b7280;
  margin-top: 4px;
}

/* Playback Controls */
.playback-controls {
  display: flex;
  align-items: center;
  gap: 2rem;
  /* gap-8 */
  margin: 0 auto;
}

.transport-btn {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.transport-btn:hover {
  color: white;
}

.play-btn-glow {
  background: linear-gradient(135deg, #1e4e50, #43b5b1);
  color: white;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(67, 181, 177, 0.4);
}

.play-btn-glow:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 20px rgba(67, 181, 177, 0.6);
}

.play-btn-glow:disabled {
  background: #374151;
  color: #6b7280;
  box-shadow: none;
  transform: scale(1);
  cursor: not-allowed;
}

.mobile-volume-container {
  display: none;
}

.spacer-right {
  width: 16rem;
}

/* Responsiveness adjustments */
@media (max-width: 992px) {
  .hidden-tablet {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .hidden-mobile {
    display: none !important;
  }

  .mobile-volume-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 8rem;
    justify-content: flex-end;
  }

  .timeline-row {
    padding: 0 1rem;
  }

  .bottom-controls-row {
    padding: 0 1rem 0.5rem 1rem;
  }

  .playback-controls {
    gap: 1.5rem;
  }
}

#progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary-light);
  cursor: pointer;
  margin-top: -2px;
  position: relative;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.7);
  border: 2px solid var(--color-surface-dark);
  z-index: 2;
}

#progress-bar::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary-light);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.7);
  border: 2px solid var(--color-surface-dark);
  z-index: 2;
}

#progress-bar::-ms-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary-light);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.7);
  border: 2px solid var(--color-surface-dark);
  z-index: 2;
}

#progress-bar::-ms-fill-lower {
  background: transparent;
  border-radius: 7px;
}

#progress-bar::-ms-fill-upper {
  background: transparent;
  border-radius: 7px;
}

#progress-bar:focus {
  outline: none;
}

#progress-bar::-webkit-slider-runnable-track {
  background: transparent;
}

#progress-bar::-moz-range-track {
  height: 15px;
  border-radius: 7px;
  background: transparent;
}

#progress-bar::-ms-fill-lower,
#progress-bar::-ms-fill-upper {
  height: 15px;
}

/* Tooltip para main-volume */
#main-volume-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  z-index: 2;
  /* Above visualizer */
}

#main-volume-tooltip {
  position: absolute;
  top: -32px;
  left: 0;
  min-width: 36px;
  text-align: center;
  font-size: 0.95rem;
  color: #fff;
  background: rgba(30, 30, 30, 0.92);
  padding: 2px 8px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.3s,
    left 0.2s;
  z-index: 2;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* Loader */
#multitrack-player-loader {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: rgba(31, 41, 55, 0.95);
  color: var(--color-text-primary);
  padding: 2rem 3rem;
  border-radius: var(--radius-lg);
  z-index: 100;
  min-width: 200px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  border: 1px solid var(--color-primary);
}

#multitrack-player-loader .loader-spinner {
  border: 4px solid rgba(59, 130, 246, 0.1);
  border-top: 4px solid var(--color-primary-light);
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
  margin-left: auto;
  margin-right: auto;
  display: block;
}

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

  100% {
    transform: rotate(360deg);
  }
}

/* Responsividad */
@media (max-width: 992px) {
  .multitrack-container {
    flex-direction: column;
  }

  #multitrack-list-container {
    width: 100%;
    height: auto;
    max-height: 30vh;
    position: static;
    margin-bottom: 1.5rem;
    overflow-y: scroll;
  }



  #multitrack-player-container {
    margin-left: 0;
    width: 100%;
    padding: 1.5rem;
  }

  #multitrack-player {
    max-height: 50vh;
  }

  .track-control {
    flex-wrap: wrap;
  }

  .track-control label {
    flex: 0 0 100%;
  }

  .track-control input[type="range"] {
    flex: 1;
    min-width: 100px;
  }
}

@media (max-width: 576px) {
  #multitrack-player-title {
    font-size: 1.8rem;
  }

  .track-control {
    padding: 0.6rem;
    gap: 0.5rem;
  }

  .track-control .mute-btn,
  .track-control .solo-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.7rem;
  }

  #multitrack-controls {
    padding: 0.7rem 0.5rem 0.7rem 0.5rem;
    gap: 0.7rem;
  }

  #multitrack-controls .progress-container {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    max-width: 100%;
    width: 100%;
    padding: 0;
    position: relative;
  }

  #progress-bar {
    height: 18px;
    min-width: 100%;
    max-width: 100%;
  }

  .progress-times-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.1rem;
  }

  #current-time {
    text-align: left;
    min-width: 40px;
    font-size: 0.85rem;
  }

  #total-duration {
    text-align: right;
    min-width: 40px;
    font-size: 0.85rem;
  }

  .playback-buttons-row {
    gap: 1.2rem;
    margin-top: 0.7rem;
  }

  .playpause-btn {
    width: 44px;
    height: 44px;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }

  .progress-container .volume-control svg {
    width: 18px;
    height: 18px;
  }

  .progress-container .volume-control input[type="range"] {
    width: 60px;
  }

  .multitrack-container {
    padding: 0.4rem 0.2rem;
    gap: 0.7rem;
  }

  #multitrack-player-container {
    padding: 0.7rem 0.3rem;
  }

  #multitrack-controls .volume-control input[type="range"],
  #main-volume {
    width: 200px !important;
    min-width: 200px !important;
    max-width: 400px !important;
  }

  .progress-container #current-time,
  .progress-container #total-duration {
    display: none !important;
  }

  .progress-times-row-mobile {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
    margin-top: 0.1rem;
    font-size: 0.85rem;
    color: var(--color-text-primary);
    font-family: "Roboto Mono", monospace;
  }

  .progress-container .volume-control,
  .volume-control {
    display: none !important;
  }

  .volume-control-mobile {
    display: flex !important;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin: 0.7rem 0 0.2rem 0;
    width: 100%;
  }

  .volume-control-mobile input[type="range"] {
    width: 90px !important;
    min-width: 60px !important;
    max-width: 120px !important;
  }

  #song-search {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
  }

  #visualizer-container {
    height: 80px;
    /* Reduced height for mobile */
  }
}

@media (min-width: 577px) {
  .progress-times-row-mobile {
    display: none !important;
  }

  .volume-control-mobile {
    display: none !important;
  }
}

.playback-buttons-volume {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  width: 100%;
  margin-top: 1rem;
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.slider-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.slider-tooltip {
  position: absolute;
  top: -32px;
  left: 0;
  min-width: 36px;
  text-align: center;
  font-size: 0.95rem;
  color: #fff;
  background: rgba(30, 30, 30, 0.92);
  padding: 2px 8px;
  border-radius: 6px;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.3s,
    left 0.2s;
  z-index: 2;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.playback-buttons-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  width: 100%;
  margin-top: 1.2rem;
}

.playpause-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #007fd1, #c600ff);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  box-shadow: var(--shadow-button);
  cursor: pointer;
  transition:
    box-shadow 0.2s,
    background 0.2s;
  position: relative;
  padding: 0;
}

.playpause-btn:disabled {
  background: #4b5563;
  cursor: not-allowed;
  box-shadow: none;
}

.playpause-btn svg {
  display: block;
}

.icon-btn {
  background: none;
  border: none;
  box-shadow: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  transition: background 0.2s;
  z-index: 5;
}

.icon-btn svg {
  display: block;
  stroke: var(--color-primary-light);
}

.icon-btn:active svg,
.icon-btn:focus svg {
  stroke: var(--color-primary);
}

.play-icon,
.pause-icon {
  fill: #fff !important;
  stroke: #fff !important;
}

.playpause-btn svg {
  fill: #fff !important;
  stroke: #fff !important;
}

/* Estilos para la Modal DCIBEL */
.dcibel-modal-overlay {
  display: none;
  /* Oculta por defecto */
  position: fixed;
  z-index: 2000;
  /* Muy alto para estar encima de todo */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.7);
  /* Fondo oscuro semitransparente */
  align-items: center;
  /* Centrado vertical */
  justify-content: center;
  /* Centrado horizontal */
}

.dcibel-modal-content {
  background-color: var(--color-surface-dark, #282c34);
  color: var(--color-text-primary, #f1f1f1);
  padding: 25px 30px;
  border: 1px solid var(--color-border, #444851);
  border-radius: var(--radius-lg, 12px);
  width: 90%;
  max-width: 480px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
  text-align: center;
  position: relative;
  animation: dcibelModalAppear 0.3s ease-out;
}

@keyframes dcibelModalAppear {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.dcibel-modal-close {
  color: var(--color-text-secondary, #aaa);
  position: absolute;
  top: 12px;
  right: 20px;
  font-size: 30px;
  font-weight: bold;
  transition: color 0.2s ease;
}

.dcibel-modal-close:hover,
.dcibel-modal-close:focus {
  color: var(--color-primary-light, #60a5fa);
  text-decoration: none;
  cursor: pointer;
}

.dcibel-modal-icon {
  margin-bottom: 15px;
}

.dcibel-modal-icon svg {
  color: var(--color-secondary, #10b981);
  /* Verde para éxito */
  width: 50px;
  height: 50px;
}

.dcibel-modal-content h3 {
  font-size: 1.6rem;
  color: var(--color-text-primary, #fff);
  margin-top: 0;
  margin-bottom: 10px;
  font-weight: 500;
}

.dcibel-modal-content p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 25px;
  color: var(--color-text-secondary, #ccc);
}

.dcibel-modal-button {
  background: linear-gradient(135deg,
      var(--color-primary),
      var(--color-primary-dark));
  color: white;
  padding: 12px 25px;
  border: none;
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-button);
}

.dcibel-modal-button:hover {
  background: linear-gradient(135deg,
      var(--color-primary-dark),
      var(--color-primary));
  box-shadow: var(--shadow-button-hover);
  transform: translateY(-1px);
}

/* ===== M-01: Botones Unmute All / Solo Off ===== */
.track-reset-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 0.75rem;
}

.reset-btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--color-text-secondary);
  border: 1px solid var(--color-border);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
}

.reset-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: var(--color-text-primary);
  border-color: var(--color-primary-light);
}

.reset-btn:active {
  transform: scale(0.96);
}

/* ===== M-03: Pantalla de Bienvenida ===== */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  padding: 3rem 2rem;
  text-align: center;
  animation: welcomeFadeIn 0.6s ease;
}

@keyframes welcomeFadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.welcome-icon {
  color: var(--color-primary-light);
  opacity: 0.5;
  margin-bottom: 1.5rem;
  animation: welcomePulse 3s ease-in-out infinite;
}

@keyframes welcomePulse {

  0%,
  100% {
    opacity: 0.4;
    transform: scale(1);
  }

  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

.welcome-text {
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  font-weight: 400;
  margin: 0 0 2rem 0;
  line-height: 1.6;
  max-width: 500px;
}

.welcome-title {
  font-size: 2rem;
  color: var(--color-text-primary);
  margin: 0 0 0.5rem 0;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.welcome-features {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
  max-width: 600px;
  width: 100%;
}

.welcome-features li {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  font-size: 0.95rem;
  line-height: 1.5;
  display: flex;
  align-items: center;
  transition:
    transform 0.2s,
    background 0.2s;
}

.welcome-features li:hover {
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.1);
}

.feature-icon {
  font-size: 1.4rem;
  margin-right: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
}

.welcome-hint {
  font-size: 0.9rem;
  color: var(--color-text-secondary);
  opacity: 0.6;
  margin-top: 0.5rem;
}

/* ===== M-04: Modal de carga (un solo div) ===== */
#multitrack-player-loader {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 999;
  width: 90%;
  max-width: 460px;
  padding: 2rem 2.5rem;
  background: linear-gradient(145deg,
      rgba(80, 92, 100, 0.7),
      rgba(22, 24, 26, 0.75));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 24px;
  /* box-shadow gigante = overlay oscuro cubriendo toda la pantalla */
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.75);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

.track-loader-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-primary-light);
  text-align: center;
}

.track-loader-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  width: 100%;
  font-size: 0.85rem;
}

.track-loader-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text-secondary);
  transition: all 0.3s ease;
}

.track-loader-item.downloading {
  color: var(--color-text-primary);
  background: rgba(59, 130, 246, 0.08);
}

.track-loader-item.decoding {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.08);
}

.track-loader-item.loaded {
  color: var(--color-secondary);
}

.track-loader-item.error {
  color: var(--color-error);
}

.track-loader-item .status-icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.track-loader-item .track-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-loader-item .track-item-percent {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary-light);
  min-width: 36px;
  text-align: right;
}

/* Mini barra de progreso por pista */
.track-item-bar {
  width: 50px;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.track-item-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--color-primary);
  border-radius: 2px;
  transition: width 0.15s ease;
}

.track-loader-item.loaded .track-item-bar-fill {
  background: var(--color-secondary);
  width: 100% !important;
}

.track-loader-item.error .track-item-bar-fill {
  background: var(--color-error);
  width: 100% !important;
}

.track-loader-item.downloading .status-icon::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--color-primary-light);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.track-loader-item.decoding .status-icon::after {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid #fbbf24;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Barra de progreso global */
.track-loader-progress {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.track-loader-bar-bg {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.track-loader-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg,
      var(--color-primary),
      var(--color-secondary));
  border-radius: 3px;
  transition: width 0.2s ease;
}

#track-loader-percent {
  font-size: 0.85rem;
  color: var(--color-primary-light);
  font-weight: 600;
  min-width: 36px;
  text-align: right;
}

/* Master Gain Control */
.master-gain-container {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  width: 16rem;
}

.gain-slider-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  width: 100%;
}

.gain-val {
  font-size: 0.75rem;
  color: #f59e0b;
  min-width: 30px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.gain-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 4px;
  background: #374151;
  border-radius: 2px;
  outline: none;
}

.gain-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #f59e0b;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  transition:
    transform 0.1s,
    background 0.1s;
}

.gain-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #fbbf24;
}

/* ===== M-05: Fix fondo del upload modal ===== */
#upload-multitrack-modal {
  background-color: rgba(0, 0, 0, 0.75) !important;
  backdrop-filter: blur(4px);
}

.upload-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
}

.upload-modal-content {
  background: linear-gradient(145deg,
      rgba(60, 65, 70, 0.95),
      rgba(30, 32, 36, 0.98));
  backdrop-filter: blur(10px);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  text-align: left;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-primary);
}

/* === Toolbar DAW Style === */
.daw-toolbar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 38px;
  display: flex;
  background-color: #1a1e23;
  /* Color de fondo sólido oscuro como DAW */
  padding: 0 1rem;
  margin: 0;
  z-index: 50;
  gap: 0;
  /* Sin espacio entre botones como en menú nativo */
  justify-content: flex-start;
  /* Todo alineado a la izquierda */
  border-bottom: 1px solid #2e3640;
}

.toolbar-menu-wrapper {
  position: relative;
  display: flex;
}

.toolbar-menu-btn {
  background: transparent;
  border: none;
  border-radius: 0;
  color: #c9d1d9;
  padding: 0 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: none;
  /* Inmediato como un SO */
  height: 100%;
  font-family: inherit;
  backdrop-filter: none;
  display: flex;
  align-items: center;
}

.toolbar-menu-btn:hover {
  background: #2e3640;
  color: #fff;
  border-color: transparent;
  box-shadow: none;
}

.toolbar-dropdown {
  position: absolute;
  top: 100%;
  /* Pega justo abajo de la barra */
  left: 0;
  background-color: #1a1e23;
  /* Fondo totalmente sólido opaco */
  border: 1px solid #2e3640;
  border-top: none;
  border-radius: 0 0 4px 4px;
  min-width: 220px;
  display: none;
  flex-direction: column;
  padding: 0.5rem 0;
  margin-top: 0;
  /* ELIMINADO EL GAP DE 5PX QUE IMPEDIA HACER HOVER */
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.7);
  z-index: 1000;
}

.toolbar-menu-wrapper:hover .toolbar-dropdown {
  display: flex;
}

.dropdown-item {
  background: transparent;
  border: none;
  color: #d1d5db;
  padding: 0.55rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  transition: none;
}

.dropdown-item:hover {
  background-color: #43b5b1;
  /* Fondo seleccionado azul o turquesa estilo sistema */
  color: #fff;
}

.dropdown-divider {
  height: 1px;
  background-color: #2e3640;
  margin: 0.35rem 0;
}

.shortcut {
  color: #9ca3af;
  font-size: 0.75rem;
}

.dropdown-item:hover .shortcut {
  color: #fff;
}

.generate-item {
  color: #fff !important;
  font-weight: 600;
}

/* === Master Actions Card === */
.master-actions-card {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-top: 0 !important;
}

.master-actions-card:hover {
  transform: none !important;
  border-color: transparent !important;
}

/* === Upload Drop Zone === */
.upload-drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 1rem;
  border: 2px dashed #4b5563;
  border-radius: 10px;
  background-color: rgba(22, 24, 27, 0.6);
  cursor: pointer;
  transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease;
  color: #6b7280;
  text-align: center;
}

.upload-drop-zone:hover {
  border-color: var(--color-primary);
  background-color: rgba(67, 181, 177, 0.05);
}

.upload-drop-zone.drag-over {
  border-color: var(--color-primary);
  background-color: rgba(67, 181, 177, 0.1);
  box-shadow: inset 0 0 20px rgba(67, 181, 177, 0.08), 0 0 12px rgba(67, 181, 177, 0.15);
}

.upload-drop-zone svg {
  color: #6b7280;
  transition: color 0.25s ease, transform 0.25s ease;
}

.upload-drop-zone:hover svg,
.upload-drop-zone.drag-over svg {
  color: var(--color-primary);
  transform: translateY(-2px);
}

.drop-zone-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: #9ca3af;
  pointer-events: none;
}

.drop-zone-hint {
  font-size: 0.75rem;
  color: #6b7280;
  pointer-events: none;
}

.upload-file-list {
  max-height: 120px;
  overflow-y: auto;
  font-size: 0.8rem;
  color: #888;
  margin-top: 8px;
}

.upload-file-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.upload-file-count {
  font-size: 0.8rem;
  color: var(--color-primary);
  font-weight: 500;
}

.upload-clear-btn {
  background: none;
  border: none;
  color: #ef4444;
  font-size: 0.75rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background-color 0.2s ease;
}

.upload-clear-btn:hover {
  background-color: rgba(239, 68, 68, 0.15);
}

.upload-file-item {
  padding: 3px 0;
  border-bottom: 1px solid rgba(75, 85, 99, 0.3);
  color: #9ca3af;
}

.upload-file-item:last-child {
  border-bottom: none;
}