/* css/style.css - FIXED RESPONSIVE */

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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  min-height: 100vh;
  padding: 10px; /* Padding body diperkecil */
  color: #000000;
  display: flex;       /* Tambahan agar vertikal center jika konten sedikit */
  justify-content: center;
  align-items: flex-start; /* Jangan center vertikal penuh agar bisa scroll */
}

.container {
  width: 100%;           /* Default full */
  max-width: 1000px;     /* Batas maksimal di desktop */
  background: #ffffff;
  border-radius: 15px;   /* Radius diperhalus */
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-top: 10px;
  margin-bottom: 20px;
}

.header {
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: white;
  padding: 20px 15px; /* Padding header dikurangi */
  text-align: center;
}

.header h1 {
  font-size: 1.6em; /* Font judul mobile-safe */
  margin-bottom: 8px;
  font-weight: 700;
  line-height: 1.2;
}

.header p {
  font-size: 0.95em;
  opacity: 0.95;
  line-height: 1.4;
}

#mainContent {
  padding: 20px 15px; /* Padding konten utama dikurangi untuk HP */
}

/* Layout Grid Utama */
.quiz-container {
  width: 100%;
}

.layout {
  display: grid;
  grid-template-columns: 2.5fr 1fr; /* Desktop ratio */
  gap: 20px;
}

/* --- MOBILE RESPONSIVE RULES --- */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr; /* Stack ke bawah di HP/Tablet */
    gap: 25px;
  }
  
  .header h1 {
    font-size: 1.4em;
  }
  
  /* Balik urutan: Navigasi nomor di bawah soal (default grid sudah ok) */
  /* Jika ingin nomor soal di atas, gunakan order css flexbox/grid, tapi default bawah ok */
}

/* Timer & progress */
.timer {
  text-align: center;
  font-size: 1.5em;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 15px;
  background: #f0f9ff;
  display: inline-block;
  padding: 5px 20px;
  border-radius: 20px;
  /* Center timer */
  width: 100%; 
}

.progress-bar {
  background: #f1f5f9;
  height: 10px;
  border-radius: 5px;
  margin-bottom: 20px;
  overflow: hidden;
}

.progress {
  background: linear-gradient(90deg, #10b981, #34d399);
  height: 100%;
  width: 0%;
  transition: width 0.4s ease;
}

/* Question Area */
.question-meta {
  background: #f1f5f9;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 15px;
  font-size: 0.85em;
  color: #4b5563;
  line-height: 1.4;
  border-left: 4px solid #3b82f6;
}

.question {
  font-size: 1.15em; /* Ukuran soal pas di HP */
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.5;
  color: #111827;
  word-wrap: break-word; /* Mencegah teks panjang bablas */
}

/* Options Options */
.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 25px;
}

.option {
  background: #ffffff;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1em;
  color: #374151;
  display: flex;
  align-items: center; /* Teks vertikal center */
}

.option:active, .option:hover {
  background: #f8fafc;
  border-color: #93c5fd;
}

.option.selected {
  background: #eff6ff;
  color: #1e3a8a;
  border-color: #3b82f6;
  font-weight: 600;
}

/* Tombol Navigasi */
.navigation {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap; /* Tombol turun ke bawah jika layar sempit */
}

.nav-btn {
  flex: 1; /* Tombol membesar rata */
  background: #1e3a8a;
  color: white;
  border: none;
  padding: 14px 10px;
  border-radius: 10px;
  font-size: 0.95em;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap; /* Teks jangan turun */
  min-width: 100px;
  text-align: center;
}

.finish-btn {
  background: #059669; /* Hijau lebih solid */
  flex: 2; /* Tombol finish lebih lebar */
}

/* Start Button Screen */
.start-btn {
  background: linear-gradient(135deg, #10b981, #34d399);
  color: white;
  border: none;
  padding: 16px 40px;
  border-radius: 50px; /* Pill shape */
  font-size: 1.1em;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
  width: 100%;
  max-width: 300px; /* Agar tidak terlalu lebar di desktop */
}

/* Panel Review Nomor Soal */
.question-nav {
  background: #f8fafc;
  border-radius: 12px;
  padding: 15px;
  border: 1px solid #e2e8f0;
}

.question-nav h3 {
  font-size: 1em;
  margin-bottom: 12px;
  color: #1e3a8a;
  text-align: center;
}

.question-nav > div {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 5 tombol per baris */
  gap: 8px;
}

.question-nav button {
  width: 100%; /* Full width grid cell */
  aspect-ratio: 1; /* Kotak persegi */
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  font-weight: 600;
  font-size: 0.9em;
  color: #64748b;
  cursor: pointer;
}

.question-nav button.answered {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.question-nav button.current {
  background: #3b82f6;
  border-color: #2563eb;
  color: #ffffff;
}

/* Result Screen */
.results { text-align: center; }
.score-circle {
  width: 150px; height: 150px; /* Lebih kecil agar pas di HP */
  margin: 20px auto;
  border-radius: 50%;
  background: conic-gradient(#10b981 0deg var(--score-deg), #f3f4f6 0deg);
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.score-circle::before {
  content: ""; position: absolute;
  width: 120px; height: 120px;
  background: white; border-radius: 50%;
}
.score-text {
  position: relative; z-index: 2;
  font-size: 2em; font-weight: 800; color: #1f2937;
}
.review-wrapper {
  overflow-x: auto; /* Scroll horizontal tabel */
  margin-top: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}
.review-table th, .review-table td {
  padding: 10px;
  font-size: 0.85em;
  white-space: nowrap; /* Agar tabel melebar dan trigger scroll */
}
.review-table td:nth-child(2) {
  white-space: normal; /* Kolom soal boleh wrap */
  min-width: 200px;
}
