/* ============================================================
   Utilities Bunker — Audio Extractor v2.1
   File: /assets/css/modules/videos/audio-extractor.v2.1.css
   Purpose:
   - Tool-only layout and visual styling for Audio Extractor
   - Keeps shared UB toolkit untouched
   - Mobile-first, accessible, fast, production-ready
   ============================================================ */

/* Local tokens */
:root{
  --vs-radius: 16px;
  --vs-gap: 14px;
  --vs-soft: rgba(0,0,0,.06);
  --vs-soft-2: rgba(0,0,0,.08);
  --vs-dash: rgba(249,58,19,.35);
  --vs-accent: #f93a13;
  --vs-accent-2: #ff7426;
  --vs-success: #22c55e;
  --vs-warning: #f59e0b;
}

/* Header row */
.vs-headbar{
  display:flex;
  gap:12px;
  justify-content:space-between;
  align-items:flex-start;
  flex-wrap:wrap;
}

.vs-page-title{
  margin:0;
  font-size:var(--ub-fs-5);
}

.vs-page-subtitle{
  margin:6px 0 0;
  max-width:76ch;
}

/* Simple ordered list */
.vs-howto-list{
  margin:0;
  padding-left:18px;
}

.vs-howto-list li + li{
  margin-top:8px;
}

/* Tool hero layout */
.vs-hero{
  display:grid;
  grid-template-columns:minmax(0, 1.12fr) minmax(320px, .88fr);
  gap:var(--vs-gap);
  align-items:start;
}

@media (max-width: 1040px){
  .vs-hero{
    grid-template-columns:1fr;
  }
}

/* Workspace side */
.vs-workspace{
  display:grid;
  gap:var(--vs-gap);
}

/* Dropzone */
.vs-dropzone-wrap{
  margin:0;
}

.vs-dropzone{
  position:relative;
  min-height:240px;
  border:2px dashed var(--vs-dash);
  border-radius:var(--vs-radius);
  background:
    linear-gradient(180deg, var(--ub-surface-2), var(--ub-card-bg));
  transition:
    border-color .18s ease,
    background .18s ease,
    transform .18s ease,
    box-shadow .18s ease;
  cursor:pointer;
}

.vs-dropzone:hover{
  border-color:rgba(249,58,19,.55);
  box-shadow:0 10px 24px rgba(249,58,19,.08);
}

.vs-dropzone:focus,
.vs-dropzone:focus-visible{
  outline:none;
  box-shadow:0 0 0 4px var(--ub-focus);
  border-color:rgba(249,58,19,.7);
}

.vs-dropzone.is-dragover{
  border-color:rgba(249,58,19,.85);
  background:
    linear-gradient(180deg, rgba(249,58,19,.07), rgba(249,58,19,.03)),
    linear-gradient(180deg, var(--ub-surface-2), var(--ub-card-bg));
  transform:translateY(-1px);
}

.vs-dropzone-inner{
  min-height:240px;
  padding:20px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
}

.vs-drop-icon{
  width:64px;
  height:64px;
  border-radius:18px;
  display:grid;
  place-items:center;
  font-size:28px;
  font-weight:950;
  color:var(--vs-accent);
  background:rgba(249,58,19,.10);
  border:1px solid rgba(249,58,19,.16);
  margin-bottom:12px;
}

.vs-drop-title{
  margin:0;
  font-size:clamp(20px, 1.4rem + .35vw, 28px);
  font-weight:950;
  letter-spacing:-.02em;
}

.vs-drop-copy{
  margin:8px 0 14px;
  color:var(--ub-muted);
  font-size:var(--ub-fs-2);
}

.vs-drop-hint,
.vs-drop-note{
  max-width:62ch;
  margin:10px 0 0;
  color:var(--ub-muted);
  font-size:12px;
  line-height:1.5;
}

/* Panels */
.vs-panel{
  min-width:0;
}

.vs-panel-head{
  display:flex;
  gap:8px;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  margin-bottom:10px;
}

.vs-panel-title{
  margin:0;
  font-size:var(--ub-fs-2);
  font-weight:950;
}

.vs-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:32px;
  padding:6px 12px;
  border-radius:999px;
  border:1px solid var(--ub-border);
  background:var(--ub-surface-2);
  color:var(--ub-muted);
  font-size:12px;
  font-weight:900;
  white-space:nowrap;
}

/* Media frame */
.vs-media-frame{
  position:relative;
  border-radius:14px;
  overflow:hidden;
  background:
    radial-gradient(circle at top left, rgba(249,58,19,.08), transparent 36%),
    linear-gradient(180deg, rgba(0,0,0,.06), rgba(0,0,0,.02));
  border:1px solid var(--ub-border);
  min-height:200px;
}

html.ub-theme-dark .vs-media-frame{
  background:
    radial-gradient(circle at top left, rgba(249,58,19,.12), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
}

.vs-media-frame--single{
  aspect-ratio:16/9;
}

.vs-video{
  display:block;
  width:100%;
  height:100%;
  object-fit:contain;
  background:#000;
}

.vs-audio{
  position:absolute;
  left:14px;
  right:14px;
  bottom:14px;
  width:calc(100% - 28px);
  max-width:none;
  z-index:2;
}

.vs-empty{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:18px;
  color:var(--ub-muted);
  font-size:13px;
}

.vs-preview-actions{
  margin-top:12px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.vs-preview-actions .ub-btn{
  min-width:160px;
}

@media (max-width: 560px){
  .vs-preview-actions .ub-btn{
    width:100%;
  }
}

/* Original/result info cards */
.vs-info-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:var(--vs-gap);
}

@media (max-width: 760px){
  .vs-info-grid{
    grid-template-columns:1fr;
  }
}

/* Stats */
.vs-stats{
  margin:12px 0 0;
  display:grid;
  grid-template-columns:repeat(2, minmax(0,1fr));
  gap:10px 12px;
}

.vs-stats div{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--ub-border);
  background:var(--ub-surface-2);
  min-width:0;
}

.vs-stats dt{
  margin:0 0 4px;
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:var(--ub-muted);
}

.vs-stats dd{
  margin:0;
  font-size:13px;
  font-weight:900;
  font-family:var(--ub-mono);
  overflow-wrap:anywhere;
  word-break:break-word;
}

@media (max-width: 520px){
  .vs-stats{
    grid-template-columns:1fr;
  }
}

/* Divider */
.vs-sep{
  border:none;
  border-top:1px solid var(--ub-border);
  margin:14px 0;
}

/* Option stack */
.vs-option-stack{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.vs-check{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  padding:10px 14px;
}

.vs-check input[type="checkbox"]{
  width:18px;
  height:18px;
  margin:0;
  accent-color:var(--vs-accent);
}

.vs-custom-name{
  margin-top:14px;
}

/* Progress */
.vs-progress-wrap{
  margin-top:14px;
  padding:12px;
  border-radius:14px;
  border:1px solid var(--ub-border);
  background:var(--ub-surface-2);
}

.vs-progress-meta{
  display:flex;
  gap:10px;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  margin-bottom:8px;
  font-size:13px;
}

.vs-progress{
  position:relative;
  height:12px;
  border-radius:999px;
  background:var(--ub-surface-3);
  border:1px solid var(--ub-border);
  overflow:hidden;
}

.vs-progress > span{
  display:block;
  width:0;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg, var(--vs-accent-2), var(--vs-accent));
  transition:width .18s ease;
}

.vs-progress-note{
  margin-top:8px;
  color:var(--ub-muted);
  font-size:12px;
  line-height:1.45;
}

/* Actions */
.vs-actions{
  margin-top:14px;
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.vs-actions .ub-btn{
  min-width:170px;
}

@media (max-width: 560px){
  .vs-actions .ub-btn{
    width:100%;
  }
}

/* Work log */
.vs-worklog{
  font-family:var(--ub-mono);
  font-size:13px;
  line-height:1.6;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
  word-break:break-word;
}

.vs-work-note{
  margin-top:10px;
  color:var(--ub-muted);
  font-size:12px;
}

/* Detail list */
.vs-detail-list{
  margin:0;
  padding-left:18px;
}

.vs-detail-list li + li{
  margin-top:8px;
}

/* FAQ */
.vs-faq-q{
  margin:12px 0 6px;
  font-size:16px;
}

.vs-faq-a{
  margin:0 0 10px;
}

/* Improve related list readability when using spans instead of anchors */
.ub-related-list span{
  display:block;
  padding:10px 12px;
  overflow-wrap:anywhere;
  word-break:break-word;
  line-height:1.4;
  border-radius:10px;
  margin:0 8px 6px;
  background:transparent;
}

/* Utility polish for buttons in rail */
.ub-btn--block{
  width:100%;
}

/* Touch targets / controls */
#ubThemeToggle,
#pickFileBtn,
#processBtn,
#resetBtn,
#downloadBtn,
#btnCopy,
#btnShare,
#showSourceBtn,
#showResultBtn,
#ubRailToggle{
  min-height:44px;
}

/* Better field spacing inside this tool */
.ub-field + .ub-field{
  margin-top:0;
}

/* Audio player refinements */
.vs-audio::-webkit-media-controls-panel{
  border-radius:12px;
}

.vs-audio[hidden]{
  display:none !important;
}

/* Small screen refinements */
@media (max-width: 640px){
  .vs-dropzone-inner{
    min-height:220px;
    padding:16px;
  }

  .vs-drop-icon{
    width:56px;
    height:56px;
    font-size:24px;
  }

  .vs-panel-head{
    align-items:flex-start;
  }

  .vs-badge{
    max-width:100%;
    white-space:normal;
    text-align:center;
  }

  .vs-audio{
    left:10px;
    right:10px;
    bottom:10px;
    width:calc(100% - 20px);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce){
  .vs-dropzone,
  .vs-progress > span{
    transition:none !important;
  }
}