@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&display=swap');

:root {
  --navy: #0A2540;
  --red: #E31E24;
  --blue: #0066FF;
  --green: #00C853;
  --orange: #FF9800;
  --yellow: #FFC107;
  --bg-body: #F4F7FB;
  --text-gray: #64748b;
  --shadow-card: 0 8px 24px rgba(10, 37, 64, 0.06);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Nunito', sans-serif;
  background-color: var(--bg-body);
  color: var(--navy);
  overflow-x: hidden;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ================= NAVBAR ================= */
.site-header {
  background: #fff;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}
.nav-container {
  display: flex; align-items: center; justify-content: space-between;
  height: 80px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-logo {
  width: 44px; height: 44px;
  border: 2px solid var(--navy); border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  padding: 6px;
}
.brand-logo svg { width: 100%; height: 100%; }
.brand-text { line-height: 1.1; }
.brand-title { font-weight: 900; font-size: 18px; color: var(--navy); letter-spacing: -0.5px; }

/* WADAH KANAN (Navigasi & Pencarian) */
.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-links { display: flex; gap: 8px; }
.nav-links a {
  display: flex; align-items: center; gap: 6px;
  text-decoration: none; color: var(--navy);
  font-weight: 700; font-size: 14px;
  padding: 8px 16px; border-radius: 100px;
  transition: all 0.2s;
}
.nav-links a:hover { background: #f1f5f9; }
.nav-links a.active { background: var(--blue); color: #fff; }

.nav-search { position: relative; }
.nav-search input {
  padding: 10px 16px 10px 40px;
  border: 1px solid #e2e8f0; border-radius: 100px;
  font-family: inherit; font-size: 14px; outline: none;
  width: 220px; transition: 0.3s; background: #f8fafc;
}
.nav-search input:focus { border-color: var(--blue); width: 260px; background: #fff; }
.search-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  font-size: 14px; color: var(--text-gray);
}

/* ================= HERO SECTION ================= */
.hero-section {
  position: relative;
  height: 480px;
  background: #dbeafe;
  display: flex; align-items: center;
}
.hero-bg { position: absolute; inset: 0; z-index: 1; overflow: hidden; }
.hero-image { width: 100%; height: 100%; object-fit: cover; object-position: right center; }
.hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(244,247,251,1) 0%, rgba(244,247,251,0.9) 40%, rgba(244,247,251,0) 70%);
}
.hero-content { position: relative; z-index: 2; width: 100%; }
.hero-text { max-width: 500px; }
.hero-text h1 {
  font-size: 56px; font-weight: 900; letter-spacing: -2px; line-height: 1; margin-bottom: 12px;
}
.text-navy { color: var(--navy); }
.text-red { color: var(--red); }
.hero-text h2 {
  font-size: 32px; font-weight: 800; line-height: 1.2; color: var(--navy); margin-bottom: 16px;
}
.hero-text p {
  font-size: 18px; font-weight: 600; color: var(--text-gray); line-height: 1.4; margin-bottom: 32px;
}
.btn-hero {
  display: inline-flex; align-items: center; gap: 12px;
  background: var(--yellow); color: var(--navy);
  padding: 14px 28px; border-radius: 100px;
  text-decoration: none; font-weight: 800; font-size: 16px;
  box-shadow: 0 8px 20px rgba(255, 193, 7, 0.4);
  transition: transform 0.2s;
}
.btn-hero:hover { transform: translateY(-2px); }
.btn-icon {
  background: var(--navy); color: #fff;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 10px;
}

/* ================= CATEGORY CARDS ================= */
.category-wrapper { position: relative; z-index: 10; margin-top: -50px; margin-bottom: 40px; }
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.cat-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 24px; border-radius: 20px;
  text-decoration: none; color: #fff;
  box-shadow: 0 12px 24px rgba(0,0,0,0.1);
  transition: transform 0.3s;
}
.cat-card:hover { transform: translateY(-5px); }
.cat-blue { background: linear-gradient(135deg, #2979FF, #0066FF); }
.cat-green { background: linear-gradient(135deg, #00E676, #00C853); }
.cat-orange { background: linear-gradient(135deg, #FFB300, #FF9800); }

.cat-icon {
  width: 52px; height: 52px; background: #fff; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.cat-blue .cat-icon { color: var(--blue); }
.cat-green .cat-icon { color: var(--green); }
.cat-orange .cat-icon { color: var(--orange); }

.cat-text { flex: 1; }
.cat-text h3 { font-size: 18px; font-weight: 800; line-height: 1.2; }
.cat-arrow { font-size: 18px; opacity: 0.8; }

/* ================= CONTENT BOXES (Sections) ================= */
.main-content { display: flex; flex-direction: column; gap: 32px; padding-bottom: 60px; }
.content-box {
  background: #fff; border-radius: 24px; padding: 32px;
  box-shadow: var(--shadow-card);
  border: 1px solid #edf2f7;
}
.box-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
}
.header-left { display: flex; align-items: center; gap: 16px; }
.header-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center; font-size: 24px;
}
.icon-blue { background: #eff6ff; color: var(--blue); }
.icon-green { background: #f0fdf4; color: var(--green); }
.icon-orange { background: #fff7ed; color: var(--orange); }
.header-left h2 { font-size: 24px; font-weight: 900; color: var(--navy); }
.header-left p { font-size: 14px; color: var(--text-gray); font-weight: 600; margin-top: 2px; }

.btn-lihat {
  text-decoration: none; color: var(--navy);
  font-weight: 700; font-size: 14px;
  padding: 8px 20px; border: 2px solid #e2e8f0; border-radius: 100px;
  transition: 0.2s;
}
.btn-lihat:hover { border-color: var(--navy); background: var(--navy); color: #fff; }

/* --- VIDEO CARDS --- */
.video-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.v-card { cursor: pointer; transition: transform 0.3s; }
.v-card:hover { transform: translateY(-4px); }
.v-thumb {
  aspect-ratio: 16/9; border-radius: 16px; background: #e2e8f0 center/cover;
  position: relative; overflow: hidden; margin-bottom: 12px;
}
.v-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 50px; height: 50px; background: rgba(255,255,255,0.9);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: var(--blue); font-size: 16px; padding-left: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.v-info { display: flex; gap: 10px; }
.v-yt-icon { color: var(--red); font-size: 18px; margin-top: 2px; }
.v-info h3 { font-size: 15px; font-weight: 800; color: var(--navy); line-height: 1.3; margin-bottom: 4px; }
.v-info p { font-size: 13px; color: var(--text-gray); font-weight: 600; }

/* --- RULES CARDS --- */
.rule-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.r-card {
  background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 16px;
  padding: 20px; display: flex; gap: 16px;
}
.r-icon {
  width: 48px; height: 48px; background: #fff; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; box-shadow: 0 2px 6px rgba(0,0,0,0.05); flex-shrink: 0;
}
.r-info { flex: 1; }
.r-badge {
  display: inline-block; background: #dbeafe; color: var(--blue);
  font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 100px; margin-bottom: 8px;
}
.r-info h3 { font-size: 15px; font-weight: 800; line-height: 1.3; margin-bottom: 4px; }
.r-info p { font-size: 13px; color: var(--text-gray); font-weight: 600; margin-bottom: 12px; }
.r-btn {
  display: inline-block; background: var(--blue); color: #fff;
  text-decoration: none; font-size: 12px; font-weight: 700;
  padding: 6px 16px; border-radius: 100px; transition: 0.2s;
}
.r-btn:hover { background: #0052cc; }

/* --- BOOK CARDS --- */
.book-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
.b-card { border-radius: 12px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,0.08); transition: transform 0.3s; }
.b-card:hover { transform: translateY(-4px); }
.b-cover { aspect-ratio: 3/4; position: relative; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; }
.b-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Desain Cover CSS jika tidak ada gambar */
.c-navy { background: linear-gradient(135deg, #0A2540, #1e3a8a); color: #fff; }
.c-white { background: #fff; color: var(--navy); border: 1px solid #e2e8f0; }
.c-red { background: linear-gradient(135deg, #E31E24, #991b1b); color: #fff; }
.c-blue { background: linear-gradient(135deg, #0066FF, #1e40af); color: #fff; }
.c-yellow { background: linear-gradient(135deg, #FFC107, #f59e0b); color: var(--navy); }
.b-cover h3 { font-size: 16px; font-weight: 900; line-height: 1.2; position: relative; z-index: 2; }

/* ================= FOOTER ================= */
.site-footer {
  background: var(--navy); color: #fff; position: relative; padding: 40px 0;
  margin-top: 40px;
}
.footer-wave {
  position: absolute; top: -20px; left: 0; right: 0; height: 40px;
  background: url('data:image/svg+xml;utf8,<svg viewBox="0 0 1440 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M0 40V20C240 40 480 0 720 20C960 40 1200 0 1440 20V40H0Z" fill="%230A2540"/></svg>') no-repeat center/cover;
}
.footer-content {
  display: flex; align-items: center; justify-content: space-between;
}
.footer-brand { display: flex; align-items: center; gap: 10px; }
.footer-tagline { font-size: 18px; font-weight: 700; line-height: 1.4; text-align: right; opacity: 0.9; }

/* ================= MODAL ================= */
.modal { position: fixed; inset: 0; background: rgba(10, 37, 64, 0.9); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 20px; backdrop-filter: blur(4px); }
.modal.open { display: flex; }

/* PERBAIKAN PADA MODAL BOX */
.modal-box { 
  background: #000; 
  border-radius: 16px; 
  max-width: 900px; 
  width: 100%; 
  position: relative; 
  overflow: hidden; /* Penting agar sudut video melengkung rapi */
  box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}
.modal-box iframe, .modal-box video { 
  width: 100%; 
  aspect-ratio: 16/9; 
  display: block; 
  border: none; 
}

/* PERBAIKAN PADA TOMBOL CLOSE (X) */
.modal-close { 
  position: absolute; 
  top: 12px;       
  right: 12px; 
  background: rgba(255, 255, 255, 0.9); 
  border: none; 
  width: 36px; 
  height: 36px; 
  border-radius: 50%; 
  cursor: pointer; 
  font-weight: bold; 
  font-size: 16px;
  z-index: 9999;   /* Pastikan berada di atas iframe video */
  display: flex; 
  align-items: center; 
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: 0.2s;
}
.modal-close:hover { 
  transform: scale(1.1); 
  background: #fff; 
}

/* Responsive */
@media (max-width: 992px) {
  .nav-links { display: none; }
  .hero-section { height: auto; padding: 60px 0; }
  .hero-overlay { background: rgba(244,247,251,0.85); }
  .hero-text { margin: 0 auto; text-align: center; }
  .hero-text h1 { font-size: 46px; }
  .category-grid { grid-template-columns: 1fr; margin-top: 20px; }
  .video-grid, .rule-grid { grid-template-columns: 1fr 1fr; }
  .book-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-content { flex-direction: column; gap: 24px; text-align: center; }
  .footer-tagline { text-align: center; }
}

@media (max-width: 768px) {
  .nav-search { display: none; } /* Sembunyikan pencarian di layar sangat kecil */
  .video-grid, .rule-grid { grid-template-columns: 1fr; }
  .book-grid { grid-template-columns: 1fr 1fr; }
  .box-header { flex-direction: column; align-items: flex-start; gap: 16px; }
  .header-left { flex-direction: row; }
}

/* ================= MODAL TAMBAHAN ================= */
.large-modal {
  max-width: 800px;
  background: #fff;
  padding: 32px;
  border-radius: 20px;
  color: var(--navy);
  /* overflow: hidden di atas akan memotong scroll, jadi kita override di sini */
  overflow: visible; 
}
.modal-scroll-area {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 10px;
}
.modal-scroll-area::-webkit-scrollbar { width: 8px; }
.modal-scroll-area::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 4px; }
.modal-scroll-area::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

/* ===== TENTANG ===== */
.tentang-content p {
  margin-bottom: 16px;
  line-height: 1.6;
  color: var(--text-gray);
  font-size: 15px;
}

/* ===== QUIZ ===== */
.quiz-container { max-height: 70vh; overflow-y: auto; padding-right: 10px; }
.quiz-item { margin-bottom: 24px; background: #f8fafc; padding: 20px; border-radius: 12px; border: 1px solid #e2e8f0; }
.quiz-question { font-weight: 700; font-size: 16px; margin-bottom: 12px; color: var(--navy); }
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-label { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 15px; padding: 10px; background: #fff; border-radius: 8px; border: 1px solid #e2e8f0; transition: 0.2s; }
.quiz-label:hover { background: #eff6ff; border-color: #bfdbfe; }
.quiz-label input[type="radio"] { accent-color: var(--blue); width: 18px; height: 18px; }
.btn-submit-quiz { width: 100%; padding: 14px; background: var(--blue); color: #fff; font-size: 16px; font-weight: 700; border: none; border-radius: 10px; cursor: pointer; transition: 0.3s; margin-top: 16px; }
.btn-submit-quiz:hover { background: #0052cc; }

/* Hasil Quiz */
.quiz-result { text-align: center; padding: 20px 0; }
.quiz-result h3 { font-size: 20px; color: var(--navy); margin-bottom: 16px; }
.score-circle { width: 120px; height: 120px; border-radius: 50%; background: #eff6ff; color: var(--blue); font-size: 40px; font-weight: 900; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; border: 6px solid #bfdbfe; }
.score-text { font-size: 16px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.score-message { font-size: 15px; color: var(--text-gray); margin-bottom: 24px; }