:root {
  --bg: #0f0f17;
  --panel: #1a1a26;
  --panel-2: #232333;
  --accent: #fe2c55;
  --accent-2: #25f4ee;
  --text: #f1f1f4;
  --muted: #9a9ab0;
  --radius: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  background: radial-gradient(1200px 600px at 80% -10%, #2a1430 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
}

.app { max-width: 1040px; margin: 0 auto; padding: 32px 20px 60px; }

.hero { text-align: center; margin-bottom: 28px; }
.hero h1 { font-size: 2rem; margin: 0 0 6px; }
.hero p { color: var(--muted); margin: 0; }

.grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
}
@media (max-width: 820px) {
  .grid { grid-template-columns: 1fr; }
}

.panel {
  background: var(--panel);
  border: 1px solid #2a2a3a;
  border-radius: var(--radius);
  padding: 24px;
}

form { display: flex; flex-direction: column; gap: 16px; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 600;
}

input {
  background: var(--panel-2);
  border: 1px solid #34344a;
  color: var(--text);
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
  transition: border-color .15s;
}
input:focus { border-color: var(--accent-2); }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.hint { margin: -6px 0 0; font-size: 0.8rem; color: var(--muted); }

button {
  margin-top: 4px;
  background: linear-gradient(135deg, var(--accent), #ff5c7c);
  color: #fff;
  border: none;
  padding: 14px;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .1s, opacity .2s;
}
button:hover { transform: translateY(-1px); }
button:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.status {
  margin-top: 18px;
  padding: 14px;
  border-radius: 10px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.status.loading { background: #16263a; border: 1px solid #2a4456; color: #bfe3ff; }
.status.error { background: #3a1620; border: 1px solid #5a2333; color: #ffc9d4; }
.status.success { background: #16321f; border: 1px solid #235a33; color: #bff0cb; }
.hidden { display: none !important; }

.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 3px solid rgba(255,255,255,.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.preview-panel { display: flex; flex-direction: column; align-items: center; }
.preview-panel h2 { margin: 0 0 16px; font-size: 1.1rem; }

.phone {
  position: relative;
  width: 270px;
  aspect-ratio: 9 / 16;
  background: #000;
  border-radius: 22px;
  overflow: hidden;
  border: 3px solid #2a2a3a;
}
.phone video { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }

.placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; color: var(--muted);
}
.placeholder span { font-size: 2.4rem; }
.placeholder p { margin: 0; font-size: 0.85rem; }

.download {
  margin-top: 18px;
  display: inline-block;
  text-decoration: none;
  background: var(--accent-2);
  color: #06262a;
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 10px;
}

.foot { text-align: center; margin-top: 30px; color: var(--muted); font-size: 0.8rem; }

/* Tabs */
.tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }
.tab {
  background: var(--panel-2);
  color: var(--muted);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid #34344a;
}
.tab.active {
  background: linear-gradient(135deg, var(--accent), #ff5c7c);
  color: #fff;
  border-color: transparent;
}

/* Duration presets */
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.preset {
  flex: 1 1 auto;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid #34344a;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
}
.preset.active {
  background: rgba(37, 244, 238, 0.15);
  border-color: var(--accent-2);
  color: var(--accent-2);
}
.custom-dur { margin-top: 4px; }

/* Bulk */
.steps { color: var(--muted); font-size: 0.88rem; line-height: 1.7; padding-left: 18px; }
.steps code { background: var(--panel-2); padding: 1px 6px; border-radius: 6px; color: #ffd; }
.bulk-actions { margin: 14px 0 20px; }
.btn-secondary {
  display: inline-block;
  text-decoration: none;
  background: var(--panel-2);
  border: 1px solid #34344a;
  color: var(--text);
  font-weight: 700;
  padding: 11px 18px;
  border-radius: 10px;
}
#bulk-form { display: flex; flex-direction: column; gap: 14px; }
#csv-file { padding: 10px; }

.progressbar {
  width: 100%; height: 12px;
  background: var(--panel-2);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
}
.progressbar-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width .3s;
}

.results { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.result-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  align-items: center;
  gap: 10px;
  background: var(--panel-2);
  border: 1px solid #2f2f42;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
}
.result-row .rstatus { font-size: 1.1rem; text-align: center; }
.result-row .rtitle { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-row a { color: var(--accent-2); text-decoration: none; font-weight: 700; }
.result-row .err { color: #ffb4c0; font-size: 0.82rem; }
.result-row .muted { color: var(--muted); }
