/* Creator Eai · Studio Video AI — style.css */
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: #09090b;
  color: #f4f4f5;
  -webkit-tap-highlight-color: transparent;
}
/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #18181b; }
::-webkit-scrollbar-thumb { background: #3f3f46; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #D4AF37; }
.gold-glow { box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.65), 0 8px 28px -8px rgba(212, 175, 55, 0.25); }
.studio-card { background: linear-gradient(180deg, rgba(24,24,27,0.92), rgba(15,15,19,0.96)); border: 1px solid rgba(63,63,70,0.65); }
.timeline-handle { touch-action: none; }

/* Animasi spinner untuk tombol busy */
@keyframes spin { to { transform: rotate(360deg); } }
.animate-spin { animation: spin 1s linear infinite; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
.animate-ping { animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }
@keyframes ping { 75%, 100% { transform: scale(2); opacity: 0; } }

/* Range slider accent */
input[type="range"] { accent-color: #D4AF37; }

/* Line clamp fallback */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Cegah geser horizontal tanpa merusak position: sticky (overflow-x: hidden
   pada body bisa mematikan sticky di beberapa browser mobile). */
html, body { overflow-x: clip; }
@supports not (overflow-x: clip) { html, body { overflow-x: hidden; } }

/* Toolbar scene: beri ruang supaya kartu pertama tidak tertutup saat sticky */
#animAturToolbar { will-change: transform; }

/* ===== Slider studio (volume, subtitle, logo) ===== */
input[type="range"].studio-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 18px;
  background: transparent;
  cursor: pointer;
}
input[type="range"].studio-range::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(212,175,55,0.85), rgba(212,175,55,0.35));
}
input[type="range"].studio-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -4.5px;
  border-radius: 50%;
  background: #F7E396;
  border: 2px solid #09090b;
  box-shadow: 0 0 0 1px rgba(212,175,55,0.9), 0 2px 6px rgba(0,0,0,0.55);
}
input[type="range"].studio-range::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(212,175,55,0.85), rgba(212,175,55,0.35));
}
input[type="range"].studio-range::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #F7E396;
  border: 2px solid #09090b;
  box-shadow: 0 0 0 1px rgba(212,175,55,0.9);
}
input[type="range"].studio-range:focus { outline: none; }
input[type="range"].studio-range:focus-visible { outline: 2px solid rgba(212,175,55,0.6); outline-offset: 2px; border-radius: 999px; }

/* Cegah slider meluber dari kotaknya di layar sempit */
#suaraSinkronPane input[type="range"],
#kontenEksporPanel input[type="range"] { min-width: 0; max-width: 100%; }

/* ===== Bottom sheet pilihan (pengganti dropdown <select>) ===== */
@keyframes sheetUp {
  from { transform: translateY(100%); opacity: .6; }
  to   { transform: translateY(0);    opacity: 1; }
}
@keyframes sheetFade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
#optionSheetCard.sheet-in { animation: sheetUp .26s cubic-bezier(.22,1,.36,1) both; }
@media (min-width: 640px) {
  #optionSheetCard.sheet-in { animation: sheetFade .18s ease-out both; }
}
.option-sheet-row {
  display: flex; align-items: flex-start; gap: .7rem; width: 100%; text-align: left;
  padding: .72rem .8rem; border-radius: 1rem; border: 1px solid transparent;
  background: transparent; color: inherit; cursor: pointer; transition: background .16s, border-color .16s;
}
.option-sheet-row:hover { background: rgba(255,255,255,.05); }
.option-sheet-row[aria-selected="true"] {
  background: rgba(249,115,22,.12);
  border-color: rgba(249,115,22,.42);
}
.option-sheet-ico { font-size: 1.35rem; line-height: 1.1; flex: 0 0 auto; }
.option-sheet-name { display: block; font-size: .9rem; font-weight: 800; color: #f4f4f5; }
.option-sheet-row[aria-selected="true"] .option-sheet-name { color: #FDBA74; }
.option-sheet-desc { display: block; font-size: .72rem; line-height: 1.35; color: #a1a1aa; margin-top: .1rem; }

/* ===== Hero pratinjau gaya (animasi) di sheet "Pilih gaya video" ===== */
#styleHero { position: relative; background: #09090b; perspective: 620px; }
#styleHeroArt { position: absolute; inset: 0; overflow: hidden; }
.sa-stage { position: absolute; inset: 0; }
.sa-bg { position: absolute; inset: 0; }
.sa-grain {
  position: absolute; inset: 0; opacity: .38; pointer-events: none;
  background-image: radial-gradient(rgba(255,255,255,.55) .7px, transparent .8px);
  background-size: 9px 9px;
}
.sa-bit { position: absolute; will-change: transform, opacity; }
.sa-float { animation: saFloat 5.4s ease-in-out infinite; }
.sa-swing { animation: saSwing 4.2s ease-in-out infinite; transform-origin: 50% 60%; }
.sa-pulse { animation: saPulse 3.6s ease-in-out infinite; }
.sa-spin  { animation: saSpin 14s linear infinite; }
.sa-drift { animation: saDrift 6.2s ease-in-out infinite; }
.sa-rise  { animation: saRise 4.6s ease-in-out infinite; }
.sa-tilt  { animation: saTilt 5.8s ease-in-out infinite; transform-style: preserve-3d; }
.sa-slab  { border-radius: 8px; box-shadow: 0 8px 18px -8px rgba(0,0,0,.75), inset 0 1px 0 rgba(255,255,255,.35); }
.sa-glow  { box-shadow: 0 0 16px currentColor, 0 0 34px currentColor; }
.sa-sub {
  position: absolute; left: 0; right: 0; bottom: 34px; display: flex; justify-content: center; gap: .34em;
  font-weight: 900; font-size: 13px; letter-spacing: .01em; color: #FAF6EB; text-shadow: 0 2px 10px rgba(0,0,0,.85);
  animation: saSubIn 6s ease-in-out infinite;
}
.sa-sub b { background: #F97316; color: #fff; padding: 1px 6px; border-radius: 5px; }
.sa-bar { position: absolute; left: 14px; right: 14px; bottom: 14px; height: 5px; border-radius: 99px; background: rgba(255,255,255,.22); overflow: hidden; }
.sa-bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: #fff; animation: saBar 6s linear infinite; }
#stylePickerModal.sa-paused .sa-bit,
#stylePickerModal.sa-paused .sa-sub,
#stylePickerModal.sa-paused .sa-bar i { animation-play-state: paused; }
@keyframes saFloat { 0%,100% { transform: translateY(-8px); } 50% { transform: translateY(8px); } }
@keyframes saSwing { 0%,100% { transform: rotate(-7deg); } 50% { transform: rotate(7deg); } }
@keyframes saPulse { 0%,100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes saSpin  { to { transform: rotate(360deg); } }
@keyframes saDrift { 0%,100% { transform: translateX(-9px); } 50% { transform: translateX(9px); } }
@keyframes saRise  { 0% { transform: translateY(10px); opacity: 0; } 25% { opacity: .9; } 70%,100% { transform: translateY(-26px); opacity: 0; } }
@keyframes saTilt  { 0%,100% { transform: rotateY(-16deg) rotateX(6deg); } 50% { transform: rotateY(16deg) rotateX(-6deg); } }
@keyframes saBar   { 0% { width: 0; } 92%,100% { width: 100%; } }
@keyframes saSubIn { 0%,8% { opacity: 0; transform: translateY(8px); } 18%,82% { opacity: 1; transform: translateY(0); } 92%,100% { opacity: 0; transform: translateY(-6px); } }

/* kotak pilih posisi logo */
.logo-pos-btn { display: flex; align-items: center; justify-content: center; height: 30px; border-radius: 9px; border: 1px solid #27272a; background: #09090b; color: #71717a; transition: all .15s; }
.logo-pos-btn:hover { border-color: #52525b; color: #d4d4d8; }
.logo-pos-btn.on { background: rgba(212,175,55,.18); border-color: rgba(212,175,55,.7); color: #F7E396; }
.logo-pos-btn i { display: block; width: 12px; height: 8px; border-radius: 2px; background: currentColor; opacity: .95; }

/* ===== Storyboard 3 scene di pratinjau gaya (bikin contoh gayanya kerasa kayak video) ===== */
#styleHeroArt { position: absolute; inset: 0; }
.sa-stage { position: absolute; inset: 0; }
.sa-bg { position: absolute; inset: -10%; }
.sa-bits { position: absolute; inset: 0; transition: transform .42s cubic-bezier(.22,1,.36,1), opacity .42s ease; }
.sa-grain { position: absolute; inset: 0; opacity: .16; pointer-events: none;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.35) 0 1px, transparent 1px 3px); }
.sa-scene { position: absolute; inset: 0; animation: saSceneIn .38s ease both; }
@keyframes saSceneIn { from { opacity: 0; } to { opacity: 1; } }
.sa-scene.sa-v1 .sa-bits { transform: none; }
.sa-scene.sa-v2 .sa-bits { transform: scale(.82) translateY(-9%) translateX(-4%); }
.sa-scene.sa-v3 .sa-bits { transform: scale(.52) translateY(-26%); }

.sa-top { position: absolute; top: 5px; left: 5px; right: 5px; display: flex; align-items: center; justify-content: space-between; gap: 4px;
  font-size: 7.5px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; line-height: 1; }
.sa-tag { background: rgba(0,0,0,.45); border: 1px solid rgba(255,255,255,.24); color: #fff; padding: 3px 6px; border-radius: 99px; white-space: nowrap; }
.sa-tag.hot { background: rgba(249,115,22,.92); border-color: transparent; }

.sa-cap { position: absolute; left: 6%; right: 6%; bottom: 9%; text-align: center; font-weight: 900; line-height: 1.18;
  color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.6); animation: saCapIn .42s cubic-bezier(.22,1,.36,1) both; }
@keyframes saCapIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.sa-cap.lg { font-size: clamp(13px, 4.6vw, 19px); }
.sa-cap.sm { font-size: clamp(10px, 3.2vw, 13px); bottom: 13%; }
.sa-cap b { color: #FDE68A; background: rgba(0,0,0,.3); padding: 0 .2em; border-radius: .3em; }
.sa-cap i { display: block; font-style: normal; font-size: .62em; font-weight: 800; opacity: .8; margin-top: 3px; letter-spacing: .04em; }

.sa-bullets { position: absolute; left: 9%; right: 14%; top: 42%; display: flex; flex-direction: column; gap: 6px; }
.sa-bullets i { display: block; height: 5px; border-radius: 99px; background: rgba(255,255,255,.8); transform-origin: left center;
  animation: saGrow .45s cubic-bezier(.22,1,.36,1) both; }
.sa-bullets i:nth-child(2) { width: 84%; animation-delay: .1s; background: rgba(255,255,255,.62); }
.sa-bullets i:nth-child(3) { width: 64%; animation-delay: .2s; background: rgba(255,255,255,.45); }
@keyframes saGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.sa-endcard { position: absolute; left: 8%; right: 8%; top: 52%; text-align: center; color: #fff;
  animation: saCapIn .44s cubic-bezier(.22,1,.36,1) both; }
.sa-endcard strong { display: block; font-size: clamp(10px, 3.4vw, 13px); font-weight: 900; }
.sa-endcard em { display: inline-flex; align-items: center; gap: 3px; margin-top: 5px; font-style: normal; font-size: 8px; font-weight: 900;
  padding: 3px 8px; border-radius: 99px; background: rgba(255,255,255,.92); color: #09090b; }
.sa-segs { position: absolute; left: 6px; right: 6px; bottom: 5px; display: flex; gap: 3px; }
.sa-segs i { position: relative; flex: 1; height: 3px; border-radius: 99px; background: rgba(255,255,255,.3); overflow: hidden; }
.sa-segs i b { position: absolute; inset: 0; display: block; width: 0; background: #fff; }
.sa-segs i.done b { width: 100%; }
.sa-segs i.now b { animation: saSegFill 2.4s linear forwards; }
@keyframes saSegFill { from { width: 0; } to { width: 100%; } }
#stylePickerModal.sa-paused .sa-scene, #stylePickerModal.sa-paused .sa-cap, #stylePickerModal.sa-paused .sa-endcard,
#stylePickerModal.sa-paused .sa-bullets i, #stylePickerModal.sa-paused .sa-segs i.now b,
#stylePickerModal.sa-paused .sa-bit { animation-play-state: paused; }

/* tab 3 scene di bawah pratinjau */
.sa-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.sa-tab { flex: 1 1 auto; min-width: 26px; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 5px 3px; border-radius: 8px;
  border: 1px solid #3f3f46; background: #18181b; color: #a1a1aa; font-size: 8.5px; font-weight: 900; letter-spacing: .03em;
  text-transform: uppercase; line-height: 1; cursor: pointer; transition: all .15s; }
.sa-tab:hover { color: #fff; border-color: #52525b; }
.sa-tab.on { background: rgba(249,115,22,.16); border-color: rgba(249,115,22,.75); color: #FDBA74; }
.sa-tab em { font-style: normal; opacity: .65; }

/* ===== Pratinjau canvas (Scribble 3D) ===== */
#styleHeroArt canvas { display: block; width: 100%; height: 100%; }
#styleHeroArt .sa-overlay { position: absolute; inset: 0; pointer-events: none; }
.sa-playbadge { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 46px; height: 46px;
  border-radius: 999px; background: rgba(9,9,11,.62); border: 2px solid rgba(255,255,255,.75); color: #fff;
  display: flex; align-items: center; justify-content: center; pointer-events: none; }
#stylePickerModal:not(.sa-paused) .sa-playbadge { display: none; }
.sa-scene.sa-v3 .sa-bits { transform: scale(.9) translateX(-6%); }
.sa-scene.sa-v4 .sa-bits { transform: scale(.52) translateY(-26%); }
.sa-streaks { position: absolute; left: 52%; right: 8%; top: 38%; display: flex; flex-direction: column; gap: 7px; }
.sa-streaks i { display: block; height: 4px; border-radius: 99px; background: rgba(255,255,255,.85);
  animation: saStreak .6s linear infinite; }
.sa-streaks i:nth-child(2) { width: 72%; animation-delay: .12s; background: rgba(255,255,255,.6); }
.sa-streaks i:nth-child(3) { width: 52%; animation-delay: .24s; background: rgba(255,255,255,.4); }
@keyframes saStreak { from { transform: translateX(26%); opacity: 0; } 40% { opacity: 1; } to { transform: translateX(-18%); opacity: 0; } }

/* ===== Progress tunggal (lurus, satu bar penuh untuk seluruh klip) ===== */
.sa-progress { position: absolute; left: 6px; right: 6px; bottom: 5px; height: 3px; border-radius: 99px;
  background: rgba(255,255,255,.28); overflow: hidden; pointer-events: none; }
.sa-progress i { display: block; height: 100%; width: 0%; background: #fff; border-radius: 99px; transition: width .12s linear; }
