/* ============================================================
   BAB 4 — FORM LANJUTAN & INTERAKSI DATA | Front End Masterclass Kelas 10
   Tema: LUXURY DARK — Navy + Cyan + Gold + Purple
   ============================================================ */

/* ---------- 1. VARIABLES & RESET ---------- */
:root {
  --navy:        #0A0A2E;
  --navy-2:      #12123f;
  --navy-3:      #1a1a55;
  --cyan:        #00F5FF;
  --gold:        #FFD700;
  --purple:      #7B2FBE;
  --purple-soft: #a86fe0;
  --text:        #e9ecff;
  --text-dim:    #9aa0c9;
  --glass:       rgba(255, 255, 255, 0.06);
  --glass-brd:   rgba(0, 245, 255, 0.25);
  --font-heading: 'Orbitron', 'Segoe UI', Arial, sans-serif;
  --font-body:    'Poppins', 'Segoe UI', Arial, sans-serif;
  --shadow-cyan:  0 0 18px rgba(0, 245, 255, 0.55);
  --shadow-gold:  0 0 18px rgba(255, 215, 0, 0.55);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
  height: 100%;
  width: 100%;
}
body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--navy);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

/* ---- LAYOUT WRAPPER (paling reliable untuk footer) ---- */
#app-layout {
  position: fixed;
  inset: 0;                     /* top:0 right:0 bottom:0 left:0 */
  display: flex;
  flex-direction: column;
  z-index: 1;
}

/* Animated deep-space gradient base */
body {
  background:
    radial-gradient(circle at 15% 20%, rgba(123,47,190,0.25), transparent 40%),
    radial-gradient(circle at 85% 75%, rgba(0,245,255,0.18), transparent 42%),
    linear-gradient(135deg, #06061d 0%, var(--navy) 55%, #050518 100%);
}

/* Particle canvas behind everything */
#particle-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---------- 2. SLIDE SYSTEM ---------- */
.slide-container {
  position: relative;
  flex: 1 1 0;       /* ambil semua ruang kecuali nav-bar */
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

.slide {
  display: none;
  position: absolute;
  inset: 0;
  height: 100%;
  width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 5vw 30px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  cursor: pointer;
  scrollbar-width: thin;
  scrollbar-color: var(--cyan) transparent;
}
.slide input, .slide textarea, .slide select, .slide iframe, .demo-frame, .code-block {
  cursor: auto;
}
.slide button, .slide a, .side-nav, .eco-toggle, .btn-nav {
  cursor: pointer;
}

.slide::-webkit-scrollbar { width: 8px; }
.slide::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--cyan), var(--purple));
  border-radius: 10px;
}
.slide.active {
  display: flex !important;
  animation: slideIn .5s ease both;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px) scale(.99); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Slide badge (number / topic) */
.slide-badge {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: .72rem;
  letter-spacing: 3px;
  color: var(--navy);
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  padding: 6px 18px;
  border-radius: 30px;
  margin: 0 auto 16px;
  font-weight: 700;
  box-shadow: var(--shadow-cyan);
  text-align: center;
}

/* ---------- 3. TYPOGRAPHY ---------- */
h1, h2, h3 { font-family: var(--font-heading); line-height: 1.25; text-align: center; }

.slide h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  color: #fff;
  text-align: center;
  text-shadow: 0 0 12px var(--cyan), 0 0 28px rgba(0,245,255,.4);
}
.slide h2 {
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  color: var(--cyan);
  text-align: center;
  margin-bottom: 8px;
  text-shadow: 0 0 14px rgba(0,245,255,.5);
}
.slide h3 { font-size: 1.15rem; color: var(--gold); margin-bottom: 10px; text-align: left; }

.subtitle {
  color: var(--text-dim);
  text-align: center;
  font-size: clamp(.9rem, 1.5vw, 1.1rem);
  margin: 0 auto 22px;
  max-width: 760px;
}
.lead { font-size: 1rem; line-height: 1.65; color: var(--text); }
.gold { color: var(--gold); font-weight: 600; }
.cyan { color: var(--cyan); font-weight: 600; }
.purple { color: var(--purple-soft); font-weight: 600; }

/* ---------- 4. GLASS CARDS / GRID ---------- */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-brd);
  border-radius: 18px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 32px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.08);
  padding: 20px 24px;
}

.content-wrap {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}
.content-wrap.center { text-align: center; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; width: 100%; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; width: 100%; }
@media (max-width: 980px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.info-card { transition: transform .3s, box-shadow .3s; }
.info-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 40px rgba(0,245,255,.25);
  border-color: var(--cyan);
}
.info-card .ic-icon {
  font-size: 2rem; color: var(--gold);
  margin-bottom: 10px; display: block;
  filter: drop-shadow(0 0 8px rgba(255,215,0,.6));
}

ul.feat { list-style: none; line-height: 1.9; text-align: left; }
ul.feat li::before { content: '▸ '; color: var(--cyan); font-weight: 700; }

/* ---------- 5. CODE BLOCKS ---------- */
.code-block {
  background: #07071c;
  border: 1px solid rgba(0,245,255,.22);
  border-radius: 14px;
  padding: 14px 16px;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: .83rem;
  line-height: 1.55;
  color: #d6e7ff;
  overflow-x: auto;
  white-space: pre;
  position: relative;
  text-align: left;
  box-shadow: inset 0 0 22px rgba(0,245,255,.06);
}
.code-block::before {
  content: '</> HTML';
  position: absolute; top: 0; right: 0;
  background: var(--purple); color: #fff;
  font-family: var(--font-heading); font-size: .6rem;
  padding: 3px 10px; border-radius: 0 14px 0 10px; letter-spacing: 1px;
}
.tag  { color: #ff79c6; }
.atr  { color: var(--gold); }
.val  { color: #7CFC9B; }
.cmt  { color: #6272a4; font-style: italic; }

/* ---------- 6. LIVE DEMO ---------- */
.demo-frame {
  width: 100%;
  min-height: 240px;
  border: 2px solid var(--gold);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-gold);
}
.demo-label {
  font-family: var(--font-heading);
  font-size: .7rem; letter-spacing: 2px;
  color: var(--gold); margin-bottom: 8px; display: block; text-align: left;
}

/* ---------- 7. SIDE FLOATING NAV BUTTONS (INFINITE ACTIVE) ---------- */
.side-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 999999 !important;
  width: 58px;
  height: 72px;
  background: rgba(0, 245, 255, 0.25) !important;
  border: 2px solid var(--cyan) !important;
  color: var(--cyan) !important;
  border-radius: 16px;
  font-size: 2rem;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all .25s ease;
  box-shadow: 0 0 24px rgba(0, 245, 255, 0.5) !important;
  opacity: 1 !important;
}
.side-prev { left: 24px; }
.side-next { right: 24px; }
.side-nav:hover {
  background: var(--cyan) !important;
  color: var(--navy) !important;
  box-shadow: 0 0 36px var(--cyan) !important;
  transform: translateY(-50%) scale(1.14);
}
.side-nav:active {
  transform: translateY(-50%) scale(0.95);
}
@media (max-width: 768px) {
  .side-nav { width: 44px; height: 54px; font-size: 1.3rem; }
  .side-prev { left: 8px; }
  .side-next { right: 8px; }
}

/* ---------- 8. FOOTER NAVIGATION BAR ---------- */
.nav-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #060618;
  border-top: 2px solid var(--cyan);
  box-shadow: 0 -4px 24px rgba(0, 245, 255, 0.5);
  height: 62px;
  width: 100%;
  z-index: 9999;
}
.btn-nav {
  font-family: var(--font-heading);
  font-size: .8rem; font-weight: 700; letter-spacing: 1px;
  color: var(--navy);
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  border: none; cursor: pointer;
  padding: 10px 22px; border-radius: 30px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform .2s, box-shadow .2s, opacity .2s;
  box-shadow: 0 0 16px rgba(0,245,255,.4);
  white-space: nowrap;
  opacity: 1 !important;
}
.btn-nav:hover { transform: scale(1.06); box-shadow: 0 0 24px var(--cyan); }
.btn-nav:active { transform: scale(0.95); }

.nav-centre {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.page-label {
  font-family: var(--font-heading);
  font-size: .78rem;
  color: var(--text-dim);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.page-label span#current {
  color: var(--cyan);
  font-size: 1.4rem;
  font-weight: 900;
  text-shadow: 0 0 12px var(--cyan);
}
.page-label span#total {
  color: var(--gold);
  font-size: 1rem;
  font-weight: 700;
}

.nav-prog-track {
  width: 160px; height: 4px;
  background: rgba(255,255,255,.15);
  border-radius: 4px; overflow: hidden;
}
.nav-prog-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  border-radius: 4px;
  transition: width .4s ease;
}

.dots { display: none !important; }

/* Top progress bar */
.progress-track {
  position: fixed; top: 0; left: 0; right: 0; height: 4px;
  background: rgba(255,255,255,.08); z-index: 60;
}
.progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, var(--cyan), var(--gold));
  box-shadow: var(--shadow-cyan);
  transition: width .4s ease;
}

/* Eco mode toggle */
.eco-toggle {
  position: fixed; top: 14px; right: 18px; z-index: 60;
  font-family: var(--font-heading); font-size: .65rem; letter-spacing: 1px;
  background: var(--glass); border: 1px solid var(--glass-brd);
  color: var(--cyan); padding: 7px 13px; border-radius: 20px; cursor: pointer;
  backdrop-filter: blur(8px); transition: .2s;
}
.eco-toggle:hover { border-color: var(--gold); color: var(--gold); }

/* ============================================================
   9. KEYFRAME ANIMATIONS & 3D CUBE
   ============================================================ */
@keyframes fadeInUp { from{opacity:0;transform:translateY(28px)} to{opacity:1;transform:translateY(0)} }
.anim-up { animation: fadeInUp .7s ease both; }
.d1{animation-delay:.1s}.d2{animation-delay:.25s}.d3{animation-delay:.4s}
.d4{animation-delay:.55s}.d5{animation-delay:.7s}.d6{animation-delay:.85s}

@keyframes neonPulse {
  0%,100% { text-shadow: 0 0 10px var(--cyan), 0 0 22px rgba(0,245,255,.5); }
  50%     { text-shadow: 0 0 20px var(--gold), 0 0 40px rgba(255,215,0,.7); }
}
.neon-pulse { animation: neonPulse 2.4s ease-in-out infinite; }

@keyframes float3D {
  0%,100% { transform: translateY(0) rotateX(0) rotateY(0); }
  50%     { transform: translateY(-12px) rotateX(6deg) rotateY(6deg); }
}
.float3d { animation: float3D 5s ease-in-out infinite; will-change: transform; }

/* ---------- CSS 3D CUBE ---------- */
.cube-scene { width: 140px; height: 140px; perspective: 800px; margin: 10px auto 18px; }
.cube {
  width: 100%; height: 100%; position: relative;
  transform-style: preserve-3d;
  animation: cubeSpin 12s linear infinite;
  will-change: transform;
}
@keyframes cubeSpin {
  from { transform: rotateX(0) rotateY(0); }
  to   { transform: rotateX(360deg) rotateY(360deg); }
}
.cube .face {
  position: absolute; width: 140px; height: 140px;
  border: 2px solid var(--cyan);
  background: rgba(0,245,255,.08);
  box-shadow: 0 0 20px rgba(0,245,255,.45) inset, 0 0 14px rgba(0,245,255,.35);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-size: 1.5rem; color: var(--gold);
  text-shadow: var(--shadow-gold);
}
.cube .front  { transform: translateZ(70px); }
.cube .back   { transform: rotateY(180deg) translateZ(70px); }
.cube .right  { transform: rotateY(90deg) translateZ(70px); border-color: var(--gold); }
.cube .left   { transform: rotateY(-90deg) translateZ(70px); border-color: var(--gold); }
.cube .top    { transform: rotateX(90deg) translateZ(70px); border-color: var(--purple-soft); }
.cube .bottom { transform: rotateX(-90deg) translateZ(70px); border-color: var(--purple-soft); }

/* Cover */
.cover-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3.6rem);
  background: linear-gradient(90deg, var(--cyan), var(--gold), var(--purple-soft));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  text-align: center; letter-spacing: 3px;
}
.cover-sub {
  font-family: var(--font-heading); letter-spacing: 3px;
  color: var(--text-dim); margin-top: 10px; text-align: center;
  font-size: clamp(.78rem, 1.8vw, 1rem);
}
.typewriter {
  border-right: 3px solid var(--cyan);
  white-space: nowrap; overflow: hidden;
  margin: 14px auto 0; max-width: max-content;
  animation: typing 3s steps(34) 1, caret .8s step-end infinite;
}
@keyframes typing { from{width:0} to{width:100%} }
@keyframes caret  { 50%{border-color:transparent} }

/* ---------- Mindmap ---------- */
.mindmap { width: 100%; max-width: 900px; }
.mm-node {
  opacity: 0; animation: fadeInUp .6s ease forwards;
  fill: var(--glass);
}
.mm-line { stroke: var(--cyan); stroke-width: 2; opacity: 0;
  animation: drawLine .8s ease forwards; stroke-dasharray: 300; stroke-dashoffset: 300; }
@keyframes drawLine { to { opacity:1; stroke-dashoffset: 0; } }

/* ---------- Checkmark sequence ---------- */
.check-item { display:flex; align-items:center; gap:12px; margin:8px 0; font-size:1rem; text-align:left; }
.check-box {
  width: 24px; height: 24px; border:2px solid var(--gold); border-radius:6px;
  display:flex; align-items:center; justify-content:center; color:var(--gold); flex-shrink:0;
}

/* ---------- Wireframe blocks ---------- */
.wireframe { width: 100%; max-width: 440px; margin: 0 auto; }
.wf-block {
  border: 2px dashed var(--cyan); border-radius: 10px;
  padding: 12px; margin: 8px 0; text-align: center;
  font-family: var(--font-heading); font-size: .78rem; letter-spacing: 1px;
  color: var(--text); background: rgba(0,245,255,.05);
  opacity: 0; animation: blockDrop .6s ease forwards;
}
.wf-block.hero  { background: rgba(123,47,190,.18); border-color: var(--purple-soft); color: var(--purple-soft); padding: 22px 12px; }
.wf-block.cta   { background: rgba(255,215,0,.12); border-color: var(--gold); color: var(--gold); }
@keyframes blockDrop { from{opacity:0;transform:translateY(-18px)} to{opacity:1;transform:translateY(0)} }

/* ---------- Task slides ---------- */
.task-hero {
  background: linear-gradient(135deg, rgba(123,47,190,.3), rgba(0,245,255,.12));
  border: 1px solid var(--gold);
}
.badge-task {
  display:inline-block; font-family:var(--font-heading);
  background: var(--gold); color: var(--navy);
  padding: 5px 16px; border-radius: 20px; font-size:.78rem;
  letter-spacing:2px; margin-bottom:10px; box-shadow: var(--shadow-gold);
}
.criteria li { margin: 6px 0; }
.criteria li::before { content:'✦ '; color: var(--gold); }
.deadline-chip {
  display:inline-flex; gap:8px; align-items:center;
  background: rgba(255,215,0,.12); border:1px solid var(--gold);
  color: var(--gold); padding:6px 14px; border-radius:24px; margin-top:8px;
  font-weight:600; font-size: .85rem;
}

/* Utility */
.center { text-align:center; }
.mt { margin-top: 14px; }
.mt2 { margin-top: 22px; }
.tag-pill {
  display:inline-block; background: rgba(0,245,255,.12);
  border:1px solid var(--cyan); color:var(--cyan);
  padding:4px 12px; border-radius:16px; font-size:.78rem; margin:4px;
  font-family: var(--font-heading);
}

/* Eco mode kills heavy animations */
body.eco .cube,
body.eco .float3d,
body.eco .neon-pulse { animation: none !important; }
body.eco #particle-canvas { display: none; }
