:root {
  --bg-dark: #07090e;
  --bg-card: rgba(18, 24, 38, 0.7);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-card-hover: rgba(26, 34, 52, 0.8);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --primary-glow: rgba(139, 92, 246, 0.35);
  --accent-cyan: #06b6d4;
  --accent-pink: #f43f5e;
  --accent-emerald: #10b981;
  --yt-red: #ef4444;
  --tt-cyan: #00f2fe;
  --fb-blue: #3b82f6;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* Background Ambient Glows */
.glow-bg {
  position: fixed;
  width: 650px;
  height: 650px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(140px);
  z-index: 0;
  opacity: 0.22;
}

.glow-bg.top-left {
  top: -200px;
  left: -150px;
  background: radial-gradient(circle, #8b5cf6, #3b82f6);
}

.glow-bg.bottom-right {
  bottom: -200px;
  right: -150px;
  background: radial-gradient(circle, #ec4899, #06b6d4);
}

.app-container {
  position: relative;
  z-index: 1;
  max-width: 1360px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* Header */
.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding-bottom: 0.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 24px var(--primary-glow);
}

.brand h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.badge-ratio {
  font-size: 0.85rem;
  font-weight: 700;
  background: linear-gradient(135deg, #06b6d4, #8b5cf6);
  color: white;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
  box-shadow: 0 2px 10px rgba(6, 182, 212, 0.3);
}

.subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin-top: 0.15rem;
}

.header-badges {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.platform-chip {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--text-muted);
}

.platform-chip .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.platform-chip.yt .dot { background-color: var(--yt-red); box-shadow: 0 0 8px var(--yt-red); }
.platform-chip.tt .dot { background-color: var(--tt-cyan); box-shadow: 0 0 8px var(--tt-cyan); }
.platform-chip.fb .dot { background-color: var(--fb-blue); box-shadow: 0 0 8px var(--fb-blue); }
.platform-chip.local .dot { background-color: var(--accent-emerald); box-shadow: 0 0 8px var(--accent-emerald); }

/* Common Card */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--bg-card-border);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  color: white;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid rgba(139, 92, 246, 0.35);
}

/* Input Group */
.input-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.input-wrapper {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  min-width: 320px;
}

.url-icon {
  position: absolute;
  left: 1.1rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  background: rgba(10, 14, 23, 0.85);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  padding: 0.9rem 2.8rem 0.9rem 3.2rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-clear {
  position: absolute;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
  display: none;
}

/* Buttons */
.btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.85rem 1.4rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
  color: white;
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #9d71fd 0%, #6d28d9 100%);
  transform: translateY(-1px);
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--bg-card-border);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--bg-card-border);
}

.btn-ghost:hover {
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
}

.btn-render {
  width: 100%;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  padding: 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.35);
}

.btn-render:hover {
  background: linear-gradient(135deg, #34d399 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.45);
}

.btn-batch {
  width: 100%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border: 1px solid var(--bg-card-border);
  padding: 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.btn-batch:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--primary);
}

/* Dropzone */
.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(10, 14, 23, 0.4);
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: rgba(139, 92, 246, 0.06);
  transform: scale(1.005);
}

.dropzone-icon {
  color: var(--primary);
  margin-bottom: 0.85rem;
}

.dropzone-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.dropzone-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}

/* Workspace */
.workspace {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  animation: fadeIn 0.3s ease-in-out;
}

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

.video-meta-bar {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1rem 1.5rem;
}

.meta-thumb {
  width: 80px;
  height: 50px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-card-border);
}

.meta-info {
  flex: 1;
}

.meta-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.meta-tags {
  display: flex;
  gap: 0.5rem;
}

.tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Editor Grid */
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 1.5rem;
  align-items: start;
}

.main-editor-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.side-col {
  position: sticky;
  top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

@media (max-width: 1080px) {
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .side-col {
    position: static;
  }
}

/* Video Player Card */
.player-card {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.video-wrapper {
  position: relative;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  max-height: 480px;
  display: flex;
  justify-content: center;
  align-items: center;
}

#mainVideoPlayer {
  width: 100%;
  max-height: 480px;
  object-fit: contain;
  display: block;
}

.player-center-play {
  position: absolute;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.player-center-play:hover {
  transform: scale(1.1);
  background: var(--primary);
}

/* Timeline Controls */
.timeline-controls {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0.5rem 0.5rem 0.25rem 0.5rem;
}

.transport-buttons {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-play-pause {
  background: var(--primary);
  border: none;
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--primary-glow);
  transition: all 0.2s;
}

.btn-play-pause:hover {
  transform: scale(1.05);
}

.timecode-display {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  margin-left: 0.5rem;
}

.tc-current {
  color: #38bdf8;
  font-weight: 600;
}

.tc-slash {
  color: var(--text-muted);
  margin: 0 0.25rem;
}

.tc-total {
  color: var(--text-muted);
}

/* Visual Timeline Slider with Dual Handles */
.timeline-container {
  position: relative;
  height: 40px;
  background: #090d16;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  padding: 0;
  user-select: none;
}

.timeline-track {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

.timeline-selection {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  width: 30%;
  background: rgba(139, 92, 246, 0.35);
  border-left: 2px solid var(--primary);
  border-right: 2px solid var(--primary);
}

.timeline-playhead {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0%;
  width: 2px;
  background: #38bdf8;
  box-shadow: 0 0 6px #38bdf8;
  z-index: 5;
}

.slider-handle {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  margin: 0;
  padding: 0;
  appearance: none;
  background: transparent;
  pointer-events: none;
  z-index: 10;
}

.slider-handle::-webkit-slider-thumb {
  appearance: none;
  pointer-events: all;
  width: 16px;
  height: 38px;
  border-radius: 4px;
  background: var(--primary);
  border: 2px solid white;
  cursor: ew-resize;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  transition: background 0.15s;
}

.slider-handle::-webkit-slider-thumb:hover {
  background: #a78bfa;
}

.slider-end::-webkit-slider-thumb {
  background: #06b6d4;
}

.slider-end::-webkit-slider-thumb:hover {
  background: #22d3ee;
}

/* Controls Card & Duration Presets */
.controls-card {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  font-weight: 700;
}

.selection-badge {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  background: rgba(139, 92, 246, 0.18);
  border: 1px solid rgba(139, 92, 246, 0.4);
  color: #c4b5fd;
  padding: 0.25rem 0.65rem;
  border-radius: 12px;
}

.duration-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.6rem;
}

.pill-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--bg-card-border);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.86rem;
  font-weight: 600;
  padding: 0.65rem 0.5rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s ease;
}

.pill-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
}

.pill-btn.active {
  color: white;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.35) 0%, rgba(6, 182, 212, 0.25) 100%);
  border-color: var(--primary);
  box-shadow: 0 4px 14px var(--primary-glow);
}

/* Timestamp Grid */
.timestamp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  background: rgba(10, 14, 23, 0.5);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-card-border);
}

.ts-box label {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.4rem;
}

.ts-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.ts-input-wrap input {
  width: 90px;
  background: #060911;
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.45rem 0.6rem;
  border-radius: var(--radius-sm);
}

.ts-input-wrap .unit {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.btn-sub {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--bg-card-border);
  color: var(--text-muted);
  font-size: 0.72rem;
  padding: 0.35rem 0.6rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-sub:hover {
  color: white;
  background: rgba(255, 255, 255, 0.12);
}

/* Smartphone Mockup Preview */
.mockup-card {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.mockup-header {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mockup-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.pill-badge {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  background: rgba(6, 182, 212, 0.15);
  color: #38bdf8;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  border: 1px solid rgba(6, 182, 212, 0.3);
}

.phone-frame {
  width: 230px;
  height: 410px;
  background: #020408;
  border: 7px solid #1e293b;
  border-radius: 36px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.phone-notch {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 65px;
  height: 14px;
  background: #1e293b;
  border-radius: 10px;
  z-index: 10;
}

.phone-screen {
  width: 100%;
  height: 100%;
  position: relative;
  background: #000;
  overflow: hidden;
}

.preview-layer-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  filter: blur(14px) brightness(0.7);
  transform: scale(1.15);
  transition: all 0.3s;
}

.preview-layer-fg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

#previewCanvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.simulated-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.2rem 0.6rem 0.8rem 0.6rem;
  z-index: 5;
}

.sim-right-icons {
  align-self: flex-end;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: center;
}

.sim-icon {
  font-size: 0.95rem;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

.sim-icon span {
  font-size: 0.55rem;
  font-weight: 600;
}

.sim-bottom-text {
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

.sim-user {
  font-size: 0.68rem;
  font-weight: 700;
  color: white;
}

.sim-caption {
  font-size: 0.6rem;
  color: rgba(255, 255, 255, 0.85);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Settings Card */
.settings-card {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.settings-title {
  font-size: 0.95rem;
  font-weight: 700;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.form-group label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.radio-cards {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--bg-card-border);
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.radio-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

.radio-card input[type="radio"] {
  margin-top: 0.25rem;
  accent-color: var(--primary);
}

.radio-body strong {
  display: block;
  font-size: 0.85rem;
  color: var(--text-main);
}

.radio-body p {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 0.15rem;
}

#panSlider {
  width: 100%;
  accent-color: var(--accent-cyan);
}

.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
}

#headerTextInput {
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

#headerTextInput:focus {
  outline: none;
  border-color: var(--primary);
}

.form-select {
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.85rem;
}

/* Watermark Controls */
.watermark-box {
  background: rgba(10, 14, 23, 0.6);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.2s ease;
}

.watermark-box:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.watermark-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.toggle-wrap input[type="checkbox"] {
  display: none;
}

.toggle-slider {
  width: 38px;
  height: 20px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  position: relative;
  transition: background 0.2s ease;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.toggle-wrap input[type="checkbox"]:checked + .toggle-slider {
  background: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
}

.toggle-wrap input[type="checkbox"]:checked + .toggle-slider::after {
  transform: translateX(18px);
}

.watermark-options {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--bg-card-border);
  animation: fadeIn 0.2s ease;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.label-with-val {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.val-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--accent-cyan);
}

.checkbox-sub {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.74rem;
  color: var(--text-muted);
  cursor: pointer;
}

.checkbox-sub input[type="checkbox"] {
  accent-color: var(--primary);
}

/* Watermark Color Picker & Swatches */
.color-picker-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  padding-top: 0.2rem;
}

.color-swatches {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.color-swatch {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
  outline: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch:hover {
  transform: scale(1.18);
  border-color: #ffffff;
}

.color-swatch.active {
  transform: scale(1.22);
  border-color: #ffffff;
  box-shadow: 0 0 0 2px var(--primary), 0 0 10px rgba(139, 92, 246, 0.7);
}

.custom-color-wrap {
  position: relative;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(red, yellow, lime, aqua, blue, magenta, red);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.custom-color-wrap:hover {
  transform: scale(1.18);
  border-color: #ffffff;
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.custom-color-wrap input[type="color"] {
  position: absolute;
  top: -15px;
  left: -15px;
  width: 60px;
  height: 60px;
  opacity: 0;
  cursor: pointer;
}

.color-hex-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.08);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-card-border);
  letter-spacing: 0.5px;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

/* Gallery Section */
.gallery-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.gallery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.gallery-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.gallery-title-wrap h2 {
  font-size: 1.3rem;
  font-weight: 700;
}

.clips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.empty-gallery {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.clip-card {
  background: rgba(10, 14, 23, 0.8);
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, border-color 0.2s;
}

.clip-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}

.clip-video-wrap {
  width: 100%;
  aspect-ratio: 9 / 16;
  background: #000;
  position: relative;
}

.clip-video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.clip-body {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.clip-name {
  font-size: 0.82rem;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clip-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.clip-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.clip-actions .btn {
  flex: 1;
}

/* Modal Backdrop & Card */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 7, 13, 0.82);
  backdrop-filter: blur(12px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: #0d1322;
  border: 1px solid var(--bg-card-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 440px;
  padding: 2rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}

.modal-icon-pulse {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(139, 92, 246, 0.15);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse 1.6s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0.5); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 16px rgba(139, 92, 246, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(139, 92, 246, 0); }
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 700;
}

.modal-status {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.progress-bar-wrap {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #06b6d4, #10b981);
  border-radius: 6px;
  transition: width 0.3s ease;
}

.progress-info {
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.modal-actions {
  display: flex;
  gap: 0.65rem;
  width: 100%;
  margin-top: 0.75rem;
}

.modal-actions .btn {
  flex: 1;
}

/* Spinner & Utility */
.hidden {
  display: none !important;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Custom Dialog Modal Styles */
.dialog-card {
  max-width: 420px;
  padding: 1.85rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  animation: modalScaleIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalScaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.dialog-icon-wrap {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.25rem;
}

.dialog-icon-wrap.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.25);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.dialog-icon-wrap.primary {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
  box-shadow: 0 0 25px rgba(139, 92, 246, 0.25);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.dialog-icon-wrap.success {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.25);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.dialog-message {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  word-break: break-word;
}

.dialog-input-wrap {
  width: 100%;
  margin: 0.4rem 0;
}

.dialog-input {
  width: 100%;
  background: rgba(10, 14, 23, 0.9);
  border: 1px solid var(--bg-card-border);
  color: var(--text-main);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.dialog-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 6px 18px rgba(239, 68, 68, 0.35);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #f87171 0%, #b91c1c 100%);
  transform: translateY(-1px);
  box-shadow: 0 8px 22px rgba(239, 68, 68, 0.5);
}

