/**
 * Visit Jawa Tengah — Floating Pill Toggle Switch Splash Screen CSS
 * Persis 4 Tahap Storyboard: Klik Sakelar -> Transisi Sakelar -> Gelombang Gelap -> Sinema
 */

:root {
  --vj-navy-dark: #071226;
  --vj-navy-deep: #050C1A;
  --vj-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --vj-ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
}

#vj-splash-screen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  background-color: #FFFFFF;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

#vj-splash-screen.vj-splash-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* =========================================================
   1. GELOMBANG GELAP MENYEBAR (PANEL 3: SPOTLIGHT SHROUD)
   ========================================================= */
/*
  Di Panel 3, warna biru gelap menyebar dari luar ke dalam (atau menutup layar 
  sambil menyisakan lingkaran cahaya lembut di sekitar logo sebelum akhirnya gelap penuh di Panel 4).
*/
.vj-dark-shroud {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(
    circle at 50% 52%,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.05) 18%,
    rgba(7, 18, 38, 0.92) 38%,
    var(--vj-navy-dark) 52%
  );
  transform: scale(2.6);
  transition: transform 0.75s var(--vj-ease-smooth), opacity 0.4s ease, background 0.45s ease;
}

/* Tahap Panel 3: Gelombang Gelap mengecil mengurung logo di tengah */
#vj-splash-screen.stage-wave .vj-dark-shroud {
  opacity: 1;
  transform: scale(1);
}

/* Tahap Panel 4: Layar sepenuhnya menjadi biru tua pekat */
#vj-splash-screen.stage-cinema .vj-dark-shroud {
  opacity: 1;
  transform: scale(1);
  background: var(--vj-navy-dark);
}

/* =========================================================
   2. FLOATING PILL TOGGLE SWITCH (ATAS TENGAH)
   ========================================================= */
.vj-toggle-rig {
  position: absolute;
  top: 14%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Track Kapsul (Pill) */
.vj-toggle-pill {
  width: 96px;
  height: 46px;
  border-radius: 999px;
  background: linear-gradient(180deg, #E2E8F0 0%, #F1F5F9 100%);
  box-shadow: 
    inset 0 2px 5px rgba(15, 23, 42, 0.12),
    0 6px 20px rgba(15, 23, 42, 0.08);
  padding: 5px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 5;
  transition: background 0.45s ease, box-shadow 0.45s ease;
}

/* Saat sakelar digeser ke kanan (Panel 2) */
#vj-splash-screen.stage-switched .vj-toggle-pill {
  background: #FFFBEB;
  box-shadow: 
    inset 0 2px 6px rgba(245, 158, 11, 0.2),
    0 0 25px rgba(251, 191, 36, 0.35);
}

/* Saat masuk mode Gelap (Panel 3 & 4) */
#vj-splash-screen.stage-wave .vj-toggle-pill,
#vj-splash-screen.stage-cinema .vj-toggle-pill {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: 
    inset 0 2px 6px rgba(0, 0, 0, 0.5),
    0 8px 24px rgba(0, 0, 0, 0.35);
}

/* Tombol Bulat (Knob) di dalam Kapsul */
.vj-toggle-knob {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  /* Panel 1: Warna Oranye-Kuning Matahari Bersinar */
  background: radial-gradient(circle at 35% 35%, #FDE047 0%, #F59E0B 65%, #EA580C 100%);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(0);
  transition: transform 0.48s var(--vj-ease-spring), background 0.4s ease, box-shadow 0.4s ease;
}

/* Knob Bergeser ke Kanan & Berubah Jadi Cokelat/Hitam Bulan Sabit (Panel 2, 3, 4) */
#vj-splash-screen.stage-switched .vj-toggle-knob,
#vj-splash-screen.stage-wave .vj-toggle-knob,
#vj-splash-screen.stage-cinema .vj-toggle-knob {
  transform: translateX(50px);
  background: radial-gradient(circle at 30% 30%, #451A03 0%, #1E1B18 100%);
  box-shadow: 0 0 16px rgba(251, 191, 36, 0.55);
}

/* Ikon Matahari & Bulan di dalam Knob */
.knob-icon {
  width: 20px;
  height: 20px;
  position: absolute;
  transition: opacity 0.3s ease, transform 0.4s var(--vj-ease-spring);
}

.icon-sun {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

.icon-moon {
  opacity: 0;
  transform: scale(0.4) rotate(-45deg);
}

#vj-splash-screen.stage-switched .icon-sun,
#vj-splash-screen.stage-wave .icon-sun,
#vj-splash-screen.stage-cinema .icon-sun {
  opacity: 0;
  transform: scale(0.4) rotate(90deg);
}

#vj-splash-screen.stage-switched .icon-moon,
#vj-splash-screen.stage-wave .icon-moon,
#vj-splash-screen.stage-cinema .icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0deg);
}

/* =========================================================
   3. EFEK CINCIN RIPPLE & PARTIKEL BINTANG EMAS (PANEL 2 & 3)
   ========================================================= */
.vj-toggle-rings {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.vj-toggle-rings .ring {
  position: absolute;
  border-radius: 50%;
  border: 1.2px solid rgba(245, 158, 11, 0.32);
  opacity: 0;
  transform: scale(0.5);
  transition: transform 0.65s var(--vj-ease-smooth), opacity 0.5s ease, border-color 0.4s ease;
}

.ring.r-1 { width: 120px; height: 120px; }
.ring.r-2 { width: 165px; height: 165px; transition-delay: 0.06s; }
.ring.r-3 { width: 215px; height: 215px; transition-delay: 0.12s; }

/* Muncul di Panel 2 & Panel 3 */
#vj-splash-screen.stage-switched .ring,
#vj-splash-screen.stage-wave .ring {
  opacity: 1;
  transform: scale(1);
}

#vj-splash-screen.stage-wave .ring {
  border-color: rgba(148, 163, 184, 0.2);
}

/* Hilang di Panel 4 */
#vj-splash-screen.stage-cinema .ring {
  opacity: 0;
  transform: scale(1.25);
}

/* Partikel Bintang Kecil di Sekitar Sakelar (Panel 2) */
.vj-toggle-sparkles {
  position: absolute;
  width: 220px;
  height: 220px;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.4s ease, transform 0.55s var(--vj-ease-spring);
}

#vj-splash-screen.stage-switched .vj-toggle-sparkles {
  opacity: 1;
  transform: scale(1);
}

.sparkle {
  position: absolute;
  color: #F59E0B;
  font-size: 13px;
  line-height: 1;
}

.s-1 { top: 12%; left: 48%; }
.s-2 { top: 24%; right: 14%; font-size: 16px; }
.s-3 { bottom: 18%; right: 20%; }
.s-4 { bottom: 12%; left: 45%; font-size: 16px; }
.s-5 { bottom: 24%; left: 14%; }
.s-6 { top: 22%; left: 18%; font-size: 16px; }

/* =========================================================
   4. LOGO VISIT JAWA TENGAH & TEKS (TENGAH LAYAR)
   ========================================================= */
.vj-splash-content {
  position: relative;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-top: 30px;
  text-align: center;
}

.vj-splash-logo-wrap {
  margin-bottom: 18px;
}

.vj-splash-logo {
  height: 155px;
  width: auto;
  object-fit: contain;
  transition: filter 0.45s ease, transform 0.45s ease;
}

/* 
  PERSIS PANEL 4 STORYBOARD:
  Saat layar penuh biru gelap (stage-cinema), seluruh logo & teks 
  "VISIT JAWA TENGAH" berubah menjadi siluet PUTIH BERSIH (Monokrom Putih)!
*/
#vj-splash-screen.stage-cinema .vj-splash-logo {
  filter: brightness(0) invert(1) drop-shadow(0 2px 12px rgba(255, 255, 255, 0.25));
}

.vj-splash-text {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16.5px;
  font-weight: 500;
  color: #1E293B;
  letter-spacing: 0.01em;
  transition: color 0.4s ease;
}

#vj-splash-screen.stage-cinema .vj-splash-text {
  color: #FFFFFF;
}

/* Loading Bar Minimalis (Hanya untuk Initial Load) */
.vj-splash-loader-bar {
  width: 190px;
  height: 3.5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
  margin-top: 18px;
  overflow: hidden;
  display: none;
}

.vj-splash-loader-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #F59E0B, #FDE047);
  transition: width 0.15s ease-out;
}

#vj-splash-screen.mode-initial .vj-splash-loader-bar {
  display: block;
}

@media (max-width: 640px) {
  .vj-splash-logo {
    height: 120px;
  }
  .vj-toggle-pill {
    width: 84px;
    height: 40px;
  }
  .vj-toggle-knob {
    width: 30px;
    height: 30px;
  }
  #vj-splash-screen.stage-switched .vj-toggle-knob,
  #vj-splash-screen.stage-wave .vj-toggle-knob,
  #vj-splash-screen.stage-cinema .vj-toggle-knob {
    transform: translateX(44px);
  }
}

/* Seamless Cinema Handover: fade-out toggle pill & logo (250ms), keep dark #071226 solid */
#vj-splash-screen.stage-handoff .vj-toggle-rig,
#vj-splash-screen.stage-handoff .vj-splash-content {
  opacity: 0 !important;
  transform: scale(0.96);
  transition: opacity 250ms ease, transform 250ms ease;
}
#vj-splash-screen.stage-handoff .vj-dark-shroud {
  opacity: 1 !important;
  transform: scale(1) !important;
  background: #071226 !important;
}
