/* TURBO UNIQUE — parts copied from TurboLoader style.css + app-specific components */
/* ─── Reset & Base ───────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Core palette — Crisp Monochrome Black & White */
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-input: #fafafa;

  /* Borders */
  --border-subtle: #e4e4e7;
  --border-medium: #18181b;
  --border-accent: #09090b;

  /* Text */
  --text-primary: #09090b;
  --text-secondary: #52525b;
  --text-tertiary: #a1a1aa;
  --text-accent: #09090b;

  /* Accents */
  --accent-purple: #09090b;
  --accent-purple-light: #27272a;
  --accent-cyan: #18181b;
  --accent-cyan-light: #3f3f46;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --accent-yellow: #f59e0b;
  --accent-orange: #f97316;

  /* Gradients & Fits */
  --gradient-accent: linear-gradient(135deg, #09090b, #27272a);
  --gradient-card: linear-gradient(135deg, #ffffff, #fafafa);
  --gradient-glow-purple: radial-gradient(ellipse, rgba(0, 0, 0, 0.03), transparent 70%);
  --gradient-glow-cyan: radial-gradient(ellipse, rgba(0, 0, 0, 0.02), transparent 70%);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.1);
  --shadow-glow-purple: 0 0 20px rgba(9, 9, 11, 0.15);
  --shadow-glow-cyan: 0 0 20px rgba(9, 9, 11, 0.1);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-fast: 0.15s var(--ease-out);
  --transition-normal: 0.25s var(--ease-out);
  --transition-slow: 0.4s var(--ease-out);
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ─── Ambient Background ─────────────────────────────────── */
.ambient-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.ambient-glow--1 {
  width: 600px;
  height: 600px;
  background: var(--gradient-glow-purple);
  top: -200px;
  left: -100px;
  animation: ambientFloat 20s ease-in-out infinite;
}

.ambient-glow--2 {
  width: 500px;
  height: 500px;
  background: var(--gradient-glow-cyan);
  bottom: -150px;
  right: -100px;
  animation: ambientFloat 25s ease-in-out infinite reverse;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

@keyframes ambientFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 15px) scale(0.95); }
}

/* ─── App Container ──────────────────────────────────────── */
.app {
  position: relative;
  z-index: 1;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 32px;
  min-height: 100vh;
}

/* ─── Header ─────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  margin-bottom: 32px;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header__logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--gradient-card);
  border: 1px solid var(--border-subtle);
  box-shadow: none;
}

.header__title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.header__subtitle {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}


/* ─── Main Layout ────────────────────────────────────────── */
.main {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  align-items: stretch;
  min-width: 0;
  width: 100%;
}

.main > * {
  min-width: 0;
}

@media (max-width: 1100px) {
  .main {
    grid-template-columns: 1fr;
  }
}

/* ─── Panel ──────────────────────────────────────────────── */
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(20px);
  transition: border-color var(--transition-normal);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.panel:hover {
  border-color: var(--border-medium);
}

.panel--preview {
  min-height: 500px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.panel__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--gradient-card);
  border: 1px solid var(--border-accent);
  color: var(--accent-purple-light);
}

.panel__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.panel__meta {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

.meta-badge {
  font-size: 0.7rem;
  font-weight: 500;
  font-weight: 600;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 4px 10px;
  border-radius: 100px;
  background: #f4f4f5;
  color: #09090b;
  border: 1px solid #e4e4e7;
}

/* ─── Form ───────────────────────────────────────────────── */
.form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form__group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form__label-hint {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-tertiary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  pointer-events: none;
  z-index: 2;
  transition: color var(--transition-fast);
}

.form__input,
.form__select {
  width: 100%;
  padding: 12px 14px 12px 42px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--transition-fast);
  -webkit-appearance: none;
}

.form__select {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M3 5L6 8L9 5' stroke='%2309090b' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form__select option,
.vsl-quality-select option {
  background-color: #ffffff;
  color: #09090b;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.84rem;
  padding: 10px 14px;
}

.form__input:focus,
.form__select:focus {
  border-color: #09090b;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(9, 9, 11, 0.08);
}

.form__input:focus + .input-icon,
.form__input:focus ~ .input-icon,
.input-wrapper:focus-within .input-icon {
  color: #09090b;
}

.form__input::placeholder {
  color: var(--text-tertiary);
}

.input-wrapper--with-btn .form__input {
  padding-right: 100px;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.btn:hover::before {
  opacity: 1;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: #09090b;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(9, 9, 11, 0.15);
}

.btn--primary:hover {
  background: #18181b;
  box-shadow: 0 6px 20px rgba(9, 9, 11, 0.25);
  transform: translateY(-1px);
}

.btn--secondary {
  background: #ffffff;
  color: #09090b;
  border: 1px solid #18181b;
}

.btn--secondary:hover {
  background: #09090b;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(9, 9, 11, 0.2);
}

.btn--secondary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.form__actions {
  display: flex;
  gap: 12px;
  margin-top: 28px;
}

.form__actions .btn {
  flex: 1;
  justify-content: center;
}

/* ─── Checkbox ───────────────────────────────────────────── */
.form__options {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

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

.checkbox-custom {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-medium);
  border-radius: 5px;
  position: relative;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.checkbox-wrapper input:checked + .checkbox-custom {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
}

.checkbox-wrapper input:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.preview-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-tertiary);
  text-align: center;
  padding: 40px 20px;
}

.preview-empty__icon {
  margin-bottom: 20px;
  color: var(--text-tertiary);
}

.preview-empty__text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.preview-empty__text strong {
  color: var(--accent-purple-light);
}

.preview-empty__subtext {
  font-size: 0.78rem;
  color: var(--text-tertiary);
}

/* ─── Checkbox Options & Badges ──────────────────────────── */
.badge-recommended {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff;
  background: #09090b;
  border-radius: 100px;
  vertical-align: middle;
}

.checkbox-hint {
  margin-top: 6px;
  margin-left: 32px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ─── Toast Notifications ────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-primary);
  animation: toastSlideIn 0.4s var(--ease-out);
  max-width: 400px;
}

.toast--success {
  border-left: 3px solid var(--accent-green);
}

.toast--error {
  border-left: 3px solid var(--accent-red);
}

.toast--info {
  border-left: 3px solid var(--accent-cyan);
}

.toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast--removing {
  animation: toastSlideOut 0.3s var(--ease-out) forwards;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.vsl-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #ffffff;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #e4e4e7;
}

.vsl-progress__info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  font-weight: 600;
  color: #09090b;
}

.vsl-progress__bar {
  width: 100%;
  height: 6px;
  background: #f4f4f5;
  border-radius: 100px;
  overflow: hidden;
}

.vsl-progress__fill {
  height: 100%;
  background: #09090b;
  border-radius: 100px;
  transition: width 0.3s ease;
}

/* ─── Guide & Recommendations Card ────────────────────────── */
.guide-card {
  margin-top: 24px;
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.guide-card:hover {
  border-color: var(--border-accent);
}

.guide-card__toggle {
  width: 100%;
  padding: 14px 16px;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
}

.guide-card__title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--accent-purple-light);
}

.guide-card__arrow {
  color: var(--text-tertiary);
  transition: transform var(--transition-fast);
}

.guide-card.is-collapsed .guide-card__arrow {
  transform: rotate(-90deg);
}

.guide-card__content {
  padding: 0 16px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ═══ Turbo Unique additions ═══════════════════════════════ */
[hidden] { display: none !important; }

@media (max-width: 600px) {
  .app { padding: 16px 16px; }
  .header { margin-bottom: 16px; }
  .panel { padding: 20px 16px; }
  .header__title { font-size: 1.25rem; }
}

.panel--preview { overflow: visible; }

/* Segmented control (copy mode) */
.copy-row { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; }
.segmented {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  padding: 4px;
  gap: 4px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.segmented__btn {
  flex: 1;
  padding: 9px 8px;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-fast);
}
.segmented__btn:hover { color: var(--text-primary); background: #f4f4f5; }
.segmented__btn.is-active {
  background: #09090b;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(9, 9, 11, 0.15);
}
.form__input--num { width: 84px; flex: 0 0 84px; padding: 10px 12px; text-align: center; }

/* Settings groups */
#settingsGroups { display: flex; flex-direction: column; gap: 12px; }
#settingsGroups .guide-card { margin-top: 0; }
.guide-card__content { gap: 16px; }
.guide-card__content .setting:first-child { margin-top: 4px; }
.setting--check .checkbox-wrapper { color: var(--text-primary); font-weight: 500; }
.setting--check .checkbox-hint { margin-top: 4px; margin-left: 28px; }
.divider { border: none; border-top: 1px solid var(--border-subtle); margin: 2px 0; }
.setting--range { display: flex; flex-direction: column; gap: 6px; }
.range-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  background: #f4f4f5;
  border: 1px solid var(--border-subtle);
}
.range__limits { display: flex; justify-content: space-between; font-size: 0.7rem; color: var(--text-tertiary); }

/* Single + dual range slider */
.range { position: relative; height: 22px; }
.range__track {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 4px; margin-top: -2px;
  background: #e4e4e7; border-radius: 100px;
}
.range__fill { position: absolute; top: 0; bottom: 0; background: #09090b; border-radius: 100px; }
.range input[type="range"] {
  position: absolute; inset: 0;
  width: 100%; height: 22px; margin: 0;
  background: transparent;
  -webkit-appearance: none; appearance: none;
  pointer-events: none;
  z-index: 2;
}
.range input[type="range"]:focus { outline: none; }
.range input[type="range"]::-webkit-slider-runnable-track { background: transparent; height: 22px; }
.range input[type="range"]::-moz-range-track { background: transparent; }
.range input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  pointer-events: auto;
  width: 18px; height: 18px; margin-top: 2px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #09090b;
  box-shadow: var(--shadow-sm);
  cursor: grab;
}
.range input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #ffffff;
  border: 2px solid #09090b;
  cursor: grab;
}
.range input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(9, 9, 11, 0.12); }

/* Upload */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px;
  min-height: 220px;
  padding: 32px 20px;
  text-align: center;
  color: var(--text-tertiary);
  background: var(--bg-input);
  border: 1.5px dashed #d4d4d8;
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.dropzone:hover, .dropzone.is-drag { border-color: #09090b; background: #ffffff; box-shadow: 0 0 0 3px rgba(9, 9, 11, 0.06); }
.dropzone svg { margin-bottom: 8px; }

.file-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 14px; max-height: 260px; overflow-y: auto; }
.file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}
.file-item__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file-item__size { color: var(--text-tertiary); font-size: 0.74rem; white-space: nowrap; }
.file-item__del { border: none; background: none; font-size: 1.1rem; line-height: 1; color: var(--text-tertiary); cursor: pointer; padding: 0 2px; }
.file-item__del:hover { color: var(--text-primary); }

.form__actions .btn:disabled { opacity: 0.3; cursor: not-allowed; }
.btn--block { width: 100%; justify-content: center; }
.btn--reset { margin-top: 20px; }
.panel--preview .btn--reset { margin-top: auto; }
.panel--preview #uploadStage, .panel--preview .job { margin-bottom: 20px; }

/* Job status */
.job { display: flex; flex-direction: column; gap: 14px; }
.notice {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 500;
  line-height: 1.45;
  border: 1px solid var(--border-subtle);
  border-left-width: 3px;
  background: #ffffff;
}
.notice--warn { border-left-color: var(--accent-yellow); }
.notice--ok { border-left-color: var(--accent-green); font-weight: 600; }
.notice--err { border-left-color: var(--accent-red); color: #b91c1c; }
.btn--download {
  width: 100%;
  justify-content: center;
  padding: 18px 24px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

@media (max-width: 600px) {
  .segmented { flex-basis: 100%; }
}
