/* ============================================================
   Add Reverb to Audio - Pi7
   Scoped under .ar-stage
   ============================================================ */

.ar-stage{
  margin: 14px auto 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ar-stage input[type="file"]{ display: none; }

/* Upload box uses shared .upload_cnt / .imagelabel from common.css */

/* -------------------- Section title -------------------- */
.section-title{
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin: 0 0 6px;
}

/* -------------------- Audio card -------------------- */
.audio-card{
  background: #fff;
  border: 1px solid #eef0fa;
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.audio-card.hide{ display: none; }
.audio-head{
  display: flex;
  align-items: center;
  gap: 10px;
}
.file-name{
  font-weight: 600;
  font-size: 14px;
  color: #262626;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}
.file-sub{
  font-size: 12px;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  flex-shrink: 0;
}
.remove-btn{
  background: #fff;
  border: 1px solid #e5e7f0;
  color: #b00d44;
  width: 28px;
  height: 28px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.remove-btn:hover{ background: #fff5f7; border-color: #f5c5d3; }

/* -------------------- Waveform -------------------- */
.waveform-wrap{
  background: #f8f9ff;
  border-radius: 6px;
  padding: 8px;
  min-height: 100px;
  position: relative;
}
.waveform-loading{
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 13px;
}
#waveform{
  cursor: pointer;
  position: relative;
}
#waveform::after{
  content: "Click anywhere to seek";
  position: absolute;
  right: 4px;
  bottom: 2px;
  font-size: 10px;
  color: var(--muted);
  opacity: 0.6;
  pointer-events: none;
  font-weight: 500;
}

/* -------------------- Audio controls (Play + A/B toggle) -------------------- */
.audio-controls{
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  flex-wrap: wrap;
}
.audio-controls .play-btn{
  background: var(--pcolor);
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  min-width: 80px;
}
.audio-controls .play-btn:hover{ background: #373c8f; }
.audio-controls .play-btn.playing{ background: #d31b5a; }
.audio-controls .play-btn.playing:hover{ background: #b00d44; }
.audio-controls .preview-hint{
  color: var(--muted);
  font-size: 12px;
  flex: 1 1 auto;
}
/* A/B toggle - our differentiator. Two-tone pill: A=orig, B=wet. */
.ab-toggle{
  background: #fff;
  border: 1.5px solid #e5e7f0;
  border-radius: 4px;
  padding: 0;
  display: inline-flex;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
  height: 32px;
}
.ab-toggle:disabled{
  opacity: 0.5;
  cursor: not-allowed;
}
.ab-toggle .ab-side{
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  color: var(--muted);
  transition: background 0.12s, color 0.12s;
}
.ab-toggle[data-side="B"] .ab-side.wet,
.ab-toggle[data-side="A"] .ab-side.dry{
  background: var(--pcolor);
  color: #fff;
}
.ab-toggle:hover:not(:disabled){
  border-color: var(--pcolor);
}

/* -------------------- Dry-compare mode warning -------------------- */
.dry-mode-warning{
  padding: 8px 12px;
  background: #fff7e6;
  border: 1px solid #ffd591;
  border-left: 4px solid #fa8c16;
  border-radius: 4px;
  font-size: 12px;
  color: #d46b08;
  line-height: 1.4;
  margin-top: 6px;
}
.dry-mode-warning.hide{ display: none; }
.dry-mode-warning b{ color: #ad4e00; }

/* -------------------- Preset section + chips (6 chips, 3-col desktop) -------------------- */
.preset-section{
  background: #fff;
  border: 1px solid #eef0fa;
  border-radius: 8px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.preset-section.hide{ display: none; }
.preset-chips{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.preset-chip{
  background: #fff;
  border: 1.5px solid #e5e7f0;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
  min-height: 60px;
}
.preset-chip:hover{
  border-color: var(--pcolor);
  background: #f8f9ff;
}
.preset-chip.selected{
  border-color: var(--pcolor);
  background: #eef0fa;
  box-shadow: 0 0 0 1px var(--pcolor) inset;
}
.preset-chip .preset-name{
  font-weight: 700;
  font-size: 13px;
  color: var(--pcolor);
}
.preset-chip .preset-desc{
  font-size: 11px;
  color: var(--muted);
  line-height: 1.3;
}
.preset-hint{
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}

/* -------------------- Slider rows -------------------- */
.ar-row{
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ar-label{
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
  font-weight: 600;
  color: #262626;
}
.ar-value{
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 13px;
  color: var(--pcolor);
  font-weight: 700;
}
.ar-row input[type="range"]{
  width: 100%;
  accent-color: var(--pcolor);
  margin: 0;
}
.ar-help{
  font-size: 11px;
  color: var(--muted);
}

/* -------------------- Advanced disclosure -------------------- */
.ar-advanced{
  background: #f8f9ff;
  border: 1px solid #eef0fa;
  border-radius: 6px;
  padding: 0;
  overflow: hidden;
}
.ar-advanced summary{
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--pcolor);
  list-style: none;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ar-advanced summary::-webkit-details-marker{ display: none; }
.ar-advanced summary::before{
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  font-size: 14px;
  font-weight: 700;
  color: var(--pcolor);
  transition: transform 0.15s;
}
.ar-advanced[open] summary::before{
  content: "-";
}
.ar-advanced summary:hover{ background: #eef0fa; }
.ar-advanced .ar-advanced-body{
  padding: 4px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-top: 1px solid #eef0fa;
}
.ar-format-row{
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.ar-format-row label{
  font-weight: 600;
  color: #262626;
}
.ar-format-row select{
  padding: 6px 10px;
  border: 1px solid #e5e7f0;
  border-radius: 4px;
  background: #fff;
  color: #262626;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.ar-format-row input[type="checkbox"]{
  width: 16px;
  height: 16px;
  accent-color: var(--pcolor);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}
.ar-format-row input[type="checkbox"] + label{
  font-weight: 500;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
}

/* -------------------- Process button -------------------- */
.process-btn{
  background: linear-gradient(135deg, #4449a6, #373c8f);
  color: #fff;
  border: none;
  padding: 14px 26px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: block;
  width: 100%;
  box-shadow: 0 6px 18px rgba(68, 73, 166, 0.30);
  transition: transform 0.15s, box-shadow 0.15s;
}
.process-btn:hover:not(:disabled){
  transform: translateY(-1px);
  box-shadow: 0 10px 26px rgba(68, 73, 166, 0.42);
}
.process-btn:disabled{
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* -------------------- Processing + spinner -------------------- */
.processing{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eef0fa;
  color: var(--pcolor);
  font-size: 14px;
}
.processing.hide{ display: none; }
.proc-spin{
  width: 22px;
  height: 22px;
  border: 3px solid var(--pcolor);
  border-top-color: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: ar-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes ar-spin{ to { transform: rotate(360deg); } }
.cancel-btn{
  margin-left: auto;
  background: #fff;
  border: 1px solid #f5c5d3;
  color: #b00d44;
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.cancel-btn:hover{ background: #fff5f7; border-color: #b00d44; }
.cancel-btn:disabled{ opacity: 0.4; cursor: not-allowed; }

/* -------------------- Result card -------------------- */
.result-card{
  background: #fff;
  border: 1px solid #eef0fa;
  border-radius: 8px;
  padding: 14px;
  position: relative;
  overflow: hidden;
}
.result-card.hide{ display: none; }
.result-card::before{
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4449a6, #d31b5a);
}
.result-card audio{
  width: 100%;
  margin-bottom: 10px;
}
.result-meta{
  font-size: 12px;
  color: var(--muted);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  margin-bottom: 12px;
}
.result-actions{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.result-actions a,
.result-actions button{
  flex: 1 1 130px;
  padding: 10px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.result-actions .download-btn{ background: var(--pcolor); color: #fff; }
.result-actions .download-btn:hover{ background: #373c8f; }
.result-actions .ctrl-btn{
  background: #fff;
  color: var(--pcolor);
  border: 1px solid #e5e7f0;
}
.result-actions .ctrl-btn:hover{ border-color: var(--pcolor); }

/* -------------------- Attribution line -------------------- */
.ar-attribution{
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin: 0;
}

/* -------------------- Article section (tables + illus) -------------------- */
.articlesec table{
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(68, 73, 166, 0.06);
}
.articlesec thead{ background: var(--pcolor); color: #fff; }
.articlesec th{
  text-align: left;
  padding: 12px 14px;
  font-weight: 600;
  font-size: 13px;
}
.articlesec td{
  padding: 11px 14px;
  border-top: 1px solid #eef0fa;
  color: #262626;
  vertical-align: top;
}
.articlesec tbody tr:nth-child(even){ background: #f8f9ff; }
.illus{
  margin: 24px 0 36px;
  display: flex;
  justify-content: center;
}
.illus img{
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 14px 40px rgba(68, 73, 166, 0.14);
}

/* -------------------- Responsive -------------------- */
@media screen and (max-width: 600px){
  .preset-chips{ grid-template-columns: repeat(2, 1fr); }
  .audio-head{ flex-wrap: wrap; }
  .file-name{ flex: 1 1 100%; }
  .file-sub{ order: 2; }
  .result-actions a,
  .result-actions button{ flex: 1 1 100%; }
  .articlesec table{ font-size: 13px; }
  .articlesec th,
  .articlesec td{ padding: 9px 10px; }
  .audio-controls{ gap: 8px; }
  .audio-controls .preview-hint{ order: 3; flex: 1 1 100%; }
}
