.modal-busy { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; background: rgba(11,16,32,0.6); backdrop-filter: blur(2px); border-radius: 16px; z-index: 10; pointer-events: all; }
.modal-busy[hidden] { display: none !important; }
.spinner { width: 28px; height: 28px; border: 3px solid rgba(255,255,255,0.25); border-top-color: #fff; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.progress { width: min(520px, 80%); height: 6px; border-radius: 999px; background: rgba(255,255,255,0.15); overflow: hidden; }
.progress .bar { width: 0%; height: 100%; background: linear-gradient(90deg, #7c5cff, #3abfff); transition: width 120ms linear; }
:root {
  --bg: #0b1020;
  --bg-elev: #121832;
  --card: rgba(255, 255, 255, 0.06);
  --card-border: rgba(255, 255, 255, 0.08);
  --text: #e8ecf1;
  --muted: #a0a8c0;
  --primary: #7c5cff;
  --primary-600: #6a49ff;
  --success: #23d18b;
  --warning: #ffca3a;
  --danger: #ff5d5d;
  --info: #3abfff;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);
}

/* Ensure elements with the hidden attribute are not displayed */
[hidden] { display: none !important; }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 800px at 15% 10%, #1a1f3d 0%, rgba(26,31,61,0) 60%),
              radial-gradient(900px 600px at 85% 20%, #0f2a4b 0%, rgba(15,42,75,0) 60%),
              linear-gradient(160deg, #0b1020 0%, #0b1020 100%);
  background-attachment: fixed;
}

.app {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  backdrop-filter: blur(10px);
  background: linear-gradient(180deg, rgba(5,8,20,0.85) 0%, rgba(5,8,20,0.35) 100%);
  border-bottom: 1px solid var(--card-border);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { width: 28px; height: 28px; border-radius: 6px; object-fit: cover; }
.brand-name { font-weight: 800; letter-spacing: 0.2px; font-size: 18px; }

.stack {
  width: 100%;
  max-width: 900px;
  margin: 24px auto;
  padding: 0 20px 40px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: floatIn 600ms ease both;
}

@keyframes floatIn {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.preview-card { padding: 16px; }
.preview-card.centered { text-align: center; }
.video-wrap {
  position: relative;
  aspect-ratio: 16/10;
  border-radius: 12px;
  overflow: hidden;
  background: #0a0f1f;
  border: 1px solid var(--card-border);
}
video#preview { width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-wrap.trimming { display: none; }
.video-wrap.trimming + .trim-inline { margin-top: 0; }

/* removed in favor of on-canvas watermark only */

.video-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px;
  padding-bottom: 48px;
  color: var(--muted);
}
.video-placeholder i { width: 48px; height: 48px; color: var(--muted); opacity: 0.9; }
.video-placeholder p { margin: 0; opacity: 0.95; text-align: center; }
.video-placeholder p.sub { font-size: 12px; opacity: 0.75; }
/* arrow CTA removed, keep text-only */

.rec-indicator {
  position: absolute; top: 12px; left: 12px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 10px; border-radius: 999px;
  background: rgba(255, 0, 0, 0.12);
  color: #ffb3b3;
  border: 1px solid rgba(255, 93, 93, 0.35);
  box-shadow: 0 2px 8px rgba(255, 93, 93, 0.15);
  opacity: 0; transform: translateY(-8px);
  pointer-events: none;
}
.rec-indicator.active { opacity: 1; transform: translateY(0); transition: all 300ms ease; }
.rec-indicator .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 0 rgba(255, 93, 93, 0.6);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 93, 93, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(255, 93, 93, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 93, 93, 0); }
}

.hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

/* settings panel removed */

.field { display: grid; gap: 6px; margin-bottom: 8px; }
.field label { font-size: 12px; color: var(--muted); }

.select-wrap { display: flex; align-items: center; gap: 8px; }
select {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.04); color: var(--text);
  outline: none; box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.icon-btn { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--card-border); background: rgba(255,255,255,0.04); color: var(--text); display: grid; place-items: center; }
.icon-btn i { width: 18px; height: 18px; color: var(--muted); }

.field.slider { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; }
input[type="range"] { accent-color: var(--primary); width: 100%; }

.level-row { display: flex; gap: 10px; align-items: center; }
.level-meter {
  flex: 1; height: 12px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--card-border);
  overflow: hidden; position: relative;
}
.level-fill { position: absolute; inset: 0 100% 0 0; background: linear-gradient(90deg, #1ee9ac, #ffcf4d, #ff6b6b); transition: inset 80ms linear; }

.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--card-border);
  background: rgba(255,255,255,0.04); color: var(--text); font-weight: 600; letter-spacing: 0.2px; cursor: pointer;
  transform: translateZ(0);
  transition: transform 120ms ease, background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}
.btn i { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-1px); background: rgba(255,255,255,0.06); box-shadow: 0 6px 16px rgba(0,0,0,0.25); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; box-shadow: none; }

.btn.primary { border-color: rgba(124,92,255,0.35); background: linear-gradient(180deg, rgba(124,92,255,0.25), rgba(124,92,255,0.12)); }
.btn.success { border-color: rgba(35,209,139,0.35); background: linear-gradient(180deg, rgba(35,209,139,0.22), rgba(35,209,139,0.10)); }
.btn.warning { border-color: rgba(255,202,58,0.35); background: linear-gradient(180deg, rgba(255,202,58,0.22), rgba(255,202,58,0.10)); }
.btn.danger { border-color: rgba(255,93,93,0.35); background: linear-gradient(180deg, rgba(255,93,93,0.22), rgba(255,93,93,0.10)); }
.btn.info { border-color: rgba(58,191,255,0.35); background: linear-gradient(180deg, rgba(58,191,255,0.22), rgba(58,191,255,0.10)); }
.btn.subtle { background: rgba(255,255,255,0.03); }

.record-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.preview-actions { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; }
.preview-actions .timer { margin-left: 0; }
.preview-actions #btnSource[hidden] { display: none; }
/* Inline trimming */
.trim-inline { padding: 12px; position: relative; margin-top: 12px; }
.trim-inline.busy { pointer-events: none; }
.preview-actions.busy { pointer-events: none; opacity: 0.7; }
.trim-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
/* unified busy overlay styles above */
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.modal-header h3 { margin: 0; font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.trim-body { display: grid; gap: 12px; }
.trim-body video { width: 100%; border-radius: 10px; background: #000; border: 1px solid var(--card-border); }
.trim-timeline { display: grid; gap: 8px; }
.trim-timeline .canvas-container { position: relative; }
.trim-timeline canvas { width: 100%; height: 84px; border-radius: 8px; background: rgba(255,255,255,0.04); border: 1px solid var(--card-border); display: block; }
.range { position: absolute; top: 1px; left: 1px; right: 1px; bottom: 1px; pointer-events: none; }
.range .selection { position: absolute; top: 0; height: 100%; background: rgba(124,92,255,0.15); border: 1px solid rgba(124,92,255,0.4); border-left: none; border-right: none; z-index: 0; pointer-events: none; }
.range .handle { position: absolute; top: 0; width: 8px; height: 100%; background: linear-gradient(180deg, rgba(124,92,255,0.8), rgba(124,92,255,0.5)); border-radius: 4px; cursor: ew-resize; display: grid; place-items: center; z-index: 1; pointer-events: auto; }
.range .handle .bubble { position: absolute; top: -28px; left: 0; padding: 4px 6px; font-size: 12px; border-radius: 6px; background: rgba(0,0,0,0.6); color: #fff; white-space: nowrap; z-index: 10; }
.range .handle.start { left: 0; }
.range .handle.end { left: auto; }
.range .playhead { position: absolute; top: 0; width: 2px; height: 100%; background: #fff; opacity: 0.8; z-index: 2; pointer-events: none; }
.time-rail { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.timer { margin-left: auto; font-variant-numeric: tabular-nums; color: var(--muted); }

.download-link {
  margin-top: 12px; display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none;
  padding: 10px 12px; border-radius: 12px; border: 1px dashed var(--card-border); background: rgba(255,255,255,0.04);
}
.download-link i { width: 18px; height: 18px; color: var(--success); }

/* footer removed */


