/* Mesin Video Otomatis — stylesheet tunggal.
   Prinsip: kolom tunggal, lebar maks 960px, tombol besar,
   fokus keyboard terlihat. Tanpa framework CSS. */

:root {
  --latar: #ffffff;
  --teks: #1a1a1a;
  --aksen: #0b5fff;
  --aksen-gelap: #0040cc;
  --batas: #d0d0d0;
  --latar-scene: #f5f5f5;
  --latar-scene-aktif: #e8f0ff;
  --latar-status: #fff8e1;
  --teks-ringan: #555555;
  --merah: #cc0000;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  background: var(--latar);
  color: var(--teks);
  line-height: 1.6;
  font-size: 1rem;
}

/* Layout */
header, main, footer {
  max-width: 960px;
  margin: 0 auto;
  padding: 1rem 1.25rem;
}

header {
  border-bottom: 2px solid var(--aksen);
  margin-bottom: 0.5rem;
}

header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
  color: var(--aksen);
}

header p {
  margin: 0;
  color: var(--teks-ringan);
}

section {
  margin-bottom: 2.5rem;
  padding: 1.25rem;
  border: 1px solid var(--batas);
  border-radius: 6px;
}

section h2 {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  border-bottom: 1px solid var(--batas);
  padding-bottom: 0.4rem;
}

footer {
  border-top: 1px solid var(--batas);
  margin-top: 1rem;
  padding-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--teks-ringan);
}

/* Form */
#form-topik label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

#form-topik fieldset {
  border: 1px solid var(--batas);
  border-radius: 4px;
  padding: 0.6rem 0.9rem;
  margin: 0 0 1rem;
}

#form-topik fieldset legend {
  font-weight: 600;
  padding: 0 0.3rem;
}

#form-topik fieldset label {
  display: inline;
  font-weight: normal;
  margin-right: 1rem;
  cursor: pointer;
}

#form-topik fieldset input[type="radio"] {
  margin-right: 0.3rem;
}

/* Input teks & select */
input[type="text"], select, textarea {
  display: block;
  width: 100%;
  max-width: 32rem;
  padding: 0.6rem 0.75rem;
  margin: 0.25rem 0 1rem;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid var(--batas);
  border-radius: 4px;
  color: var(--teks);
  background: var(--latar);
}

textarea {
  resize: vertical;
  min-height: 4rem;
}

input[type="number"] {
  display: inline-block;
  width: 5rem;
  padding: 0.4rem 0.5rem;
  font-size: 1rem;
  border: 1px solid var(--batas);
  border-radius: 4px;
}

/* Fokus keyboard */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--aksen);
  outline-offset: 2px;
}

/* Tombol */
button {
  cursor: pointer;
  padding: 0.55rem 1rem;
  margin: 0.25rem 0.25rem 0.25rem 0;
  font-size: 1rem;
  font-family: inherit;
  background: var(--aksen);
  color: #ffffff;
  border: none;
  border-radius: 4px;
  transition: background 0.15s;
}

button:hover:not(:disabled) {
  background: var(--aksen-gelap);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button.sekunder {
  background: transparent;
  color: var(--aksen);
  border: 1px solid var(--aksen);
}

button.sekunder:hover:not(:disabled) {
  background: #e8f0ff;
}

button.berbahaya {
  background: var(--merah);
}

button.berbahaya:hover:not(:disabled) {
  background: #990000;
}

/* Daftar scene */
#daftar-scene {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

#daftar-scene li {
  background: var(--latar-scene);
  border: 1px solid var(--batas);
  border-radius: 6px;
  margin-bottom: 0.75rem;
  padding: 0.9rem 1rem;
  position: relative;
}

#daftar-scene li.scene-aktif-tts {
  background: var(--latar-scene-aktif);
  border-color: var(--aksen);
}

.scene-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.scene-nomor {
  font-weight: 700;
  color: var(--aksen);
  min-width: 2rem;
}

.scene-judul-input {
  flex: 1;
  max-width: none;
  margin: 0;
  font-weight: 600;
}

.scene-narasi-label {
  display: block;
  font-size: 0.875rem;
  color: var(--teks-ringan);
  margin-bottom: 0.2rem;
}

.scene-narasi-input {
  max-width: none;
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
}

.scene-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.scene-durasi-label {
  font-size: 0.875rem;
  color: var(--teks-ringan);
}

.scene-durasi-input {
  margin: 0;
}

.scene-tombol-narasi {
  font-size: 0.875rem;
  padding: 0.3rem 0.7rem;
}

.scene-tombol-hapus {
  font-size: 0.875rem;
  padding: 0.3rem 0.7rem;
  margin-left: auto;
}

.scene-tombol-naik,
.scene-tombol-turun {
  font-size: 0.875rem;
  padding: 0.3rem 0.6rem;
}

#total-durasi {
  font-size: 0.95rem;
  color: var(--teks-ringan);
  margin-bottom: 0.5rem;
}

/* Canvas preview */
#canvas-preview {
  width: 100%;
  max-width: 640px;
  height: auto;
  aspect-ratio: 16 / 9;
  background: #111;
  display: block;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

#indikator-scene {
  font-size: 0.95rem;
  color: var(--teks-ringan);
  margin: 0.25rem 0;
}

#progres-preview {
  font-size: 0.875rem;
  color: var(--teks-ringan);
  margin: 0.1rem 0 0.75rem;
}

.tombol-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

/* Area status */
#status {
  font-weight: 600;
  min-height: 1.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  background: var(--latar-status);
  margin-top: 1rem;
}

#status:empty {
  background: transparent;
  padding: 0;
}

/* Tombol contoh */
#btn-contoh {
  background: transparent;
  color: var(--aksen);
  border: 1px solid var(--aksen);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

#btn-contoh:hover:not(:disabled) {
  background: #e8f0ff;
}

/* Bagian ekspor */
.tombol-ekspor {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* Responsif sederhana */
@media (max-width: 600px) {
  header h1 { font-size: 1.3rem; }
  section { padding: 0.9rem; }
  #canvas-preview { max-width: 100%; }
}
