/* Arcana Studio — Templates Registry Cards, Voiceover Panel, Watermark & Word-Highlight Captions */

/* ── Templates Drawer UI ─────────────────────────────────────────────────── */
.st-tpl-save-card {
  gap: 6px;
  background: rgba(255, 255, 255, 0.025);
}

.st-tpl-active-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.14), rgba(0, 212, 255, 0.1));
  border: 1px solid rgba(0, 212, 255, 0.3);
}

.st-tpl-vo-jump {
  flex-shrink: 0;
  padding: 5px 9px;
  border-radius: 7px;
  border: 1px solid rgba(0, 212, 255, 0.4);
  background: rgba(0, 212, 255, 0.14);
  color: #e0f2fe;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--st-dur-fast) var(--st-ease-out), transform var(--st-dur-fast) var(--st-ease-out);
}
.st-tpl-vo-jump:hover { background: rgba(0, 212, 255, 0.25); }
.st-tpl-vo-jump:active { transform: scale(0.97); }

.st-tpl-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.st-tpl-pill {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid var(--st-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--st-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--st-dur-fast) var(--st-ease-out), color var(--st-dur-fast) var(--st-ease-out), border-color var(--st-dur-fast) var(--st-ease-out);
}
.st-tpl-pill:hover { color: var(--st-text); border-color: var(--st-border-strong); }
.st-tpl-pill.active {
  background: var(--st-accent-soft);
  border-color: rgba(124, 92, 255, 0.55);
  color: #fff;
}

.st-tpl-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.st-tpl-card {
  background: var(--st-card);
  border: 1px solid var(--st-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--st-dur-med) var(--st-ease-out), border-color var(--st-dur-fast) var(--st-ease-out), box-shadow var(--st-dur-med) var(--st-ease-out);
}
.st-tpl-card:hover {
  border-color: var(--st-border-strong);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}
.st-tpl-card.active {
  border-color: var(--st-accent-2);
  box-shadow: 0 0 0 1px rgba(0, 212, 255, 0.55), 0 8px 24px rgba(0, 0, 0, 0.4);
}

.st-tpl-preview {
  position: relative;
  width: 100%;
  height: 92px;
  background: radial-gradient(circle at 30% 20%, #1b2030 0%, #0b0d14 85%);
  border: none;
  border-bottom: 1px solid var(--st-border);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  cursor: pointer;
}
.st-tpl-preview.is-animated {
  background: radial-gradient(circle at 25% 20%, rgba(124, 92, 255, 0.24) 0%, rgba(0, 212, 255, 0.1) 48%, #0b0d14 90%);
}
.st-tpl-thumb-vid {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.st-tpl-play-pill {
  position: absolute;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(9, 10, 13, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.32);
  color: #fff;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 2px;
  backdrop-filter: blur(4px);
  transition: transform var(--st-dur-fast) var(--st-ease-out), background var(--st-dur-fast) var(--st-ease-out);
}
.st-tpl-card:hover .st-tpl-play-pill {
  transform: scale(1.08);
  background: var(--st-accent);
  border-color: rgba(255, 255, 255, 0.55);
}
.st-tpl-watch-hint {
  position: absolute;
  bottom: 5px;
  right: 7px;
  font-size: 9.5px;
  font-weight: 700;
  color: #e2e8f0;
  background: rgba(9, 10, 13, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 2px 6px;
  border-radius: 999px;
  opacity: 0.82;
  transition: opacity var(--st-dur-fast) var(--st-ease-out), border-color var(--st-dur-fast) var(--st-ease-out);
}
.st-tpl-card:hover .st-tpl-watch-hint {
  opacity: 1;
  border-color: var(--st-accent-2);
  color: #fff;
}

.st-tpl-frame {
  position: relative;
  border-radius: 6px;
  background: linear-gradient(150deg, #12151f, #090b10);
  border: 1px solid rgba(255, 255, 255, 0.14);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.st-tpl-frame.r-16-9 { width: 132px; height: 74px; }
.st-tpl-frame.r-9-16 { width: 44px; height: 76px; }
.st-tpl-frame.r-1-1 { width: 72px; height: 72px; }

/* ── Template Sample Video Preview Modal ─────────────────────────────────── */
.st-tpl-modal {
  max-width: 720px;
  gap: 12px;
}
.st-tpl-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.st-tpl-stage-box {
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #050608;
  border: 1px solid var(--st-border-strong);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.st-tpl-stage-box.r-16-9 {
  width: 100%;
  max-width: 640px;
  aspect-ratio: 16 / 9;
}
.st-tpl-stage-box.r-9-16 {
  height: min(58vh, 480px);
  aspect-ratio: 9 / 16;
}
.st-tpl-stage-box.r-1-1 {
  height: min(54vh, 420px);
  aspect-ratio: 1 / 1;
}
.st-tpl-sample-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000;
}
.st-tpl-custom-stage {
  background: radial-gradient(circle at 30% 20%, rgba(124, 92, 255, 0.28), #0b0e14 80%);
  flex-direction: column;
  gap: 12px;
  padding: 20px;
  text-align: center;
}
.st-tpl-custom-hook {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  padding: 6px 14px;
  border-radius: 8px;
}
.st-tpl-custom-cap {
  font-size: 13px;
  font-weight: 600;
}
.st-tpl-custom-wm {
  position: absolute;
  bottom: 10px;
  right: 12px;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.5;
  letter-spacing: 0.7px;
}
.st-tpl-spec-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.st-tpl-modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}
.st-tpl-watch-btn {
  flex-shrink: 0;
  white-space: nowrap;
}

.st-tpl-topic-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.12), rgba(0, 212, 255, 0.08));
  border: 1px solid rgba(0, 212, 255, 0.28);
}

.st-bk-card {
  border-color: rgba(250, 204, 21, 0.25);
  background: linear-gradient(180deg, rgba(28, 31, 41, 0.98), rgba(22, 25, 34, 0.98));
  gap: 6px;
}

/* ── Live Canvas Caption Presets ─────────────────────────────────────────── */
.st-cap-hormozi {
  text-transform: uppercase;
  font-weight: 800;
  letter-spacing: 0.4px;
  -webkit-text-stroke: 1.5px rgba(0, 0, 0, 0.95);
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.95);
}
.st-cap-editorial {
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-weight: 700;
}
.st-cap-minimal {
  font-weight: 600;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}

.st-tpl-motion-chip {
  position: absolute;
  top: 3px;
  left: 4px;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.72);
  color: #cbd5e1;
}

.st-tpl-wm-dot {
  position: absolute;
  bottom: 3px;
  right: 4px;
  font-size: 7px;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.7);
}

.st-tpl-cap-line {
  position: absolute;
  left: 4px;
  right: 4px;
  text-align: center;
  font-size: 7.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}
.st-tpl-cap-line.pos-top { top: 15px; }
.st-tpl-cap-line.pos-center { top: 50%; transform: translateY(-50%); }
.st-tpl-cap-line.pos-bottom { bottom: 11px; }

.st-tpl-body {
  padding: 9px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.st-tpl-title-row,
.st-tpl-rename-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.st-tpl-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--st-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.st-tpl-custom-ops {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.st-tpl-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.st-tpl-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
  font-variant-numeric: tabular-nums;
}
.st-tpl-badge.ratio { background: rgba(0, 212, 255, 0.13); color: #67e8f9; }
.st-tpl-badge.dur { background: rgba(255, 255, 255, 0.08); color: #f1f5f9; }
.st-tpl-badge.anim { background: rgba(124, 92, 255, 0.22); color: #ddd6fe; }
.st-tpl-badge.vo { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }
.st-tpl-badge.custom { background: rgba(250, 204, 21, 0.15); color: #fde047; }
.st-tpl-badge.muted { opacity: 0.65; }

.st-tpl-desc {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
  color: var(--st-muted);
}

.st-tpl-actions {
  display: flex;
  gap: 6px;
  margin-top: 2px;
}
.st-tpl-apply-btn {
  padding: 7px 10px;
  font-size: 11.5px;
  transition: filter var(--st-dur-fast) var(--st-ease-out), transform var(--st-dur-fast) var(--st-ease-out);
}
.st-tpl-apply-btn:active { transform: scale(0.98); }

/* ── Voiceover Section (Audio Panel) ─────────────────────────────────────── */
.st-vo-card {
  border-color: rgba(124, 92, 255, 0.28);
  background: linear-gradient(180deg, rgba(28, 31, 41, 0.98), rgba(22, 25, 34, 0.98));
}
.st-vo-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.st-vo-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--st-text);
}
.st-vo-pill {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--st-cyan-soft);
  color: var(--st-accent-2);
  border: 1px solid rgba(0, 212, 255, 0.28);
}
.st-vo-count {
  font-size: 10.5px;
  color: var(--st-dim);
  font-variant-numeric: tabular-nums;
}
.st-vo-textarea {
  resize: vertical;
  min-height: 76px;
  line-height: 1.45;
  font-family: inherit;
}
.st-vo-status {
  font-size: 11.5px;
  line-height: 1.4;
  padding: 7px 9px;
  border-radius: 8px;
  border: 1px solid var(--st-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--st-muted);
  transition: opacity var(--st-dur-med) var(--st-ease-out);
}
.st-vo-status.ok {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.1);
  color: #a7f3d0;
}
.st-vo-status.error {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
}

/* ── Live Stage Static Corner Watermark & Word-Highlight Captions ────────── */
.st-watermark {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  padding: 3px 7px;
  border-radius: 4px;
  user-select: none;
  transition: opacity var(--st-dur-med) var(--st-ease-out);
}
.st-watermark.top-left { top: 10px; left: 12px; }
.st-watermark.top-right { top: 10px; right: 12px; }
.st-watermark.bottom-left { bottom: 10px; left: 12px; }
.st-watermark.bottom-right { bottom: 10px; right: 12px; }

.st-overlay-word {
  display: inline-block;
  margin: 0 2px;
  transition: color 90ms var(--st-ease-out), transform 90ms var(--st-ease-out);
}
.st-overlay-word.active {
  color: #facc15;
  transform: scale(1.06);
  text-shadow: 0 2px 10px rgba(250, 204, 21, 0.55), 0 2px 6px rgba(0, 0, 0, 0.9);
}

@media (prefers-reduced-motion: reduce) {
  .st-tpl-card,
  .st-tpl-pill,
  .st-tpl-apply-btn,
  .st-tpl-vo-jump,
  .st-vo-status,
  .st-watermark,
  .st-overlay-word {
    transition-duration: 0.01ms !important;
  }
}
