/* ============================================
   Audio Tools Suite - WordPress Plugin CSS
   Light Mode Only - Optimized for Performance
   ============================================ */

:root {
  --ats-primary: #2563eb;
  --ats-primary-dark: #1d4ed8;
  --ats-primary-light: #dbeafe;
  --ats-secondary: #7c3aed;
  --ats-accent: #0ea5e9;
  --ats-success: #16a34a;
  --ats-warning: #d97706;
  --ats-danger: #dc2626;
  --ats-bg: #f8fafc;
  --ats-surface: #ffffff;
  --ats-surface-2: #f1f5f9;
  --ats-border: #e2e8f0;
  --ats-border-focus: #2563eb;
  --ats-text: #1e293b;
  --ats-text-muted: #64748b;
  --ats-text-light: #94a3b8;
  --ats-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
  --ats-shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
  --ats-radius: 12px;
  --ats-radius-sm: 8px;
  --ats-radius-lg: 16px;
  --ats-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --ats-wave-color: #3b82f6;
  --ats-wave-progress: #1d4ed8;
  --ats-wave-bg: #eff6ff;
  --ats-wave-cursor: #2563eb;
}

/* Reset & Base */
.ats-wrapper * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.ats-wrapper {
  font-family: var(--ats-font);
  color: var(--ats-text);
  background: var(--ats-bg);
  padding: 20px 0;
  width: 100%;
}

.ats-app {
  max-width: 1100px;
  margin: 0 auto;
  background: var(--ats-surface);
  border-radius: var(--ats-radius-lg);
  box-shadow: var(--ats-shadow-lg);
  overflow: hidden;
  border: 1px solid var(--ats-border);
}

/* Loading State */
.ats-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  color: var(--ats-text-muted);
  gap: 16px;
}

.ats-loading-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--ats-border);
  border-top-color: var(--ats-primary);
  border-radius: 50%;
  animation: ats-spin 0.8s linear infinite;
}

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

/* ============================================
   TOOLS NAVIGATION BAR
   ============================================ */
.ats-tools-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 12px 16px;
  background: var(--ats-surface-2);
  border-bottom: 2px solid var(--ats-border);
  align-items: center;
}

.ats-tool-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--ats-border);
  border-radius: 50px;
  background: var(--ats-surface);
  color: var(--ats-text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: var(--ats-font);
  line-height: 1;
}

.ats-tool-btn:hover {
  border-color: var(--ats-primary);
  color: var(--ats-primary);
  background: var(--ats-primary-light);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(37,99,235,0.15);
}

.ats-tool-btn.active {
  border-color: var(--ats-primary);
  color: #fff;
  background: var(--ats-primary);
  box-shadow: 0 2px 8px rgba(37,99,235,0.35);
}

.ats-tool-btn svg {
  flex-shrink: 0;
}

/* ============================================
   UPLOAD ZONE
   ============================================ */
.ats-upload-section {
  padding: 40px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.ats-upload-zone {
  width: 100%;
  max-width: 600px;
  border: 2.5px dashed var(--ats-border);
  border-radius: var(--ats-radius-lg);
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  background: var(--ats-surface-2);
  position: relative;
}

.ats-upload-zone:hover,
.ats-upload-zone.dragging {
  border-color: var(--ats-primary);
  background: var(--ats-primary-light);
  transform: scale(1.01);
}

.ats-upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.ats-upload-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--ats-primary), var(--ats-secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: white;
}

.ats-upload-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ats-text);
  margin-bottom: 8px;
}

.ats-upload-subtitle {
  font-size: 14px;
  color: var(--ats-text-muted);
  margin-bottom: 16px;
}

.ats-upload-btn-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ats-primary);
  color: white;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: var(--ats-font);
}

.ats-upload-btn-label:hover {
  background: var(--ats-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
}

.ats-supported-formats {
  font-size: 12px;
  color: var(--ats-text-light);
  margin-top: 12px;
}

/* ============================================
   EDITOR SECTION
   ============================================ */
.ats-editor {
  display: none;
  flex-direction: column;
}

.ats-editor.visible {
  display: flex;
}

/* File info bar */
.ats-file-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--ats-surface-2);
  border-bottom: 1px solid var(--ats-border);
  gap: 12px;
  flex-wrap: wrap;
}

.ats-file-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: var(--ats-text);
  font-weight: 500;
}

.ats-file-icon {
  width: 36px;
  height: 36px;
  background: var(--ats-primary-light);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ats-primary);
  flex-shrink: 0;
}

.ats-file-name {
  font-weight: 600;
  color: var(--ats-text);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ats-file-meta {
  font-size: 12px;
  color: var(--ats-text-muted);
}

.ats-reset-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  border: 1.5px solid var(--ats-border);
  border-radius: 50px;
  background: var(--ats-surface);
  color: var(--ats-text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--ats-font);
}

.ats-reset-btn:hover {
  border-color: var(--ats-danger);
  color: var(--ats-danger);
  background: #fef2f2;
}

/* ============================================
   WAVEFORM
   ============================================ */
.ats-waveform-section {
  padding: 16px 20px;
  background: var(--ats-wave-bg);
  border-bottom: 1px solid var(--ats-border);
  position: relative;
}

.ats-waveform-container {
  position: relative;
  border-radius: var(--ats-radius-sm);
  overflow: hidden;
  background: #e0eeff;
  height: 120px;
  cursor: pointer;
  user-select: none;
}

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

.ats-waveform-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--ats-primary-dark);
  pointer-events: none;
  z-index: 3;
  transition: left 0.05s linear;
}

.ats-waveform-playhead::before {
  content: '';
  position: absolute;
  top: 0;
  left: -4px;
  width: 10px;
  height: 10px;
  background: var(--ats-primary-dark);
  border-radius: 50%;
}

/* Trim handles */
.ats-trim-region {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(37,99,235,0.12);
  border-top: 2px solid var(--ats-primary);
  border-bottom: 2px solid var(--ats-primary);
  pointer-events: none;
  z-index: 2;
}

.ats-trim-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 14px;
  background: var(--ats-primary);
  cursor: ew-resize;
  z-index: 4;
  pointer-events: all;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ats-trim-handle::after {
  content: '⋮';
  color: white;
  font-size: 16px;
  line-height: 1;
}

.ats-trim-handle-left {
  left: 0;
  border-radius: 4px 0 0 4px;
}

.ats-trim-handle-right {
  right: 0;
  border-radius: 0 4px 4px 0;
}

/* Waveform timestamps */
.ats-waveform-timestamps {
  display: flex;
  justify-content: space-between;
  padding: 6px 4px 0;
  font-size: 11px;
  color: var(--ats-text-muted);
  font-weight: 500;
}

/* ============================================
   PLAYBACK CONTROLS
   ============================================ */
.ats-playback-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: var(--ats-surface);
  border-bottom: 1px solid var(--ats-border);
  flex-wrap: wrap;
}

.ats-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--ats-primary);
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  font-family: var(--ats-font);
}

.ats-play-btn:hover {
  background: var(--ats-primary-dark);
  transform: scale(1.08);
  box-shadow: 0 4px 12px rgba(37,99,235,0.4);
}

.ats-time-display {
  font-size: 13px;
  color: var(--ats-text-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  min-width: 110px;
}

.ats-progress-bar-container {
  flex: 1;
  height: 6px;
  background: var(--ats-border);
  border-radius: 99px;
  cursor: pointer;
  position: relative;
  min-width: 80px;
}

.ats-progress-bar-fill {
  height: 100%;
  background: var(--ats-primary);
  border-radius: 99px;
  transition: width 0.1s linear;
  pointer-events: none;
}

/* ============================================
   TOOL PANELS
   ============================================ */
.ats-tool-panel {
  display: none;
  padding: 20px;
  flex-direction: column;
  gap: 16px;
  background: var(--ats-surface);
}

.ats-tool-panel.active {
  display: flex;
}

.ats-panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--ats-text);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ats-border);
}

/* Trim panel */
.ats-trim-inputs {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.ats-time-input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ats-time-input-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--ats-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ats-time-input {
  padding: 8px 12px;
  border: 1.5px solid var(--ats-border);
  border-radius: var(--ats-radius-sm);
  font-size: 14px;
  color: var(--ats-text);
  font-weight: 600;
  background: var(--ats-surface);
  font-family: var(--ats-font);
  width: 120px;
  font-variant-numeric: tabular-nums;
  transition: border-color 0.2s;
}

.ats-time-input:focus {
  outline: none;
  border-color: var(--ats-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.ats-trim-separator {
  font-size: 18px;
  color: var(--ats-text-muted);
  font-weight: 300;
  padding-top: 20px;
}

.ats-trim-info {
  font-size: 13px;
  color: var(--ats-text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 20px;
}

/* Sliders */
.ats-slider-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ats-slider-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ats-slider-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--ats-text);
}

.ats-slider-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--ats-primary);
  min-width: 60px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ats-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 99px;
  background: var(--ats-border);
  outline: none;
  cursor: pointer;
  transition: background 0.2s;
}

.ats-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ats-primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37,99,235,0.4);
  transition: transform 0.1s, box-shadow 0.1s;
}

.ats-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 3px 10px rgba(37,99,235,0.5);
}

.ats-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ats-primary);
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 6px rgba(37,99,235,0.4);
}

/* Equalizer */
.ats-eq-grid {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
}

.ats-eq-band {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 40px;
}

.ats-eq-slider-container {
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.ats-eq-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 120px;
  height: 6px;
  border-radius: 99px;
  background: var(--ats-border);
  outline: none;
  cursor: pointer;
  transform: rotate(-90deg);
  transform-origin: center;
}

.ats-eq-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ats-primary);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37,99,235,0.4);
}

.ats-eq-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ats-primary);
  cursor: pointer;
  border: none;
}

.ats-eq-freq {
  font-size: 10px;
  color: var(--ats-text-muted);
  font-weight: 600;
  text-align: center;
}

.ats-eq-val {
  font-size: 11px;
  color: var(--ats-primary);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ats-eq-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.ats-eq-preset-btn {
  padding: 6px 14px;
  border: 1.5px solid var(--ats-border);
  border-radius: 50px;
  background: var(--ats-surface);
  color: var(--ats-text-muted);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--ats-font);
}

.ats-eq-preset-btn:hover,
.ats-eq-preset-btn.active {
  border-color: var(--ats-primary);
  color: var(--ats-primary);
  background: var(--ats-primary-light);
}

/* Fade controls */
.ats-fade-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.ats-fade-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border: 1.5px solid var(--ats-border);
  border-radius: var(--ats-radius);
  background: var(--ats-surface-2);
}

.ats-fade-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ats-text);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Recorder */
.ats-recorder-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 20px;
}

.ats-recorder-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  transition: all 0.2s;
  font-family: var(--ats-font);
}

.ats-recorder-btn.idle {
  background: var(--ats-danger);
  color: white;
  box-shadow: 0 4px 16px rgba(220,38,38,0.4);
}

.ats-recorder-btn.recording {
  background: var(--ats-surface-2);
  color: var(--ats-danger);
  border: 3px solid var(--ats-danger);
  animation: ats-pulse 1.5s infinite;
}

@keyframes ats-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.4); }
  50% { box-shadow: 0 0 0 16px rgba(220,38,38,0); }
}

.ats-recorder-btn.paused {
  background: var(--ats-warning);
  color: white;
}

.ats-recorder-timer {
  font-size: 36px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ats-text);
  letter-spacing: 0.05em;
}

.ats-recorder-status {
  font-size: 14px;
  color: var(--ats-text-muted);
  font-weight: 500;
}

.ats-recorder-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.ats-visualizer-canvas {
  width: 100%;
  height: 80px;
  border-radius: var(--ats-radius-sm);
  background: var(--ats-wave-bg);
  border: 1px solid var(--ats-border);
}

/* Joiner */
.ats-joiner-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  max-height: 320px;
  overflow-y: auto;
}

.ats-joiner-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--ats-surface-2);
  border-radius: var(--ats-radius-sm);
  border: 1.5px solid var(--ats-border);
  transition: all 0.2s;
}

.ats-joiner-item:hover {
  border-color: var(--ats-primary);
  background: var(--ats-primary-light);
}

.ats-joiner-item-drag {
  cursor: grab;
  color: var(--ats-text-light);
  flex-shrink: 0;
}

.ats-joiner-item-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
  color: var(--ats-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ats-joiner-item-duration {
  font-size: 12px;
  color: var(--ats-text-muted);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.ats-joiner-item-remove {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--ats-text-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  font-family: var(--ats-font);
}

.ats-joiner-item-remove:hover {
  background: #fef2f2;
  color: var(--ats-danger);
}

.ats-joiner-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px dashed var(--ats-primary);
  border-radius: var(--ats-radius-sm);
  background: var(--ats-primary-light);
  color: var(--ats-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--ats-font);
  position: relative;
  overflow: hidden;
}

.ats-joiner-add-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.ats-joiner-add-btn:hover {
  background: var(--ats-primary);
  color: white;
}

.ats-gap-control {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ============================================
   EXPORT BAR
   ============================================ */
.ats-export-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  background: var(--ats-surface-2);
  border-top: 2px solid var(--ats-border);
  flex-wrap: wrap;
}

.ats-format-select {
  padding: 10px 36px 10px 14px;
  border: 1.5px solid var(--ats-border);
  border-radius: var(--ats-radius-sm);
  background: var(--ats-surface);
  color: var(--ats-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  font-family: var(--ats-font);
  transition: border-color 0.2s;
  min-width: 120px;
}

.ats-format-select:focus {
  outline: none;
  border-color: var(--ats-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.ats-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  background: linear-gradient(135deg, var(--ats-primary), var(--ats-secondary));
  color: white;
  border: none;
  border-radius: var(--ats-radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--ats-font);
  position: relative;
  overflow: hidden;
}

.ats-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.45);
}

.ats-download-btn:active {
  transform: translateY(0);
}

.ats-download-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.ats-processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(248,250,252,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 20px;
  backdrop-filter: blur(4px);
  display: none;
}

.ats-processing-overlay.visible {
  display: flex;
}

.ats-processing-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ats-text);
}

.ats-processing-subtitle {
  font-size: 14px;
  color: var(--ats-text-muted);
}

.ats-progress-ring {
  width: 80px;
  height: 80px;
}

/* ============================================
   UTILITY BUTTONS
   ============================================ */
.ats-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--ats-radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-family: var(--ats-font);
}

.ats-btn-primary {
  background: var(--ats-primary);
  color: white;
}

.ats-btn-primary:hover {
  background: var(--ats-primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.35);
}

.ats-btn-outline {
  background: transparent;
  color: var(--ats-primary);
  border: 1.5px solid var(--ats-primary);
}

.ats-btn-outline:hover {
  background: var(--ats-primary-light);
}

.ats-btn-ghost {
  background: transparent;
  color: var(--ats-text-muted);
  border: 1.5px solid var(--ats-border);
}

.ats-btn-ghost:hover {
  border-color: var(--ats-primary);
  color: var(--ats-primary);
}

.ats-btn-danger {
  background: #fef2f2;
  color: var(--ats-danger);
  border: 1.5px solid #fecaca;
}

.ats-btn-danger:hover {
  background: var(--ats-danger);
  color: white;
}

/* ============================================
   ALERTS & STATUS
   ============================================ */
.ats-alert {
  padding: 12px 16px;
  border-radius: var(--ats-radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ats-alert-info {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.ats-alert-success {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.ats-alert-warning {
  background: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

/* ============================================
   PITCH DISPLAY
   ============================================ */
.ats-pitch-display {
  text-align: center;
  padding: 20px;
  background: var(--ats-surface-2);
  border-radius: var(--ats-radius);
  border: 1.5px solid var(--ats-border);
}

.ats-pitch-value {
  font-size: 48px;
  font-weight: 800;
  color: var(--ats-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.ats-pitch-unit {
  font-size: 16px;
  color: var(--ats-text-muted);
  font-weight: 500;
  margin-top: 4px;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .ats-tools-nav {
    gap: 4px;
    padding: 10px 12px;
  }

  .ats-tool-btn {
    padding: 7px 10px;
    font-size: 12px;
  }

  .ats-tool-btn .ats-tool-btn-text {
    display: none;
  }

  .ats-upload-zone {
    padding: 32px 20px;
  }

  .ats-upload-title {
    font-size: 18px;
  }

  .ats-eq-grid {
    gap: 4px;
  }

  .ats-fade-grid {
    grid-template-columns: 1fr;
  }

  .ats-trim-inputs {
    flex-direction: column;
    align-items: flex-start;
  }

  .ats-trim-separator {
    display: none;
  }

  .ats-export-bar {
    justify-content: stretch;
  }

  .ats-format-select,
  .ats-download-btn {
    flex: 1;
    justify-content: center;
  }

  .ats-recorder-timer {
    font-size: 28px;
  }

  .ats-pitch-value {
    font-size: 36px;
  }

  .ats-waveform-container {
    height: 90px;
  }
}

@media (max-width: 480px) {
  .ats-wrapper {
    padding: 12px 0;
  }

  .ats-app {
    border-radius: 8px;
  }

  .ats-tool-panel {
    padding: 14px;
  }

  .ats-playback-bar {
    padding: 10px 14px;
  }

  .ats-file-bar {
    padding: 10px 14px;
  }
}

/* Scrollbar */
.ats-joiner-list::-webkit-scrollbar {
  width: 6px;
}

.ats-joiner-list::-webkit-scrollbar-track {
  background: var(--ats-surface-2);
}

.ats-joiner-list::-webkit-scrollbar-thumb {
  background: var(--ats-border);
  border-radius: 99px;
}

/* Divider */
.ats-divider {
  height: 1px;
  background: var(--ats-border);
  margin: 4px 0;
}

/* Gap input */
.ats-gap-input {
  width: 70px;
  padding: 8px 10px;
  border: 1.5px solid var(--ats-border);
  border-radius: var(--ats-radius-sm);
  font-size: 14px;
  color: var(--ats-text);
  font-weight: 600;
  font-family: var(--ats-font);
  text-align: center;
  transition: border-color 0.2s;
}

.ats-gap-input:focus {
  outline: none;
  border-color: var(--ats-primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Tooltip */
.ats-tooltip {
  position: relative;
}

.ats-tooltip::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--ats-text);
  color: white;
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
}

.ats-tooltip:hover::after {
  opacity: 1;
}
