/* ══════════════════════════════════════════════════════════════════════════════
   VIDEO GENERATOR — layers on top of generator.css for consistency.
   ══════════════════════════════════════════════════════════════════════════════ */

.gen-video-container {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0 16px 40px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* ── Mode Tabs ─────────────────────────────────────────────────────────────── */
.vg-mode-tabs {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.vg-mode-tabs::-webkit-scrollbar { display: none; }

.vg-mode-tab {
  flex: 1;
  min-width: max-content;
  padding: 9px 12px;
  border: none;
  background: none;
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  font-weight: 600;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}

.vg-mode-tab.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.25), rgba(236, 72, 153, 0.2));
  color: #fff;
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.4) inset;
}

.vg-mode-tab:active {
  transform: scale(0.97);
}

/* ── Reference images grid ─────────────────────────────────────────────────── */
.vg-references-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  margin-top: 8px;
  min-height: 10px;
}

.vg-reference-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid rgba(168, 85, 247, 0.3);
  background: rgba(255, 255, 255, 0.04);
}

.vg-reference-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.vg-reference-tile__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.vg-reference-tile__remove:hover {
  background: rgba(239, 68, 68, 0.85);
}

.vg-add-reference-btn {
  margin-top: 10px;
  width: 100%;
  padding: 11px 0;
  border: 1.5px dashed rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.05);
  color: #d8b4fe;
  font-size: 13px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.2s ease;
}

.vg-add-reference-btn:hover {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.6);
}

.vg-add-reference-btn:active {
  transform: scale(0.98);
}

.vg-ref-count {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
}

/* ── Status block (while generating) ───────────────────────────────────────── */
.vg-status {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 22px 16px;
  border-radius: 14px;
  background: rgba(168, 85, 247, 0.06);
  border: 1px solid rgba(168, 85, 247, 0.15);
  margin-top: 8px;
  animation: gen-fadeIn 0.25s ease;
}

.vg-status__spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #a855f7;
  border-radius: 50%;
  animation: gen-spin 0.8s linear infinite;
}

.vg-status__text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 13px;
  text-align: center;
  line-height: 1.4;
  max-width: 320px;
}

/* ── Result player ─────────────────────────────────────────────────────────── */
.vg-result {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
  animation: gen-fadeIn 0.35s ease;
}

.vg-result__player-wrap {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.18);
}

.vg-result__video {
  width: 100%;
  display: block;
  max-height: 70vh;
  background: #000;
}

/* ── Audio hint ────────────────────────────────────────────────────────────── */
.vg-audio-hint {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
  line-height: 1.4;
  margin-top: 6px;
  padding: 0 2px;
}

/* ── Responsive tweaks ─────────────────────────────────────────────────────── */
@media (max-width: 380px) {
  .vg-mode-tab { padding: 8px 10px; font-size: 12px; }
  .vg-references-grid { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 6px; }
  .vg-add-reference-btn { font-size: 12px; padding: 10px 0; }
  .vg-status__text { font-size: 12px; }
}

@media (min-width: 768px) {
  .gen-video-container { max-width: 560px; padding: 0 24px 48px; }
  .vg-references-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
}
