/* ── Clipper · neon theme ─────────────────────────────────────────────── */

:root {
  --bg: #0a0e17;
  --bg-2: #0d1322;
  --cyan: #00f0ff;
  --magenta: #ff2d95;
  --violet: #7b5cff;
  --ink: #e8f4ff;
  --ink-dim: #7d8aa5;
  --card-bg: rgba(255, 255, 255, 0.03);
  --card-border: rgba(0, 240, 255, 0.16);
  --glow-cyan: 0 0 12px rgba(0, 240, 255, 0.45);
  --glow-magenta: 0 0 12px rgba(255, 45, 149, 0.45);
  --font: "SF Mono", "Cascadia Code", ui-monospace, "Segoe UI Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(123, 92, 255, 0.14), transparent 60%),
    radial-gradient(900px 400px at 85% 110%, rgba(255, 45, 149, 0.10), transparent 60%),
    radial-gradient(900px 400px at 10% 100%, rgba(0, 240, 255, 0.08), transparent 60%),
    var(--bg);
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 30%, #000 30%, transparent 100%);
}

/* ── Header ── */

.app-header {
  text-align: center;
  padding: 26px 16px 8px;
  position: relative;
}

.logo {
  width: 44px;
  height: 44px;
  filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.6));
}

.app-header h1 {
  margin: 6px 0 2px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 0.55em;
  text-indent: 0.55em; /* recenters letter-spaced text */
  color: var(--ink);
  text-shadow: 0 0 14px rgba(0, 240, 255, 0.55), 0 0 40px rgba(0, 240, 255, 0.2);
}

.tagline {
  margin: 0;
  font-size: 10px;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: var(--ink-dim);
}

/* ── Layout ── */

main {
  flex: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 14px 14px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25), 0 10px 30px rgba(0, 0, 0, 0.35);
}

.editor {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

[hidden] { display: none !important; }

/* ── Drop zone ── */

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 42px 16px;
  border-style: dashed;
  border-color: rgba(0, 240, 255, 0.35);
  color: var(--cyan);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.1s;
}

.drop-zone:active { transform: scale(0.99); }

.drop-zone.dragover,
.drop-zone:hover,
.drop-zone:focus-visible {
  border-color: var(--cyan);
  box-shadow: var(--glow-cyan), inset 0 0 30px rgba(0, 240, 255, 0.06);
  outline: none;
}

.drop-icon {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.7));
}

.drop-title {
  font-size: 15px;
  letter-spacing: 0.35em;
  text-indent: 0.35em;
  text-shadow: 0 0 10px rgba(0, 240, 255, 0.6);
}

.drop-sub {
  font-size: 11px;
  color: var(--ink-dim);
  letter-spacing: 0.08em;
}

.drop-zone.busy { pointer-events: none; opacity: 0.6; }

/* ── Waveform card ── */

.file-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.file-name {
  font-size: 12px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-duration {
  font-size: 11px;
  color: var(--ink-dim);
  flex-shrink: 0;
}

.wave-wrap {
  position: relative;
  height: 140px;
  border-radius: 10px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 240, 255, 0.1);
}

#waveform {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: ew-resize;
}

.minimap-wrap {
  position: relative;
  height: 30px;
  margin-top: 8px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 240, 255, 0.1);
}

#minimap {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.zoom-hint {
  flex: 1;
  font-size: 9px;
  letter-spacing: 0.15em;
  color: rgba(125, 138, 165, 0.7);
}

.nudge-btn.zoom-all-btn {
  width: auto;
  padding: 0 12px;
  font-size: 10px;
  letter-spacing: 0.15em;
}

/* ── Trim times ── */

.trim-times {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.time-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.time-label {
  font-size: 9px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--ink-dim);
}

.time-value {
  font-size: 12px;
  color: var(--ink);
  min-width: 5.2em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.time-value.accent {
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.nudge {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nudge-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid rgba(0, 240, 255, 0.25);
  background: rgba(0, 240, 255, 0.05);
  color: var(--cyan);
  font-size: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

.nudge-btn:active {
  background: rgba(0, 240, 255, 0.18);
  box-shadow: var(--glow-cyan);
}

/* ── Buttons ── */

.btn {
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.25em;
  text-indent: 0.25em;
  padding: 13px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: box-shadow 0.2s, background 0.2s, transform 0.1s, opacity 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; pointer-events: none; }

.btn-outline {
  background: rgba(0, 240, 255, 0.06);
  border: 1px solid rgba(0, 240, 255, 0.45);
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

.btn-outline:hover { box-shadow: var(--glow-cyan); }

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(125, 138, 165, 0.35);
  color: var(--ink-dim);
}

.btn-primary {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.9), rgba(123, 92, 255, 0.9) 55%, rgba(255, 45, 149, 0.9));
  border: none;
  color: #04070d;
  font-weight: 700;
  width: 100%;
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.35), 0 0 34px rgba(255, 45, 149, 0.2);
}

.btn-primary:hover {
  box-shadow: 0 0 26px rgba(0, 240, 255, 0.55), 0 0 48px rgba(255, 45, 149, 0.35);
}

.btn-play-icon {
  width: 0;
  height: 0;
  border-left: 9px solid currentColor;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  filter: drop-shadow(0 0 4px rgba(0, 240, 255, 0.7));
}

.btn.playing .btn-play-icon {
  border: none;
  width: 10px;
  height: 12px;
  border-left: 4px solid currentColor;
  border-right: 4px solid currentColor;
}

.transport {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.transport .btn-outline { flex: 1; }

/* ── Controls card ── */

.controls-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.control-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  flex-shrink: 0;
  width: 118px;
}

.switch input {
  position: absolute;
  width: 38px;
  height: 22px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  pointer-events: none;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(125, 138, 165, 0.5);
  background: rgba(0, 0, 0, 0.4);
  position: relative;
  transition: border-color 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink-dim);
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.switch input:focus-visible + .switch-track {
  box-shadow: var(--glow-cyan);
}

.switch input:checked + .switch-track {
  border-color: var(--cyan);
  box-shadow: inset 0 0 8px rgba(0, 240, 255, 0.25);
}

.switch input:checked + .switch-track::after {
  transform: translateX(16px);
  background: var(--cyan);
  box-shadow: 0 0 8px rgba(0, 240, 255, 0.8);
}

.switch-label {
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink);
}

.volume-row .switch-label { width: 118px; flex-shrink: 0; }

.slider-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.slider-val {
  font-size: 12px;
  color: var(--cyan);
  min-width: 4em;
  text-align: right;
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
  flex-shrink: 0;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  min-width: 0;
  height: 26px;
  background: transparent;
  cursor: pointer;
}

input[type="range"]:disabled { opacity: 0.35; cursor: default; }

input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.5), rgba(255, 45, 149, 0.5));
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
  margin-top: -7px;
}

input[type="range"]::-moz-range-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(0, 240, 255, 0.5), rgba(255, 45, 149, 0.5));
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid var(--cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.8);
}

/* ── Export card ── */

.export-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.format-picker {
  display: flex;
  gap: 0;
  border: 1px solid rgba(0, 240, 255, 0.3);
  border-radius: 12px;
  overflow: hidden;
  align-self: center;
}

.format-btn {
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.25em;
  text-indent: 0.25em;
  padding: 10px 26px;
  background: transparent;
  border: none;
  color: var(--ink-dim);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, text-shadow 0.2s;
}

.format-btn.active {
  background: rgba(0, 240, 255, 0.12);
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
}

.export-status {
  margin: 0;
  min-height: 1.2em;
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
}

.export-status.ok { color: var(--cyan); text-shadow: 0 0 8px rgba(0, 240, 255, 0.5); }
.export-status.err { color: var(--magenta); text-shadow: 0 0 8px rgba(255, 45, 149, 0.5); }

/* ── Footer ── */

.app-footer {
  text-align: center;
  padding: 10px 16px 18px;
  font-size: 10px;
  letter-spacing: 0.15em;
  color: rgba(125, 138, 165, 0.6);
}

@media (min-width: 480px) {
  .wave-wrap { height: 170px; }
}
