/* ============================================================
   Random Paulstretch Cut-up — Styles
   Dark theme, teal accent (#00d4d4)
   ============================================================ */

:root {
  --bg:          #0d0d0d;
  --bg-card:     #161618;
  --bg-hover:    #1e1e22;
  --fg:          #e8e8e8;
  --fg-dim:      #888;
  --accent:      #00d4d4;
  --accent-glow: rgba(0,212,212,0.25);
  --accent-dark: #009a9a;
  --danger:      #ff4466;
  --radius:      10px;
  --transition:  0.25s ease;
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ---- App Container ---- */
.app-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 32px;
}

/* ---- Header ---- */
.app-header {
  text-align: center;
  margin-bottom: 40px;
}

.header-icon {
  color: var(--accent);
  margin-bottom: 12px;
  animation: pulse 2.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.08); }
}

.app-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--fg);
}

.app-subtitle {
  font-size: 0.9rem;
  color: var(--fg-dim);
  margin-top: 4px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ---- Upload ---- */
.upload-section {
  margin-bottom: 28px;
}

.drop-zone {
  border: 2px dashed rgba(0,212,212,0.35);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition);
  background: var(--bg-card);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--bg-hover);
  box-shadow: 0 0 30px var(--accent-glow);
}

.drop-zone-icon {
  color: var(--accent);
  margin-bottom: 12px;
  opacity: 0.7;
}

.drop-zone-text {
  font-size: 1.05rem;
  color: var(--fg);
  margin-bottom: 4px;
}

.drop-zone-hint {
  font-size: 0.82rem;
  color: var(--fg-dim);
}

/* ---- File Info ---- */
.file-info {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 28px;
}

.info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.info-grid {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.info-item {
  display: flex;
  flex-direction: column;
}

.info-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-dim);
}

.info-value {
  font-size: 0.92rem;
  color: var(--fg);
  font-weight: 500;
}

.btn-clear {
  background: none;
  border: 1px solid rgba(255,68,102,0.4);
  color: var(--danger);
  font-size: 0.78rem;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: background var(--transition);
  flex-shrink: 0;
}

.btn-clear:hover {
  background: rgba(255,68,102,0.12);
}

/* ---- Waveform ---- */
.waveform-container {
  position: relative;
}

.waveform-label {
  position: absolute;
  top: 4px;
  left: 8px;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-dim);
  opacity: 0.6;
  pointer-events: none;
  z-index: 1;
}

.waveform-container canvas {
  width: 100%;
  height: 60px;
  border-radius: 6px;
  background: rgba(0,0,0,0.3);
  display: block;
}

#playhead {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 60px;
  background: #ffffff;
  box-shadow: 0 0 4px rgba(255,255,255,0.8);
  pointer-events: none;
  opacity: 0;
  z-index: 2;
  transition: opacity 0.15s ease;
}

/* ---- Controls ---- */
.controls-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title svg {
  color: var(--accent);
}

.controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 32px;
}

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

.control-group {
  display: flex;
  flex-direction: column;
}

.control-label {
  font-size: 0.82rem;
  color: var(--fg-dim);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.control-value {
  font-weight: 600;
  color: var(--accent);
  font-size: 0.85rem;
}

/* ---- Slider ---- */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #2a2a2e;
  outline: none;
  transition: background var(--transition);
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
  box-shadow: 0 0 6px var(--accent-glow);
  transition: transform var(--transition), box-shadow var(--transition);
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 14px var(--accent-glow);
}

.slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
}

.slider-range {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--fg-dim);
  margin-top: 4px;
  opacity: 0.6;
}

/* ---- Process / Re-roll Buttons ---- */
.process-section {
  text-align: center;
  margin-bottom: 28px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-process {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 40px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--bg);
  background: var(--accent);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
}

.btn-process:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-process:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-process.processing {
  pointer-events: none;
  opacity: 0.6;
}

.btn-reroll {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 2px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.btn-reroll:hover {
  background: rgba(0,212,212,0.1);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-reroll:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* ---- Progress ---- */
.progress-section {
  margin-bottom: 28px;
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: #2a2a2e;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #00ffcc);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.82rem;
  color: var(--fg-dim);
  text-align: center;
}

/* ---- Output ---- */
.output-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
  animation: fadeSlideIn 0.5s ease;
}

@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.output-info {
  font-size: 0.82rem;
  color: var(--fg-dim);
  margin-bottom: 12px;
}

audio {
  width: 100%;
  margin-bottom: 16px;
  border-radius: 6px;
  outline: none;
}

.output-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  background: transparent;
  border: 2px solid var(--accent);
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.btn-download:hover {
  background: var(--accent);
  color: var(--bg);
  box-shadow: 0 0 20px var(--accent-glow);
}

.btn-download:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-mp3 {
  border-color: #00b894;
  color: #00b894;
}

.btn-mp3:hover {
  background: #00b894;
  color: var(--bg);
  box-shadow: 0 0 20px rgba(0,184,148,0.3);
}

/* ---- Footer ---- */
.app-footer {
  text-align: center;
  padding: 24px 0 0;
  font-size: 0.72rem;
  color: var(--fg-dim);
  opacity: 0.5;
}
