/**
 * Estilos Específicos para Audio y Normalización
 * Fijate Tools - Conversor y normalizador de audio local
 */

/* Contenedor del Visualizador de Onda */
.waveform-card {
  background-color: var(--bg-code);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  position: relative;
}

.waveform-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.audio-file-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-time-badge {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background-color: var(--bg-surface-elevated);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  color: var(--accent-cyan);
  border: 1px solid var(--border-subtle);
}

.waveform-canvas-wrapper {
  position: relative;
  width: 100%;
  height: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-strong);
  background-color: #0b1120;
}

.waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Conmutador de Comparación A/B */
.ab-comparison-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-surface-elevated);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ab-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.ab-toggle-group {
  display: inline-flex;
  background-color: var(--bg-input);
  padding: 0.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-strong);
}

.ab-toggle-btn {
  border: none;
  background: transparent;
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ab-toggle-btn.active {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.ab-toggle-btn.processed.active {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

/* Barra de Transporte del Reproductor */
.player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.player-main-btns {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.play-btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  transition: all 0.18s ease;
}

.play-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.55);
}

/* Medidor de Picos y Volumen (VUMeter) */
.volume-meter-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  max-width: 200px;
}

.volume-meter-bar-container {
  display: flex;
  flex-direction: column;
  gap: 3px;
  flex: 1;
}

.meter-track {
  height: 6px;
  background-color: var(--bg-surface-hover);
  border-radius: 3px;
  overflow: hidden;
  position: relative;
}

.meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981 0%, #f59e0b 75%, #f43f5e 100%);
  transition: width 0.08s ease-out;
  border-radius: 3px;
}

/* Tarjetas de Métricas de Audio */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

.metric-card {
  background-color: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.metric-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.metric-badge {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-emerald);
}

/* Presets de Normalización (Pills) */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

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

.preset-card {
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-align: left;
}

.preset-card:hover {
  border-color: var(--accent-primary);
  background-color: rgba(59, 130, 246, 0.05);
}

.preset-card.active {
  border-color: var(--accent-primary);
  background-color: rgba(59, 130, 246, 0.12);
  box-shadow: 0 0 0 1px var(--accent-primary);
}

.preset-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.preset-desc {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* Deslizadores / Sliders */
.range-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.range-slider {
  flex: 1;
  accent-color: var(--accent-primary);
  height: 6px;
  background-color: var(--bg-surface-elevated);
  border-radius: 3px;
  outline: none;
}

.range-val {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-cyan);
  min-width: 45px;
  text-align: right;
}

/* Opciones de Selección Rápida (Botones Radio/Chips) */
.chip-selector {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.chip-btn {
  background-color: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text-secondary);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.chip-btn:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-primary);
}

.chip-btn.active {
  background-color: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #ffffff;
}

/* Conmutador Switch Toggle */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0;
}

.switch-label {
  display: flex;
  flex-direction: column;
}

.switch-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.switch-subtitle {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-round {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--bg-surface-hover);
  transition: 0.2s;
  border-radius: 22px;
  border: 1px solid var(--border-subtle);
}

.slider-round:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: #ffffff;
  transition: 0.2s;
  border-radius: 50%;
}

input:checked + .slider-round {
  background-color: var(--accent-primary);
}

input:checked + .slider-round:before {
  transform: translateX(18px);
}

/* Cola de Procesamiento por Lotes */
.batch-queue-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 280px;
  overflow-y: auto;
}

.batch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  gap: 0.75rem;
}

.batch-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1;
  min-width: 0;
}

.batch-item-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-item-meta {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.batch-progress-bar {
  width: 80px;
  height: 6px;
  background-color: var(--bg-surface-hover);
  border-radius: 3px;
  overflow: hidden;
}

.batch-progress-fill {
  height: 100%;
  width: 0%;
  background-color: var(--accent-emerald);
  transition: width 0.2s ease;
}

/* Barra de Acciones y Descarga */
.action-card {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-lg);
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.action-info h4 {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.action-info p {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
