:root {
  color-scheme: dark;
}

html,
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: #07060d;
}

body {
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(124, 58, 237, 0.18), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(236, 72, 153, 0.14), transparent 60%),
    radial-gradient(700px 400px at 50% 110%, rgba(34, 211, 238, 0.12), transparent 60%),
    #07060d;
  min-height: 100vh;
}

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    conic-gradient(from 220deg at 60% 30%, rgba(168, 85, 247, 0.12), rgba(34, 211, 238, 0.08), rgba(244, 114, 182, 0.10), rgba(168, 85, 247, 0.12));
  filter: blur(80px);
  opacity: 0.7;
  animation: aurora-spin 40s linear infinite;
}

@keyframes aurora-spin {
  to { transform: rotate(1turn); }
}

.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.shadow-glow {
  box-shadow:
    0 30px 80px -30px rgba(124, 58, 237, 0.45),
    0 1px 0 0 rgba(255, 255, 255, 0.04) inset;
}

.text-gradient {
  background: linear-gradient(90deg, #c084fc, #f472b6 45%, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo-mark {
  display: grid;
  grid-template-columns: 6px 6px 6px;
  gap: 4px;
  padding: 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7c3aed, #ec4899 60%, #06b6d4);
  box-shadow: 0 10px 30px -10px rgba(124, 58, 237, 0.6);
}
.logo-mark > div {
  width: 6px;
  height: 18px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.95);
  animation: bars 1.6s ease-in-out infinite;
}
.logo-mark > div:nth-child(2) { animation-delay: 0.15s; height: 14px; align-self: center; }
.logo-mark > div:nth-child(3) { animation-delay: 0.3s; height: 22px; }
@keyframes bars {
  0%, 100% { transform: scaleY(0.6); }
  50% { transform: scaleY(1.0); }
}

.input {
  width: 100%;
  background: rgba(15, 15, 26, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  color: #f1f5f9;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input::placeholder { color: rgba(148, 163, 184, 0.7); }
.input:focus {
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
  color: white;
  font-weight: 600;
  font-size: 14px;
  padding: 9px 16px;
  border-radius: 10px;
  box-shadow: 0 10px 30px -10px rgba(168, 85, 247, 0.6);
  transition: transform 0.1s, filter 0.15s;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; filter: grayscale(0.3); }

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.field > span {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgb(148, 163, 184);
}
.field > input,
.field-inline > select {
  background: rgba(15, 15, 26, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  color: #f1f5f9;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field > input:focus,
.field-inline > select:focus {
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18);
}

/* Auto-computed read-only value (e.g. clip count). Visually muted so users
   know it isn't a control they need to edit, but still readable. */
.field-readout > input[readonly] {
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.18);
  color: rgb(216, 180, 254);
  cursor: default;
}
.field-readout > input[readonly]:focus {
  box-shadow: none;
  border-color: rgba(168, 85, 247, 0.18);
}

.field-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgb(148, 163, 184);
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgb(203, 213, 225);
  background: rgba(15, 15, 26, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
}
.toggle input {
  appearance: none;
  width: 32px;
  height: 18px;
  background: rgba(71, 85, 105, 0.6);
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
}
.toggle input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  transition: transform 0.18s;
}
.toggle input:checked {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
}
.toggle input:checked::after {
  transform: translateX(14px);
}

.feature-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  padding: 10px 12px;
  border-radius: 12px;
  color: rgb(226, 232, 240);
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-weight: 500;
  font-size: 11px;
}
.pill-muted { background: rgba(71, 85, 105, 0.4); color: #cbd5e1; }
.pill-ok { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.4); }
.pill-warn { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.4); }
.pill-err { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.4); }
.pill-progress { background: rgba(124, 58, 237, 0.18); color: #c4b5fd; border: 1px solid rgba(124, 58, 237, 0.4); }

.job-card {
  border-radius: 24px;
  padding: 24px;
}
.job-card[data-status='completed'] { border-color: rgba(16, 185, 129, 0.25); }
.job-card[data-status='failed']    { border-color: rgba(239, 68, 68, 0.25); }

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #ec4899, #22d3ee);
  background-size: 200% 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
  animation: shimmer 2.4s linear infinite;
}
@keyframes shimmer {
  to { background-position: 200% 0; }
}

.clip-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s;
}
.clip-card:hover {
  transform: translateY(-2px);
  border-color: rgba(168, 85, 247, 0.4);
}
.clip-card video {
  width: 100%;
  aspect-ratio: 9 / 16;
  background: black;
  object-fit: cover;
  display: block;
}
.clip-meta {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.clip-actions {
  display: flex;
  gap: 8px;
  padding: 0 14px 14px;
}
.btn-mini {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.12s;
}
.btn-mini:hover { background: rgba(168, 85, 247, 0.18); }

.score-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #22d3ee, #a855f7, #f472b6);
  border-radius: 999px;
}

.tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(168, 85, 247, 0.15);
  color: #ddd6fe;
  border: 1px solid rgba(168, 85, 247, 0.3);
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tag-face { background: rgba(34, 211, 238, 0.12); color: #67e8f9; border-color: rgba(34, 211, 238, 0.3); }
.tag-cap { background: rgba(244, 114, 182, 0.12); color: #fbcfe8; border-color: rgba(244, 114, 182, 0.3); }

.quality-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid;
  text-transform: uppercase;
}
.quality-4k    { background: linear-gradient(135deg, #fcd34d, #f59e0b); color: #1f1300; border-color: rgba(245, 158, 11, 0.7); box-shadow: 0 6px 20px -6px rgba(245, 158, 11, 0.7); }
.quality-2k    { background: linear-gradient(135deg, #c4b5fd, #8b5cf6); color: #1a0d3a; border-color: rgba(139, 92, 246, 0.7); }
.quality-hd    { background: rgba(16, 185, 129, 0.18); color: #6ee7b7; border-color: rgba(16, 185, 129, 0.55); }
.quality-mid   { background: rgba(34, 211, 238, 0.15); color: #a5f3fc; border-color: rgba(34, 211, 238, 0.5); }
.quality-low   { background: rgba(245, 158, 11, 0.15); color: #fcd34d; border-color: rgba(245, 158, 11, 0.5); }
.quality-bad   { background: rgba(239, 68, 68, 0.18); color: #fecaca; border-color: rgba(239, 68, 68, 0.55); }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(2, 1, 12, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal.hidden { display: none; }

.modal-card {
  position: relative;
  width: 100%;
  max-width: 460px;
  background: linear-gradient(180deg, rgba(20, 16, 36, 0.96), rgba(12, 8, 22, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 30px 80px -20px rgba(124, 58, 237, 0.5);
  animation: modal-pop 0.18s ease-out;
}
@keyframes modal-pop {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.12); }

.cookies-status {
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: #cbd5e1;
}
.cookies-status.ok {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}
.cookies-status.miss {
  background: rgba(245, 158, 11, 0.10);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}

.cookies-pool {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}
.pool-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.pool-row .tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}
.pool-row .tag.tag-good {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
}
.pool-row .tag.tag-bad {
  background: rgba(239, 68, 68, 0.18);
  color: #fca5a5;
}
.pool-row .tag.tag-mid {
  background: rgba(245, 158, 11, 0.16);
  color: #fcd34d;
}

.cookies-drop {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  border: 2px dashed rgba(168, 85, 247, 0.4);
  border-radius: 12px;
  background: rgba(168, 85, 247, 0.06);
  color: #ddd6fe;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.cookies-drop:hover { background: rgba(168, 85, 247, 0.12); border-color: rgba(168, 85, 247, 0.7); }
.cookies-drop.dragging { background: rgba(168, 85, 247, 0.2); border-color: #c084fc; }

.link { color: #c4b5fd; text-decoration: underline; }
.link:hover { color: #ddd6fe; }

.banner-warn {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(244, 114, 182, 0.10));
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 16px;
  padding: 16px 20px;
  box-shadow: 0 20px 60px -20px rgba(245, 158, 11, 0.35);
}
.banner-warn.hidden { display: none; }

.cookies-paste {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  padding: 10px 12px;
}
.cookies-paste summary {
  cursor: pointer;
  font-size: 12px;
  color: #cbd5e1;
  user-select: none;
}
.cookies-paste textarea {
  width: 100%;
  margin-top: 8px;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: #e2e8f0;
  resize: vertical;
}
.cookies-paste code {
  background: rgba(148, 163, 184, 0.15);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}

/* ===== Video preview + range picker ===== */
.video-preview {
  margin-top: 24px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 18px;
  padding: 18px;
  position: relative;
}
.video-preview.hidden { display: none; }

.vp-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 720px) {
  .vp-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
}

.vp-player-wrap {
  position: relative;
}
.vp-player {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 16px 40px -16px rgba(0, 0, 0, 0.7);
}
.vp-player img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.vp-player iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.vp-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: transform 0.15s ease, background 0.15s ease;
}
.vp-play:hover { background: rgba(167, 139, 250, 0.9); transform: scale(1.05); }
.vp-player-error {
  margin-top: 8px;
  padding: 8px 10px;
  font-size: 12px;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: 10px;
}
.vp-player-error.hidden { display: none; }

.vp-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.vp-meta h4 {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.3;
  color: #f1f5f9;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.vp-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.12);
  color: #cbd5e1;
  border: none;
  cursor: pointer;
  font-size: 14px;
  z-index: 2;
}
.vp-close:hover { background: rgba(148, 163, 184, 0.25); color: #fff; }

.range-quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* A thin live cursor inside the slider track that follows the player. */
.range-cursor {
  position: absolute;
  top: 50%;
  width: 2px;
  height: 70%;
  transform: translate(-50%, -50%);
  background: #fff;
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.7);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.range-cursor.active { opacity: 1; }

.range-picker {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(148, 163, 184, 0.18);
}
.range-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.range-slider-wrap {
  margin-top: 14px;
}
.range-slider-wrap.hidden { display: none; }
.range-track {
  position: relative;
  height: 36px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.18);
}
.range-fill {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 14px;
  background: linear-gradient(90deg, #a78bfa, #f472b6);
  border-radius: 999px;
  pointer-events: none;
  box-shadow: 0 0 16px rgba(167, 139, 250, 0.4);
}
.range-track input[type="range"] {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  appearance: none;
  background: transparent;
  pointer-events: none;
}
.range-track input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #a78bfa;
  cursor: grab;
  pointer-events: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}
.range-track input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #a78bfa;
  cursor: grab;
  pointer-events: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}
.range-track input[type="range"]::-webkit-slider-thumb:active { cursor: grabbing; }
.range-numeric {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  flex-wrap: wrap;
}
.range-numeric input[type="text"] {
  width: 90px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* Big primary action under the range slider — this is THE button users
   should reach for once they've picked a window. The original tiny "Üret"
   pill in the header still works as a secondary path. */
.generate-range-btn {
  margin-top: 18px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid rgba(168, 85, 247, 0.55);
  background:
    linear-gradient(135deg, rgba(168, 85, 247, 0.95), rgba(236, 72, 153, 0.95));
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow:
    0 12px 32px -12px rgba(168, 85, 247, 0.6),
    0 4px 14px -6px rgba(236, 72, 153, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.generate-range-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.08);
  box-shadow:
    0 18px 40px -12px rgba(168, 85, 247, 0.75),
    0 6px 18px -6px rgba(236, 72, 153, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.generate-range-btn:active {
  transform: translateY(0);
  filter: brightness(0.95);
}
.generate-range-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.3);
}
.generate-range-icon {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 18px;
  font-weight: 700;
}
.generate-range-text {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.25;
}
.generate-range-title {
  font-size: 15px;
  letter-spacing: 0.01em;
}
.generate-range-sub {
  font-size: 12px;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}
.generate-range-arrow {
  flex: 0 0 auto;
  font-size: 20px;
  opacity: 0.9;
  transition: transform 0.2s ease;
}
.generate-range-btn:hover .generate-range-arrow {
  transform: translateX(3px);
}
