/* ═══════════════════════════════════════════════════════════
   FILECOMPRESS.APP — VIDEO TOOLS STYLESHEET
   Extends styles.css (must be linked AFTER it in HTML).
   All tokens (--bg, --accent, etc.) come from styles.css.
   This file adds only video-specific components.
═══════════════════════════════════════════════════════════ */


/* ─── WASM WARNING BANNER ───────────────────────────────── */
.vt-wasm-warning {
  max-width: 900px;
  margin: 1rem auto 0;
  padding: 0.75rem 1.25rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  color: #f87171;
  font-size: 0.85rem;
  text-align: center;
}


/* ─── VIDEO DROPZONE OVERRIDES ──────────────────────────── */
/* Slightly taller dropzone for video context */
.vt-dropzone {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.vt-dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}


/* ─── VIDEO PREVIEW PANEL ───────────────────────────────── */
.vt-preview-panel {
  display: none;
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  flex-direction: column;
  gap: 0;
}
.vt-preview-panel.visible {
  display: flex;
}

/* The <video> player */
.vt-video-player {
  width: 100%;
  max-height: 320px;
  background: #000;
  display: block;
  border-radius: 0; /* inherits panel radius via overflow:hidden */
  outline: none;
}

/* Info row below the player */
.vt-preview-info {
  padding: 0.85rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}

.vt-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}


/* ─── PROGRESS BAR (enhanced with pct label) ─────────────── */
.vt-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.vt-progress-pct {
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--accent);
}

/* Override parent progress-bar-fill for animated shimmer */
.progress-bar-fill {
  position: relative;
  overflow: hidden;
}
.progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: -60%;
  width: 60%; height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255,255,255,0.25),
    transparent
  );
  animation: vt-shimmer 1.4s infinite;
}
@keyframes vt-shimmer {
  to { left: 120%; }
}


/* ─── SLIDER ROW (compressor CRF slider) ────────────────── */
.slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Range input — shared style already in styles.css but ensure it exists */
input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  border-radius: 99px;
  background: var(--border);
  cursor: pointer;
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--bg);
  transition: transform 0.15s;
}
input[type=range]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  cursor: pointer;
}

.vt-slider-hint {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}


/* ─── INFO CARD (used in compressor) ────────────────────── */
.vt-info-card {
  margin-top: 1.5rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: 0.83rem;
  color: var(--muted);
  line-height: 1.6;
}
.vt-info-card strong {
  display: block;
  color: var(--text);
  font-size: 0.85rem;
  margin-bottom: 2px;
}
.vt-info-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  line-height: 1;
}


/* ─── GIF TOOL SPECIFIC ──────────────────────────────────── */
.vt-badge-new {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.5rem;
  font-size: 0.72rem;
  font-family: 'DM Mono', monospace;
  background: var(--accent-dim);
  border: 1px solid var(--accent-glow);
  color: var(--accent);
  padding: 3px 10px;
  border-radius: 99px;
  letter-spacing: 0.04em;
}

.vt-gif-tip {
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 1rem;
  line-height: 1.6;
}

/* GIF output preview */
.vt-gif-output {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.vt-gif-label {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.vt-gif-preview-img {
  display: block;
  width: 100%;
  max-height: 400px;
  object-fit: contain;
  background: repeating-conic-gradient(#1a1a1e 0% 25%, #111114 0% 50%)
              0 0 / 20px 20px; /* checkerboard transparency bg */
}


/* ─── BUTTON ICON SPACING ────────────────────────────────── */
.btn-icon {
  font-size: 1rem;
  line-height: 1;
}


/* ─── LOADING STATE (button during processing) ──────────── */
.btn.btn-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
.btn.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: vt-spin 0.7s linear infinite;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
@keyframes vt-spin {
  to { transform: translate(-50%, -50%) rotate(360deg); }
}


/* ─── TOOL PANEL FADE-IN (ensure it works on this page) ─── */
.tool-panel {
  display: none;
  animation: fadeIn 0.35s ease;
}
.tool-panel.active {
  display: block;
}

/* (fadeIn keyframes defined in styles.css — no redeclaration needed) */


/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 768px) {

  .vt-video-player {
    max-height: 220px;
  }

  .vt-slider-hint {
    display: none; /* save space on mobile */
  }

  .vt-info-card {
    flex-direction: column;
    gap: 0.5rem;
  }

  .vt-gif-tip {
    font-size: 0.8rem;
  }

}

@media (max-width: 480px) {

  .vt-video-player {
    max-height: 180px;
  }

  .vt-badge-new {
    font-size: 0.68rem;
  }

}
