/* =================================================================
   MyToefl App Stylesheet (Versi Rapi)
   Struktur:
   1. Global & Root Variables
   2. Layout Utama (Header, Container)
   3. Komponen Umum (Buttons, Navbar, Avatar)
   4. Halaman Form (Login & Register)
   5. Halaman Dashboard
   6. Halaman Utama (Homepage)
   7. Halaman Sertifikat
   8. Responsive Media Queries
================================================================= */

/* ===== 1. GLOBAL & ROOT VARIABLES ===== */
:root {
  --primary-color: #20b2aa;
  --primary-hover: #17a2b8;
  --secondary-color: #ffd700;
  --text-dark: #333;
  --text-light: #666;
  --bg-light: #e8f5f3;
  --bg-white: #ffffff;
  --border-color: #ddd;
  --error-color: #e74c3c;
  --success-color: #155724;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-light);
  min-height: 100vh;
  color: var(--text-dark);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ===== 2. LAYOUT UTAMA (HEADER, CONTAINER) ===== */
.header {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-hover) 100%
  );
  color: var(--bg-white);
  padding: 15px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo,
a.logo {
  font-size: 28px;
  font-weight: bold;
  text-decoration: none;
  color: inherit;
}

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

/* ===== 3. KOMPONEN UMUM (BUTTONS, NAVBAR, AVATAR) ===== */
.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-primary {
  background: var(--bg-white);
  color: var(--primary-color);
}

.btn-secondary {
  background: transparent;
  color: var(--bg-white);
  border: 2px solid var(--bg-white);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-buttons {
  display: flex;
  align-items: center;
  gap: 18px;
}

.user-greeting {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--bg-white);
}

#user-info {
  font-weight: 500;
}

.profile-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  cursor: default;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Penataan Ulang Urutan Navbar Kanan */
.nav-buttons .btn-primary {
  order: 1;
}
.nav-buttons .btn-secondary {
  order: 2;
}
.user-greeting {
  order: 3; /* DIPERBAIKI: Seharusnya 3 agar menjadi paling kanan */
}

/* ===== 4. HALAMAN FORM (LOGIN & REGISTER) ===== */

/* Wrapper untuk menengahkan form di tengah layar */
.form-page-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, var(--bg-light) 0%, #f0f9f7 100%);
}

/* Container utama untuk box form */
.login-container {
  width: 100%;
  max-width: 440px;
  padding: 35px;
  border-radius: 12px;
  border-top: 4px solid var(--primary-color);
  background: var(--bg-white);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.07);
}

/* Logo di dalam form */
.form-logo-container {
  text-align: center;
  margin-bottom: 25px;
}
.logo-in-form {
  font-size: 32px;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
}

.login-container h2 {
  text-align: center;
  margin-bottom: 25px;
  font-size: 26px;
  color: var(--text-dark);
}

/* Grup field (label + input) */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  margin-bottom: 15px;
  margin-top: 15px;
  font-weight: 600;
}
.form-group input {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  font-size: 16px;
}
.form-group input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(32, 178, 170, 0.2);
  outline: none;
}

/* Tombol full-width di dalam form */
.btn-full {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  background-color: var(--primary-color);
  color: var(--bg-white);
}
.btn-full:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

/* Link untuk pindah form (login/register) */
.form-toggle {
  text-align: center;
  margin-top: 20px;
}
.form-toggle a {
  color: var(--primary-color);
  cursor: pointer;
  text-decoration: underline;
}

/* Pesan feedback (error/sukses/realtime) */
.form-message {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  display: none;
  border: 1px solid transparent;
}
.form-error {
  background-color: #f8d7da;
  color: #721c24;
  border-color: #f5c6cb;
}
.form-success {
  background-color: #d4edda;
  color: var(--success-color);
  border-color: #c3e6cb;
}
.form-feedback {
  font-size: 14px;
  margin-top: 6px;
  min-height: 20px;
}
.feedback-error {
  color: var(--error-color);
}
.feedback-success {
  color: var(--success-color);
}

/* Link kembali ke home di bawah form */
.back-to-home {
  text-align: center;
  margin-top: 30px;
}
.link-secondary {
  color: var(--text-light);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}
.link-secondary:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

/* ===== 5. HALAMAN DASHBOARD ===== */
.dashboard {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 30px;
}
.sidebar {
  background: var(--bg-white);
  border-radius: 15px;
  padding: 20px 0;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
  height: fit-content;
}
.sidebar-menu {
  list-style: none;
}
.sidebar-menu a {
  display: block;
  padding: 15px 30px;
  color: var(--text-light);
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 4px solid transparent;
  cursor: pointer;
}
.sidebar-menu a:hover,
.sidebar-menu a.active {
  background: rgba(32, 178, 170, 0.1);
  color: var(--primary-color);
  border-left-color: var(--primary-color);
}
.main-content {
  background: var(--bg-white);
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
}
.dashboard-subtitle {
  margin-top: -5px;
  margin-bottom: 30px;
  color: var(--text-light);
  font-size: 16px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.stat-card {
  background: var(--bg-white);
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  border-left: 4px solid var(--primary-color);
}
.stat-card h4 {
  font-size: 16px;
  color: var(--text-light);
  font-weight: 500;
  margin-bottom: 10px;
}
.stat-card p {
  font-size: 36px;
  font-weight: 700;
  color: var(--text-dark);
}
.chart-container {
  background: var(--bg-white);
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 40px;
  height: 400px;
}
.chart-container h3 {
  margin-bottom: 20px;
  text-align: center;
}
.history-container {
  background: var(--bg-white);
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}
#history-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}
#history-table th,
#history-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}
#history-table th {
  background: #f8f9fa;
}
#history-table tr:hover {
  background-color: #f8f9fa;
}
#history-table tr.passed td:nth-child(5) b {
  color: var(--success-color);
}
.btn-certificate {
  display: inline-block;
  padding: 6px 10px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  transition: background-color 0.2s;
}

.btn-certificate:hover {
  background-color: var(--primary-hover);
  text-decoration: none;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  opacity: 1; /* Pastikan tidak transparan */
}

/* ===== 6. HALAMAN UTAMA (HOMEPAGE) ===== */
.hero-section {
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-hover) 100%
  );
  padding: 40px;
  margin-bottom: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--bg-white);
  border-radius: 15px;
}
.hero-content {
  flex: 1;
  max-width: 60%;
}
.elearning-badge {
  background: var(--bg-white);
  color: var(--primary-color);
  padding: 8px 20px;
  border-radius: 25px;
  font-weight: bold;
  display: inline-block;
  margin-bottom: 20px;
}
.hero-title {
  font-size: 32px;
  font-weight: bold;
  margin-bottom: 20px;
  line-height: 1.3;
}
.hero-image {
  max-width: 300px;
}
.hero-image img {
  width: 100%;
  border-radius: 15px;
}
.hero-btn {
  background: var(--secondary-color);
  color: var(--text-dark);
}
.section-title {
  text-align: center;
  font-size: 36px;
  margin-bottom: 40px;
}
.brand-highlight {
  color: var(--primary-color);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}
.feature-card {
  background: var(--bg-white);
  border-radius: 20px;
  padding: 40px 30px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}
.feature-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}
.feature-icon {
  font-size: 40px;
  width: 80px;
  height: 80px;
  margin: 0 auto 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}
.feature-icon.pink {
  background: linear-gradient(135deg, #ff6b9d, #ff8cc6);
}
.feature-icon.purple {
  background: linear-gradient(135deg, #a855f7, #c084fc);
}
.feature-icon.blue {
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

/* ===== 7. HALAMAN SERTIFIKAT ===== */
@import url("https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Sacramento&display=swap");

.certificate-body {
  background: #e0e0e0;
  font-family: "Merriweather", serif;
  position: relative;
  padding-bottom: 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Pada layar normal (non-print), tampilkan dengan ukuran yang sesuai */
.certificate-wrapper {
  width: 90%;
  max-width: 900px;
  aspect-ratio: 1.414 / 1; /* Rasio A4 */
  margin: 20px auto;
  background: white;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
  position: relative;
  padding: 0.5cm;
  background-image: url("https://www.transparenttextures.com/patterns/az-subtle.png");
  z-index: 1;
}

.certificate-container {
  border: 2px solid #a88b4a;
  width: 100%;
  height: 100%;
  padding: 1cm;
  text-align: center;
  color: #333;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  box-sizing: border-box;
}

/* Skala responsif untuk konten sertifikat */
.cert-header-text {
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 700;
  color: #3e4a61;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.cert-name-text {
  font-family: "Sacramento", cursive;
  font-size: clamp(36px, 8vw, 56px);
  color: #0d47a1;
  margin: 10px 0;
  font-weight: 400;
  line-height: 1.2;
}

.cert-achievement-text {
  font-size: clamp(12px, 2vw, 14px);
  max-width: 80%;
  margin: 0 auto 1cm auto;
}

.score-details-box {
  border: 1px solid #ddd;
  padding: clamp(10px, 2vw, 15px);
  margin: 0 auto 1cm auto;
  max-width: 80%;
}

.score-item,
.score-total {
  display: flex;
  justify-content: space-between;
  font-size: clamp(14px, 2vw, 16px);
  padding: 6px 0;
  border-bottom: 1px dashed #eee;
}

.score-total {
  font-size: clamp(16px, 3vw, 20px);
  font-weight: bold;
  border-top: 2px solid #333;
  border-bottom: none;
  margin-top: 8px;
}

.print-button-container {
  text-align: center;
  padding: 20px 0;
  position: relative;
  z-index: 100;
  margin-top: 30px;
}

#print-btn {
  padding: 15px 30px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  position: relative;
  z-index: 100;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  border-radius: 6px;
}

/* Hapus overlap dengan certificate-wrapper */
@media screen {
  .certificate-wrapper {
    margin-bottom: 60px;
  }
}

/* Atur untuk cetak - menyesuaikan dengan ukuran kertas apapun */
@media print {
  /* Sembunyikan elemen yang TIDAK ingin dicetak */
  .print-button-container {
    display: none !important;
  }
  
  /* Reset semua margin dan padding pada body */
  html, body, .certificate-body {
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
  }
  
  /* Gunakan 100% dari ukuran kertas */
  .certificate-wrapper {
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    page-break-after: always !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    border: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  
  .certificate-container {
    width: calc(100% - 1cm) !important;
    height: calc(100% - 1cm) !important;
    margin: 0.5cm !important;
    padding: 1cm !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }
  
  /* Paksa browser untuk mencetak warna latar belakang */
  * {
    -webkit-print-color-adjust: exact !important;
    color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  /* Menyesuaikan ukuran font secara dinamis */
  .cert-name-text {
    font-size: 6vw !important;
    line-height: 1.1 !important;
  }
  
  .cert-header-text {
    font-size: 5vw !important;
  }
  
  /* Memastikan tidak ada pemisahan halaman */
  .certificate-container,
  .cert-achievement-text,
  .score-details-box,
  .certificate-footer {
    page-break-inside: avoid !important;
  }
  
  /* Mengoptimalkan ruang pada elemen-elemen sertifikat */
  .score-details-box {
    margin-top: 0.5cm !important;
    margin-bottom: 0.5cm !important;
  }
  
  /* Pastikan footer tetap di bawah */
  .certificate-footer {
    margin-top: auto !important;
  }
}

/* ===== 8. RESPONSIVE & PRINT STYLES ===== */

@media (max-width: 992px) {
  .dashboard {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .hero-section {
    flex-direction: column;
    text-align: center;
  }
  .hero-content {
    max-width: 100%;
  }
  .hero-image {
    margin-top: 30px;
  }
  .nav-container {
    flex-direction: column;
    gap: 15px;
  }
}
/* ===== HALAMAN DASHBOARD (REDESIGN V2) ===== */

/* Header di dalam konten utama */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 20px;
}
.main-welcome {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
}
.dashboard-subtitle {
  font-size: 16px;
  color: var(--text-light);
  margin-top: 4px;
}
.test-actions-container {
  display: flex;
  gap: 15px;
  flex-shrink: 0;
}
.btn-action-primary,
.btn-action-secondary {
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}
.btn-action-primary {
  background-color: var(--primary-color);
  color: white;
}
.btn-action-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(32, 178, 170, 0.3);
}
.btn-action-secondary {
  background-color: var(--bg-white);
  color: var(--text-dark);
  border: 1px solid var(--border-color);
}
.btn-action-secondary:hover {
  background-color: #f8f9fa;
  transform: translateY(-2px);
}

/* Layout Grid Utama Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}
.section-header {
  margin-bottom: 20px;
  border-bottom: 1px solid #eee;
  padding-bottom: 10px;
}
.section-header h3 {
  font-size: 20px;
  color: var(--text-dark);
  font-weight: 600;
}
.section-header i {
  color: var(--primary-color);
  margin-right: 10px;
}

/* Kartu Statistik Latihan yang Diperbarui */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(240px, 1fr)
  ); /* Jadi 2 kolom */
  gap: 20px;
  margin-bottom: 30px;
}
.stat-card {
  background: var(--bg-white);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}
.stat-icon {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e8f5f3;
}
.stat-icon i {
  color: var(--primary-color);
  font-size: 22px;
}
.stat-info h4 {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
  margin-bottom: 5px;
}
.stat-info p {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
}
.weakness-card .stat-info p {
  color: var(--primary-hover);
  font-size: 24px;
}

/* Panel Samping untuk Tes Sungguhan */
.side-panel-card {
  background-color: var(--bg-white);
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.04);
}
.side-panel-card h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 15px;
}
.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  font-size: 15px;
  border-bottom: 1px solid #f0f0f0;
}
.summary-item:last-of-type {
  border-bottom: none;
}
.summary-item span {
  color: var(--text-light);
}
.summary-item strong {
  font-size: 18px;
  font-weight: 700;
}
#certificate-status.status-passed {
  color: var(--success-color);
}
#certificate-status.status-failed {
  color: var(--error-color);
}

.panel-divider {
  border: 0;
  border-top: 1px solid #eee;
  margin: 20px 0;
}

.target-info-text {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 10px;
}
.progress-bar-container {
  height: 10px;
  margin-bottom: 15px;
}
.progress-bar-fill {
  height: 100%;
  border-radius: 5px;
}
.target-form {
  display: flex;
  gap: 10px;
}

/* Penyesuaian lain */
.chart-container,
.history-container {
  background: var(--bg-white);
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.04);
  margin-top: 30px;
}

/* ===== Animasi Ikon di Dashboard ===== */

/* Beri transisi pada ikon di keadaan normal */
.stat-card h4 i {
  transition: transform 0.3s ease-in-out, color 0.3s ease;
}

/* Definisikan apa yang terjadi saat seluruh kartu di-hover */
.stat-card:hover h4 i {
  transform: scale(1.2) rotate(-15deg); /* Ikon membesar 20% dan sedikit miring */
  color: var(--primary-hover); /* Warna ikon berubah menjadi warna hover tema */
}

/* Style untuk Label Mode Tes di Tabel */
.mode-label {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 12px;
  color: white;
  font-weight: 500;
}
.mode-real {
  background-color: var(--primary-color);
}
.mode-practice {
  background-color: #6c757d; /* Abu-abu */
}

/* ===== Penyesuaian Layout Header Dashboard ===== */

/* Membuat header di main-content menggunakan flexbox */
.main-header {
  display: flex;
  justify-content: space-between; /* Mendorong item ke ujung */
  align-items: flex-start; /* Sejajarkan dari atas */
  margin-bottom: 30px; /* Jarak ke kartu statistik */
  flex-wrap: wrap; /* Izinkan wrap di layar kecil */
  gap: 20px;
}

.test-actions-container {
  display: flex;
  gap: 15px; /* Jarak antar tombol */
  flex-shrink: 0; /* Mencegah tombol menyusut */
}

/* Style kustom untuk tombol aksi */
.btn-action-primary,
.btn-action-secondary {
  padding: 12px 22px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}

.btn-action-primary {
  background-color: var(--primary-color);
  color: white;
}
.btn-action-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(32, 178, 170, 0.3);
}

.btn-action-secondary {
  background-color: #f0f2f5;
  color: var(--text-dark);
}
.btn-action-secondary:hover {
  background-color: #e2e6ea;
  transform: translateY(-2px);
}

/* --- Peningkatan Modul Target Skor (Progress Bar) --- */

/* Keyframes untuk animasi garis-garis */
@keyframes animate-stripes {
  from {
    background-position: 40px 0;
  }
  to {
    background-position: 0 0;
  }
}

/* Container untuk progress bar */
.progress-bar-container {
  width: 100%;
  height: 28px; /* Dibuat lebih tebal */
  background-color: #e9ecef;
  border-radius: 15px; /* Dibuat lebih bulat */
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1); /* Efek 3D ke dalam */
}

/* Bar pengisi progres */
.progress-bar-fill {
  height: 100%;
  width: 0%; /* Dimulai dari 0, diisi oleh JS */
  border-radius: 15px;
  position: relative; /* Diperlukan untuk animasi garis */
  transition: width 1.5s cubic-bezier(0.25, 1, 0.5, 1); /* Transisi lebih halus */

  /* Warna gradien utama */
  background-color: var(--primary-color);
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  background-size: 40px 40px; /* Ukuran pola garis */

  /* Menjalankan animasi garis */
  animation: animate-stripes 2s linear infinite;

  /* Menata teks persentase di dalam bar */
  display: flex;
  justify-content: flex-end; /* Taruh di ujung kanan */
  align-items: center;
}

/* Teks persentase di dalam bar */
#progress-bar-text {
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding-right: 12px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.progress-text {
  font-size: 14px;
  color: var(--text-light);
  font-style: italic; /* Dibuat miring agar beda */
}

/* --- Peningkatan Modul Target Skor V2 --- */
.target-score-container {
  background: var(--bg-white);
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.target-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.btn-edit-target {
  background: none;
  border: none;
  color: var(--text-light);
  cursor: pointer;
  font-size: 16px;
  padding: 5px;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: none; /* Awalnya disembunyikan, ditampilkan oleh JS */
  transition: background-color 0.3s ease, color 0.3s ease;
}
.btn-edit-target:hover {
  background-color: #f0f0f0;
  color: var(--primary-color);
}

.target-info-display {
  font-size: 18px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 15px;
}

.target-form {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

#target-input {
  flex-grow: 1; /* Input mengambil sisa ruang */
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  font-size: 16px;
}
#target-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(32, 178, 170, 0.2);
  outline: none;
}

.btn-set-target {
  padding: 10px 20px;
  border: none;
  background-color: var(--primary-color);
  color: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.3s ease;
}
.btn-set-target:hover {
  background-color: var(--primary-hover);
}

/* Progress Bar (tidak banyak berubah) */
.progress-bar-container {
  width: 100%;
  height: 28px;
  background-color: #e9ecef;
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 8px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Teks info di bawah bar (dibuat lebih menonjol) */
.progress-text {
  font-size: 14px;
  color: var(--text-light);
  font-weight: 500;
}
.progress-text strong {
  color: var(--primary-color);
  font-size: 15px;
}

/* ===== LEADERBOARD STYLE ===== */

.leaderboard-container {
  background: var(--bg-white);
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.04);
  margin-top: 30px;
}

.leaderboard-list {
  list-style: none; /* Hilangkan nomor default dari <ol> */
  padding: 0;
  margin: 0;
}

.leaderboard-item {
  display: flex;
  align-items: center;
  padding: 15px 10px;
  border-bottom: 1px solid #f0f0f0;
  transition: background-color 0.3s ease;
}

.leaderboard-item:last-child {
  border-bottom: none;
}

.leaderboard-item:hover {
  background-color: #f8f9fa;
}

.leaderboard-rank {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
  width: 40px; /* Beri lebar tetap agar rapi */
  text-align: center;
}

.leaderboard-name {
  font-weight: 600;
  color: var(--text-dark);
  flex-grow: 1; /* Ambil sisa ruang */
  padding: 0 15px;
}

.leaderboard-score {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
}

/* Style khusus untuk Top 3 */
.leaderboard-item.rank-1 .leaderboard-rank {
  color: #ffd700; /* Emas */
}
.leaderboard-item.rank-2 .leaderboard-rank {
  color: #c0c0c0; /* Perak */
}
.leaderboard-item.rank-3 .leaderboard-rank {
  color: #cd7f32; /* Perunggu */
}

/* Style khusus untuk menandai user yang sedang login */
.leaderboard-item.current-user {
  background-color: #e8f5f3;
  border-left: 4px solid var(--primary-color);
  padding-left: 6px;
}
.leaderboard-item.current-user .leaderboard-name {
  font-weight: 700;
}

/* ===== HALAMAN TES (REDESIGN) ===== */
.test-page-body {
  background-color: #f0f2f5; /* Latar belakang netral untuk fokus */
}

.test-main-header {
  background-color: var(--bg-white);
  padding-top: 15px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}
.test-main-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0;
  padding-bottom: 15px;
}
.test-brand {
  display: flex;
  align-items: center;
  gap: 15px;
}
.test-mode-badge {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  color: white;
}
.test-mode-badge.mode-real {
  background-color: var(--primary-color);
}
.test-mode-badge.mode-practice {
  background-color: #6c757d;
}

.test-timer-container {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
}
.test-timer-container i {
  color: var(--primary-color);
  margin-right: 8px;
}

.test-progress-container {
  width: 100%;
  height: 6px;
  background-color: #e9ecef;
}
.test-progress-bar-fill {
  width: 0%;
  height: 100%;
  background-color: var(--primary-color);
  transition: width 0.5s ease;
}

.test-content-wrapper {
  display: flex;
  gap: 30px;
  align-items: flex-start;
  padding-top: 30px;
}
.question-area {
  flex-grow: 1;
}
.question-sidebar {
  width: 280px;
  flex-shrink: 0;
  position: sticky;
  top: 100px; /* Di bawah header */
}

.question-sidebar h3 {
  font-size: 18px;
  margin-bottom: 15px;
}

.question-card {
  background: var(--bg-white);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.question-passage {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  max-height: 200px;
  overflow-y: auto;
  line-height: 1.6;
}
.question-text {
  font-size: 18px;
  font-weight: 500;
  line-height: 1.6;
  margin-bottom: 25px;
}

/* Pilihan Jawaban yang Diperbarui */
.options-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.options-list label {
  display: block;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  border: 2px solid #f8f9fa;
  cursor: pointer;
  transition: all 0.3s ease;
}
.options-list label:hover {
  border-color: var(--primary-color);
  background: #e8f5f3;
}
.options-list input[type="radio"] {
  margin-right: 12px;
}
/* Style saat jawaban dipilih */
.options-list input[type="radio"]:checked + span {
  font-weight: 600;
}
.options-list label.selected {
  border-color: var(--primary-color);
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
}

/* Navigasi Soal (Grid) */
.question-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
  gap: 10px;
  background: var(--bg-white);
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}
.question-grid-item {
  width: 45px;
  height: 45px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}
.question-grid-item:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}
.question-grid-item.answered {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}
.question-grid-item.current {
  border-color: var(--secondary-color);
  background-color: var(--secondary-color);
  color: var(--text-dark);
  transform: scale(1.1);
}

.btn-finish-test {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  background-color: var(--error-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* ===== HALAMAN TES (REDESIGN V2 - FITUR BARU) ===== */

/* Wrapper untuk judul sesi dan tombol tandai */
.section-title-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.btn-flag-question {
  background-color: #fff;
  border: 1px solid var(--border-color);
  color: var(--text-light);
  padding: 8px 15px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
}
.btn-flag-question:hover {
  border-color: var(--secondary-color);
  color: var(--text-dark);
}
/* Style saat soal sudah ditandai */
.btn-flag-question.flagged {
  background-color: #fff3cd;
  border-color: var(--secondary-color);
  color: #664d03;
}
.btn-flag-question.flagged i {
  font-weight: 900; /* Mengubah ikon menjadi bendera terisi */
}

/* Pilihan jawaban yang lebih interaktif */
.options-list label {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}
.options-list label.selected {
  border-color: var(--primary-color);
  background-color: #e8f5f3;
  color: var(--primary-color);
  font-weight: 600;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(32, 178, 170, 0.2);
}
.options-list label.selected span {
  font-weight: 700 !important;
}

/* Status "ditandai" pada grid navigasi */
.question-grid-item.flagged {
  border-color: #ffc107;
  position: relative;
}
/* Membuat ikon bendera kecil di pojok */
.question-grid-item.flagged::after {
  content: "\f024"; /* Kode unicode untuk ikon bendera Font Awesome */
  font-family: "Font Awesome 5 Free";
  font-weight: 900;
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
  color: #ffc107;
}

/* style.css */
.badges-container {
  margin-top: 30px;
}
.badges-list {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}
.badge-item {
  background: #f8f9fa;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  cursor: help;
}
.badge-item i {
  color: var(--primary-color);
}

.error-container {
  text-align: center;
  padding: 2rem;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  max-width: 600px;
  margin: 2rem auto;
}

.error-container h1 {
  color: #e74c3c;
  margin-bottom: 1rem;
}

.error-container p {
  margin-bottom: 1.5rem;
  color: #555;
}

.score-excellent {
  color: #27ae60;
  font-weight: bold;
}

.score-good {
  color: #2980b9;
  font-weight: bold;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  overflow: auto;
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  border-bottom: 1px solid #eee;
}

.modal-header h3 {
  margin: 0;
  color: var(--primary-color);
}

.close-modal {
  color: #888;
  font-size: 24px;
  cursor: pointer;
  transition: color 0.3s;
}

.close-modal:hover {
  color: var(--primary-color);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

/* Edit Profile Form */
.edit-profile-form {
  text-align: left;
}

.edit-profile-form .form-group {
  margin-bottom: 15px;
}

.edit-profile-form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.edit-profile-form .form-control {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.edit-profile-form .form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(32, 178, 170, 0.25);
  outline: none;
}

.edit-profile-form .form-text {
  color: #888;
  font-size: 12px;
  margin-top: 5px;
}

.password-section-title {
  margin: 20px 0 15px;
  font-size: 16px;
  color: #333;
  font-weight: 600;
}

.error-message {
  color: #e74c3c;
  font-size: 14px;
  margin-top: 10px;
  min-height: 20px;
}

#profile-trigger {
  cursor: pointer;
  position: relative;
}

.profile-avatar:hover,
#user-info:hover {
  opacity: 0.9;
}

/* Notification */
.notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 15px 25px;
  background: white;
  color: #333;
  border-left: 4px solid #2ecc71;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  z-index: 1100;
  opacity: 1;
  transition: opacity 0.3s;
}

.notification-success {
  border-left-color: #2ecc71;
}

.notification-error {
  border-left-color: #e74c3c;
}

.notification-info {
  border-left-color: #3498db;
}

/* Styling untuk pop-up skor section */
.section-result,
.test-result {
  padding: 15px;
  text-align: center;
}

.score-display,
.final-score {
  margin: 20px auto;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background-color: var(--primary-color);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.score-number {
  font-size: 42px;
  font-weight: bold;
  line-height: 1;
  margin-bottom: 5px;
}

.score-label {
  font-size: 14px;
  text-transform: uppercase;
}

.score-details {
  margin: 20px 0;
  font-size: 16px;
}

.section-scores {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 20px 0;
}

.section-score {
  text-align: center;
}

.section-score-number {
  font-size: 24px;
  font-weight: bold;
  color: var(--primary-color);
}

.section-score-label {
  font-size: 14px;
  color: #666;
}

.test-mode-text {
  font-style: italic;
  margin-top: 15px;
  color: #666;
}

/* Hide timer in practice mode */
.mode-practice ~ .test-timer-container {
  display: none;
}

/* Test mode badges */
.test-mode-badge {
  font-size: 14px;
  padding: 5px 10px;
  border-radius: 4px;
  margin-left: 10px;
  font-weight: 600;
}

.mode-real {
  background-color: #e74c3c;
  color: white;
}

.mode-practice {
  background-color: #3498db;
  color: white;
}

.score-passing {
  color: #27ae60; /* Hijau untuk skor tinggi */
}

.score-moderate {
  color: #f39c12; /* Kuning/oranye untuk skor menengah */
}

.btn-certificate {
  display: inline-block;
  padding: 8px 12px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 10;
  white-space: nowrap;
  margin: 2px 0;
}

.btn-certificate:hover {
  background-color: var(--primary-hover);
  text-decoration: none;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  opacity: 1; /* Pastikan tidak transparan */
}

.no-certificate {
  color: #999;
  font-style: italic;
  font-size: 14px;
}

/* Footer certificate dengan layout vertikal */
.certificate-footer {
  display: flex;
  flex-direction: row;
  gap: 50px;
  text-align: center;
  margin-top: auto;
  padding-top: 1cm;
  justify-content: center;
}

.certificate-footer .footer-item {
  margin-bottom: 10px;
}

.certificate-footer .footer-label {
  font-size: 12px;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 3px;
}

.certificate-footer .footer-value {
  font-size: 16px;
  font-weight: 600;
  color: #333;
}

.certificate-footer .signature-line {
  width: 200px;
  height: 1px;
  background-color: #333;
  margin: 0 auto 5px;
  margin-top: 10px;
}

.certificate-footer .institution {
  margin-top: 15px;
  font-weight: 700;
  font-size: 18px;
  color: #3e4a61;
}

/* ===== HASIL TES LATIHAN DENGAN PEMBAHASAN ===== */
.practice-result-dialog {
  padding: 0 !important;
  overflow-y: auto;
}

.practice-result-popup {
  max-width: 900px;
  max-height: 80vh;
}

.practice-result-content {
  padding: 20px 0;
  overflow-y: auto;
  max-height: 60vh;
}

.practice-summary {
  margin: 20px 0;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  text-align: center;
}

.correct-count {
  color: #28a745;
  font-weight: bold;
  font-size: 18px;
}

.wrong-count {
  color: #dc3545;
  font-weight: bold;
  font-size: 18px;
}

.answers-review-section {
  margin-top: 30px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.answers-review-section h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 15px;
  text-align: center;
}

.answers-container {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 10px;
}

.answer-item {
  background: #fff;
  border-radius: 10px;
  padding: 15px 20px;
  margin-bottom: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border-left: 4px solid transparent;
}

.answer-item.correct-answer {
  border-left-color: #28a745;
}

.answer-item.wrong-answer {
  border-left-color: #dc3545;
}

.answer-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed #eee;
}

.correct-answer-icon {
  color: #28a745;
  font-size: 20px;
}

.wrong-answer-icon {
  color: #dc3545;
  font-size: 20px;
}

.question-number {
  font-weight: 600;
  color: #333;
}

.answer-item .question-text {
  font-size: 16px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.answer-details {
  background: #f8f9fa;
  padding: 12px;
  border-radius: 8px;
  font-size: 14px;
}

.answer-details p {
  margin: 5px 0;
}

.text-success {
  color: #28a745;
  font-weight: 600;
}

.text-danger {
  color: #dc3545;
  font-weight: 600;
}

.explanation-box {
  margin-top: 12px;
  padding: 10px;
  background: #fff3cd;
  border-left: 3px solid #ffc107;
  border-radius: 4px;
}

.explanation-box strong {
  display: block;
  margin-bottom: 5px;
  color: #856404;
}

.all-correct-message {
  text-align: center;
  padding: 20px;
  background: #d1e7dd;
  border-radius: 8px;
  color: #0f5132;
  margin-top: 20px;
}

.all-correct-message i {
  font-size: 40px;
  margin-bottom: 10px;
  color: #198754;
}

.practice-mode-info {
  background-color: #f8f9fa;
  border-left: 4px solid #17a2b8;
  padding: 10px;
  margin-bottom: 15px;
}

/* Modifikasi SERTIF */
.cert-id, #cert-id, #cert-date {
  font-weight: 700;
  margin-bottom: 10px;
}




/* ===== DESAIN BARU: HALAMAN HASIL TES (MODERN & RESPONSIVE) - FINAL ===== */

/* ----- 1. Tata Letak Dasar & Latar Belakang ----- */
#results-page-container.active {
  background: #f4f7f9; /* Latar belakang abu-abu muda yang netral */
  padding: 20px 15px;
  overflow-y: auto; /* PENTING: Menambahkan scroll pada wadah utama halaman */
}

.results-content-wrapper {
  max-width: 800px; /* Lebar maksimal konten agar nyaman dibaca */
  margin: 20px auto;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.results-header h1 {
  font-size: 2.25rem;
  font-weight: 800;
  color: #1a3b5d;
}

.results-header p {
  font-size: 1.1rem;
  color: #6c757d;
  margin-top: 8px;
}

/* ----- 2. Kartu Ringkasan Skor ----- */
.results-summary-card {
  background: #ffffff;
  border-radius: 16px;
  padding: 30px;
  margin-top: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  text-align: center;
  border: 1px solid #e9ecef;
}

.total-score-circle {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  box-shadow: 0 8px 20px rgba(32, 178, 170, 0.4);
}

.total-score-circle span {
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.9;
}

.total-score-circle strong {
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.1;
}

.sub-scores-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin: 30px 0;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 12px;
}

.sub-score-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.sub-score-item i {
  font-size: 1.5rem;
  color: var(--primary-color);
}

.sub-score-info {
  text-align: left;
}

.sub-score-info span {
  font-size: 0.9rem;
  color: #6c757d;
}

.sub-score-info strong {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a3b5d;
  display: block;
}

.answer-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  font-size: 1.1rem;
  font-weight: 600;
}
.answer-stats .stat-correct { color: #28a745; }
.answer-stats .stat-wrong { color: #dc3545; }
.answer-stats i { margin-right: 8px; }


/* ----- 3. Kartu Pembahasan Jawaban ----- */
.answers-review-section h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: #1a3b5d;
  text-align: center;
  margin-top: 50px;
  margin-bottom: 30px;
}

/* Pastikan tidak ada scroll di sini */
.answers-container {
    max-height: none;
    overflow: visible;
}

.answer-item-card {
  background: #ffffff;
  border-radius: 12px;
  margin-bottom: 25px;
  overflow: hidden; /* Penting untuk border-top */
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
  border: 1px solid #e9ecef;
  border-top: 5px solid; /* Warna akan ditentukan oleh kelas .correct atau .wrong */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.answer-item-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.answer-item-card.correct { border-top-color: #28a745; }
.answer-item-card.wrong { border-top-color: #dc3545; }

.answer-item-card .answer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 20px;
  background-color: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}
.answer-item-card .answer-header h3 { font-size: 1.2rem; margin: 0; color: #1a3b5d; }
.answer-item-card.correct .answer-header i { color: #28a745; }
.answer-item-card.wrong .answer-header i { color: #dc3545; }

.answer-item-card .answer-content {
  padding: 20px;
}

.answer-content .question-text {
  font-size: 1.1rem;
  color: #343a40;
  line-height: 1.6;
  margin-bottom: 20px;
}

.answer-details {
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
}
.answer-details .user-answer, .answer-details .correct-answer {
  font-size: 1rem;
  color: #495057;
  font-weight: 500;
}
.answer-details .user-answer { margin-bottom: 10px; }
.answer-details .answer-value {
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  background-color: #e9ecef;
}
.answer-item-card.wrong .user-answer .answer-value { background-color: #f8d7da; color: #721c24; }
.answer-item-card .correct-answer .answer-value { background-color: #d4edda; color: #155724; }

.explanation-box {
  margin-top: 20px;
  padding: 15px;
  background: #eef7ff;
  border-left: 4px solid #0d6efd;
  border-radius: 8px;
}
.explanation-box .explanation-title {
  font-weight: 700;
  color: #0d6efd;
  margin-bottom: 8px;
}
.explanation-box .explanation-title i { margin-right: 8px; }


/* ----- 4. Tombol Footer & Responsivitas ----- */
.results-footer {
  margin: 40px 0;
  padding-top: 30px;
  border-top: 1px solid #e9ecef;
  text-align: center;
}

/* Tampilan Mobile (layar di bawah 768px) */
@media (max-width: 768px) {
  #results-page-container.active {
    padding: 15px 10px;
  }
  .results-header h1 { font-size: 1.75rem; }
  .results-header p { font-size: 1rem; }
  .total-score-circle { width: 150px; height: 150px; }
  .total-score-circle strong { font-size: 3rem; }
  .sub-scores-grid { grid-template-columns: 1fr; } /* Stack sub-skor di mobile */
  .answer-stats { flex-direction: column; gap: 15px; }
  .results-content-wrapper { margin: 10px auto; }
  .results-summary-card { padding: 20px; }
  .answer-item-card .answer-content { padding: 15px; }
}















/* Add to your CSS file */
#loading-overlay .loading-spinner {
  font-size: 3rem;
  color: #007bff;
  margin-bottom: 1rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.fa-spin {
  animation: spin 1s linear infinite;
}

/* Add this to your CSS file */
.dashboard-table-wrapper {
  margin: 20px 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.table-search-container {
  padding: 12px;
  background: #f5f7fa;
}

.table-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.dashboard-table {
  width: 100%;
  border-collapse: collapse;
}

.dashboard-table th,
.dashboard-table td {
  padding: 12px;
  border-bottom: 1px solid #eee;
}

.dashboard-table th {
  background: #f5f7fa;
  font-weight: 600;
  text-align: left;
}

.dashboard-table tbody tr:hover {
  background: #f9fafc;
}

.table-pagination-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: #f5f7fa;
}

