:root{
  --bg0:#050816;
  --bg1:#090a1a;
  --accent:#fb7185;          /* selaraskan dengan --a3 style-1 */
  --accent2:#22d3ee;         /* selaraskan dengan --a1 */
  --accent-soft:rgba(251,113,133,.12);
  --border:rgba(255,255,255,.16);
  --border-soft:rgba(255,255,255,.10);
  --card:rgba(255,255,255,.08);
  --card2:rgba(255,255,255,.05);
  --text:#eef2ff;
  --muted:rgba(238,255,255,.72);
  --danger:#ef4444;
  --success:#22c55e;
  --radius-lg:18px;
  --shadow-lg:0 18px 60px rgba(0,0,0,.55);
}

/* hidden */
[hidden]{display:none !important;}

*{box-sizing:border-box;}
html,body{height:100%;}
body{
  margin:0;
  font-family:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,Arial,sans-serif;
  color:var(--text);
  background:
    radial-gradient(900px 700px at 10% 10%, rgba(34,211,238,.28), transparent 60%),
    radial-gradient(900px 700px at 90% 15%, rgba(167,139,250,.26), transparent 60%),
    radial-gradient(900px 700px at 70% 90%, rgba(251,113,133,.20), transparent 60%),
    linear-gradient(180deg, var(--bg0), var(--bg1));
  overflow-x:hidden;
}

/* grain overlay ala style-1 */
body::before{
  content:"";
  position:fixed;
  inset:-40px;
  pointer-events:none;
  opacity:.12;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.55) 0 1px, transparent 2px),
    radial-gradient(circle at 80% 40%, rgba(255,255,255,.50) 0 1px, transparent 2px),
    radial-gradient(circle at 40% 80%, rgba(255,255,255,.45) 0 1px, transparent 2px);
  background-size:22px 22px,26px 26px,30px 30px;
  filter:blur(.2px);
}

a{color:inherit;text-decoration:none;}
a:hover{text-decoration:underline;}

.app{
  min-height:100%;
  display:flex;
  flex-direction:column;
}

/* HERO / HEADER -> diselaraskan dengan .top/.brand style-1 */
/* FIX: bikin hero transparan supaya background menyatu, tidak ada blok hitam terpisah */
.hero{
  position:sticky;
  top:0;
  z-index:10;
  border-bottom:1px solid var(--border-soft);
  backdrop-filter:blur(14px);
  background:transparent;
}
.hero-inner{
  max-width:980px;
  margin:0 auto;
  padding:18px 16px 14px;
  text-align:center;
}
.hero-title{
  margin:0;
  font-size:clamp(18px,3vw,22px);
  font-weight:900;
  letter-spacing:.22em;
  text-transform:uppercase;
  background:linear-gradient(90deg, #22d3ee, #a78bfa, #fb7185, #fbbf24);
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
  text-shadow:0 10px 40px rgba(0,0,0,.35);
}
.hero-subtitle{
  margin-top:8px;
  font-size:12.5px;
  color:var(--muted);
}

/* TABS -> gaya chip mirip .btn-ghost/settings-chip style-1 */
.tabs{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px;
  margin-top:14px;
}
.tab-pill{
  padding:9px 16px;
  border-radius:999px;
  border:1px solid var(--border-soft);
  background:rgba(255,255,255,.06);
  color:var(--muted);
  font-size:13px;
  font-weight:700;
  letter-spacing:.02em;
  backdrop-filter:blur(10px);
  box-shadow:0 14px 30px rgba(0,0,0,.45);
  transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.tab-pill:hover{
  border-color:rgba(34,211,238,.45);
  background:rgba(255,255,255,.08);
  text-decoration:none;
}
.tab-active{
  border-color:rgba(34,211,238,.55);
  color:var(--text);
  background:linear-gradient(135deg, #22d3ee, #a78bfa, #fb7185);
}
.tab-disabled{
  opacity:.45;
  cursor:default;
}

/* MAIN LAYOUT */
.main{flex:1;}
.shell{
  max-width:980px;
  margin:0 auto;
  padding:18px 16px 26px;
}

/* ALERTS -> pakai gaya alert style-1 */
.alert{
  border-radius:16px;
  padding:10px 12px;
  margin-bottom:12px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.06);
  font-size:13px;
}
.alert-success{
  border-color:rgba(34,197,94,.35);
  background:rgba(34,197,94,.12);
}
.alert-error{
  border-color:rgba(239,68,68,.35);
  background:rgba(239,68,68,.12);
}

/* TOOL CARDS -> glass card style-1 */
.tool-card{
  margin-bottom:18px;
  border-radius:var(--radius-lg);
  background:
    linear-gradient(180deg, var(--card), var(--card2));
  border:1px solid var(--border);
  box-shadow:var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,.10);
  backdrop-filter:blur(10px);
  padding:18px;
}
.tool-card-disabled{
  opacity:.55;
}

.tool-head h2{
  margin:0 0 6px;
  font-size:18px;
  letter-spacing:.01em;
}
.tool-desc{
  margin:10px 0 0;
  font-size:13.5px;
  color:var(--muted);
}
.tool-body{
  margin-top:14px;
}

/* FORM ELEMENTS -> selaraskan dengan .field style-1 */
.label{
  display:block;
  font-size:12px;
  color:rgba(238,242,255,.75);
  margin-bottom:6px;
}
.input, textarea{
  width:100%;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.16);
  background:rgba(2,6,23,.65);
  color:var(--text);
  padding:10px 11px;
  font-size:13.5px;
  outline:none;
}
.input:focus, textarea:focus{
  border-color:rgba(34,211,238,.55);
  box-shadow:0 0 0 4px rgba(34,211,238,.12);
}
.form-inline{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  align-items:center;
}
.form-inline .input{
  flex:1 1 220px;
}
.form-vertical .input{
  margin-bottom:10px;
}
.api-row{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  align-items:center;
}
.api-row .hint{
  flex:1 1 200px;
}

/* BUTTONS -> pakai .btn / .btn-ghost style-1 */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:42px;
  padding:10px 14px;
  border-radius:999px;
  border:0;
  font-size:13.5px;
  font-weight:800;
  letter-spacing:.02em;
  cursor:pointer;
  background:linear-gradient(135deg, #22d3ee, #a78bfa, #fb7185);
  color:rgba(5,8,22,.95);
  box-shadow:0 14px 30px rgba(34,211,238,.18);
  text-decoration:none;
  user-select:none;
  transition:transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}
.btn:hover{transform:translateY(-1px);}
.btn:active{transform:translateY(0) scale(.99);}

.btn-primary{ /* alias saja, sama dengan .btn */
}
.btn-outline{
  border:1px solid var(--border);
  background:rgba(255,255,255,.06);
  color:var(--text);
  box-shadow:0 14px 30px rgba(0,0,0,.45);
}
.btn-outline:hover{
  border-color:rgba(34,211,238,.45);
  background:rgba(255,255,255,.08);
}

/* TEXT HELPERS */
.hint{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
}

/* OUTPUT BOX */
.output-box{
  margin-top:6px;
  max-height:380px;
  overflow:auto;
  background:rgba(2,6,23,.82);
  border-radius:14px;
  border:1px solid var(--border-soft);
  padding:10px 12px;
  font-size:13px;
  line-height:1.4;
  white-space:pre-wrap;
}

/* FOOTER -> mirip card/row style-1 */
.footer{
  border-top:1px solid var(--border-soft);
  background:rgba(2,6,23,.88);
}
.footer-inner{
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  gap:8px;
  padding:10px 16px 12px;
  font-size:12px;
}
.muted{color:var(--muted);}

/* RESPONSIVE */
@media (max-width:640px){
  .tool-card{padding:14px 14px 16px;}
  .hero-inner{padding-bottom:12px;}
}

/* MODAL API SETTINGS */
/* FIX: biarkan selalu display:flex di CSS, show/hide hanya lewat attribute hidden */
.modal-backdrop{
  position:fixed;
  inset:0;
  background:rgba(3,6,20,.70);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:40;
  padding:16px;
}

.modal{
  width:100%;
  max-width:460px;
  max-height:88vh;
  overflow:auto;
  background:
    radial-gradient(700px 240px at 10% 0%, rgba(34,211,238,.18), transparent 60%),
    radial-gradient(700px 240px at 90% 10%, rgba(167,139,250,.16), transparent 60%),
    rgba(2,6,23,.82);
  border-radius:18px;
  border:1px solid rgba(255,255,255,.18);
  box-shadow:0 30px 90px rgba(0,0,0,.70);
  padding:12px 14px 14px;
  backdrop-filter:blur(12px);
}
.modal-header{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  border-bottom:1px solid rgba(255,255,255,.14);
  padding-bottom:10px;
}
.modal-header h2{
  margin:0;
  font-size:15px;
  font-weight:900;
}
.modal-close{
  border:none;
  background:transparent;
  color:var(--muted);
  font-size:22px;
  cursor:pointer;
}
.modal-body{
  padding-top:10px;
}
.modal-subtitle{
  margin:0 0 12px;
  font-size:13px;
  color:var(--muted);
}
.select-wrap{
  position:relative;
}
.select-wrap::after{
  content:"▾";
  position:absolute;
  right:12px;
  top:50%;
  transform:translateY(-50%);
  font-size:12px;
  color:var(--muted);
  pointer-events:none;
}
.btn-block{
  width:100%;
  margin-top:16px;
}
.modal-footer-info{
  margin-top:16px;
  font-size:12px;
  color:var(--muted);
}

/* SCENE RANGE BLOCK (hasil) -> dibuat seperti card/field style-1 */
.scene-list-title{
  font-size:14px;
  font-weight:700;
  margin:10px 0 10px;
  color:rgba(255,255,255,.92);
}

.scene-block{
  border:1px solid var(--border-soft);
  border-radius:16px;
  background:
    radial-gradient(400px 200px at 20% 20%, rgba(34,211,238,.16), transparent 60%),
    radial-gradient(400px 200px at 90% 30%, rgba(167,139,250,.14), transparent 60%),
    rgba(255,255,255,.05);
  box-shadow:0 14px 34px rgba(0,0,0,.55);
  padding:10px 10px 12px;
  margin-bottom:12px;

  height:210px;
  overflow:hidden;
}

.scene-block-head{
  margin-bottom:8px;
}

.scene-block-title{
  font-size:12px;
  color:rgba(255,255,255,.70);
}

.scene-block-body{
  display:flex;
  gap:12px;
  align-items:stretch;
  height:calc(100% - 24px);
}

/* TEXTAREA block hasil */
.scene-block-textarea{
  flex:1;
  width:100%;
  resize:none;
  height:100%;
  background:rgba(2,6,23,.96);
  border:1px solid var(--border-soft);
  border-radius:14px;
  padding:10px 12px;
  color:var(--text);
  font-size:13px;
  line-height:1.4;
  outline:none;

  overflow-y:auto;
  -ms-overflow-style:none;
  scrollbar-width:none;
}
.scene-block-textarea::-webkit-scrollbar{display:none;}
.scene-block-textarea:focus{
  border-color:rgba(34,211,238,.55);
  box-shadow:0 0 0 3px rgba(34,211,238,.16);
}

/* Kolom tombol */
.scene-block-actions{
  width:88px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:8px;
}

.scene-copy-hint{
  font-size:12px;
  color:rgba(205,255,241,.95);
}

/* Responsif */
@media (max-width:720px){
  .scene-block{
    height:auto;
  }
  .scene-block-body{
    flex-direction:column;
    height:auto;
  }
  .scene-block-actions{
    width:auto;
    align-items:stretch;
    justify-content:flex-start;
  }
}

/* RESPONSIVE tambahan dari style-1 */
@media (max-width:720px){
  .hero-inner{padding-top:18px;}
  .hero-title{font-size:16px;letter-spacing:.18em;}
}
/* =========================
   FIX: hasil tidak memanjang
   ========================= */

/* TOOL 1: pastikan setiap blok punya tinggi tetap + scroll hanya di textarea */
.scene-block{
  height:210px;        /* sudah ada; pastikan tetap */
  overflow:hidden;     /* parent jangan ikut scroll besar */
}

.scene-block-body{
  height:calc(100% - 24px); /* sudah ada; memastikan textarea dapat ruang */
  min-height:0;             /* penting untuk flex agar child boleh scroll */
}

.scene-block-textarea{
  height:100%;
  overflow:auto;      /* scroll di dalam */
  min-height:0;       /* penting: tanpa ini kadang tetap ngedorong parent */
}

/* TOOL 2: output JSON jangan memperpanjang halaman */
.output-box{
  max-height:380px;   /* sudah ada, tapi dipastikan berlaku */
  overflow:auto;      /* scroll di dalam */
}

/* BONUS: jika output-box berada dalam flex container, ini membantu */
.field, .tool-body{
  min-height:0;
}

/* =========================
   FIX: LOADING OVERLAY (SIMPLE + TUNGGU + DURASI)
   =========================
   Ini menyatukan semua versi overlay jadi 1 (biar tidak saling timpa). [file:1]
*/

#loadingOverlay{
  display:none; /* tetap dikontrol JS di index.php [file:1] */
  position:fixed;
  inset:0;
  z-index:9999;
  background: rgba(3,6,20,.55);
  backdrop-filter: blur(8px);
}

#loadingOverlay .simple-loader{
  position:absolute;
  left:50%;
  top:50%;
  transform: translate(-50%,-50%);
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:10px;
  color: rgba(238,242,255,.90);
}

#loadingOverlay .spinner{
  width:46px;
  height:46px;
  border-radius:50%;
  border:3px solid rgba(255,255,255,.18);
  border-top-color: rgba(34,211,238,.95);
  animation: spin .9s linear infinite;
  box-shadow: 0 0 18px rgba(34,211,238,.18);
}

#loadingOverlay .loader-text{
  font-size:12px;
  font-weight:900;
  letter-spacing:.12em;
  text-transform: uppercase;
  opacity:.88;
}

#loadingOverlay .loader-time{
  font-size:12px;
  color: rgba(238,242,255,.78);
  letter-spacing:.06em;
}

#loadingOverlay #loadingTimer{
  font-weight:900;
  color: rgba(34,211,238,.95);
}

@keyframes spin{
  to{ transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce){
  #loadingOverlay .spinner{ animation:none !important; }
}

/* Hilangkan semua scrollbar (global) */

/* Firefox */
* {
  scrollbar-width: none;
}

/* IE / Edge lama */
* {
  -ms-overflow-style: none;
}

/* Chrome, Safari, Opera */
*::-webkit-scrollbar {
  width: 0;
  height: 0;
}

/* =========================
   HOME VIDEO (16:9 LANDSCAPE, KECIL + CENTER)
   ========================= */
.home-video-wrap{
  position:relative;
  width:100%;
  max-width:640px;      /* kecilkan di sini: 560/600/640 */
  margin:0 auto;        /* center di dalam card */
  aspect-ratio:16 / 9;  /* pastikan bentuk persegi panjang 16:9 */
  border-radius:14px;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.08);
  background:rgba(0,0,0,.25);
}

.home-video-wrap iframe{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  border:0;
}

@media (max-width:760px){
  .home-video-wrap{
    max-width:100%;
  }
}
