/* =====================================================
   ROOT VARIABLES (LIGHT MODE)
===================================================== */
:root {
  --primary-color: #714b67;
  --secondary-color: #017e84;
  --success-color: #28a745;
  --danger-color: #dc3545;

  --bg-color: #f9f9f9;
  --card-bg: #ffffff;
  --text-color: #333;
  --muted-text: #666;

  --border-radius: 12px;
  --font-main: "Inter", sans-serif;
}

/* =====================================================
   DARK MODE VARIABLES
===================================================== */
body.dark {
  --bg-color: #121212;
  --card-bg: #1f1f1f;
  --text-color: #e5e5e5;
  --muted-text: #aaa;
}

/* =====================================================
   LANGUAGE VISIBILITY
===================================================== */
body[data-lang="id"] .lang-en { display: none !important; }
body[data-lang="en"] .lang-id { display: none !important; }

/* =====================================================
   BASE
===================================================== */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  background: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  padding-bottom: 60px;
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}

/* =====================================================
   HEADER
===================================================== */
.header {
  text-align: center;
  margin-bottom: 40px;
}

h1 {
  font-size: 2.2rem;
  margin-top: 15px;
}

.subtitle {
  color: var(--muted-text);
  font-size: 1.1rem;
}

/* =====================================================
   BADGE & ANIMATION
===================================================== */
.badge {
  background: #efe6ed;
  color: var(--primary-color);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
}

.materi-badge {
  margin-top: 15px;
  display: inline-block;
  background: var(--success-color);
  color: #fff;
  padding: 8px 16px;
  border-radius: 30px;
  font-weight: 700;
  animation: badgePop 0.6s ease;
}

@keyframes badgePop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }

  60% {
    transform: scale(1.1);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* =====================================================
   PROGRESS BAR (UPDATED)
===================================================== */
.progress-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  padding: 15px 50px 35px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  transition: padding 0.3s;
}

.progress-container {
  width: 100%;
  height: 12px;
  background: #e5e5e5;
  border-radius: 999px;
  position: relative;
  overflow: visible;
  /* PENTING: Agar label yang nongol ke atas tidak hilang */
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background-color: #ddd;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.6s ease;
  position: relative;
}

/* Glow halus */
.progress-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg,
      rgba(255, 255, 255, 0.35),
      transparent 60%);
  opacity: 0.6;
}

/* Text */
.progress-text {
  margin-top: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-color);
}

/* =====================================================
   CONTAINER
===================================================== */
.container {
  max-width: 900px;
  margin: 40px auto;
  padding: 0 20px;
}

/* =====================================================
   STEP / CARD
===================================================== */
.step-card {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 30px;
  margin-bottom: 30px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: transform 0.2s, box-shadow 0.2s;
}

.step-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

/* =====================================================
   STEP FOOTER (CHECKBOX RIGHT BOTTOM)
===================================================== */
.materi-1-step-footer,
.step-footer {
  margin-top: 30px;
  padding-top: 15px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.mark-done {
  width: 22px;
  height: 22px;
  accent-color: var(--secondary-color);
  cursor: pointer;
  transform: scale(1.2);
}

/* =====================================================
   IMAGE PLACEHOLDER (AMAN UNTUK GAMBAR)
===================================================== */
.image-placeholder {
  margin-top: 20px;
  border-radius: 8px;
  border: 2px dashed #ccc;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fafafa;
}

body.dark .image-placeholder {
  background: #1a1a1a;
}

.image-placeholder img {
  max-width: 100%;
  display: block;
}

.image-placeholder.missing {
  padding: 40px;
  color: var(--muted-text);
}

.placeholder-text {
  display: none;
}

.image-placeholder.missing .placeholder-text {
  display: block;
}

/* =====================================================
   QUIZ
===================================================== */
.quiz-question {
  margin-bottom: 25px;
}

.quiz-options {
  list-style: none;
  padding: 0;
}

.quiz-options li {
  margin-bottom: 10px;
}

.quiz-submit-btn {
  background: var(--secondary-color);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.quiz-submit-btn:hover {
  opacity: 0.9;
}

/* Fix visibility for disabled inputs in Dark Mode */
body.dark .quiz-options input[type="radio"]:disabled+label,
body.dark .quiz-options input[type="radio"]:disabled {
  opacity: 1 !important;
  color: #e5e5e5;
}

body.dark .quiz-options label {
  color: #e5e5e5;
}

/* =====================================================
   QUIZ PROGRESS
===================================================== */
.quiz-progress-wrapper {
  height: 6px;
  background: #ddd;
  border-radius: 4px;
  margin-bottom: 20px;
}

.quiz-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--success-color);
  transition: width 0.4s ease;
}

/* =====================================================
   LOCKED MATERI
===================================================== */
.locked {
  position: relative;
  opacity: 0.5;
  pointer-events: none;
}

.lock-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--danger-color);
  border-radius: var(--border-radius);
}

body.dark .lock-overlay {
  background: rgba(20, 20, 20, 0.85);
}

/* =====================================================
   FOOTER
===================================================== */
.footer {
  text-align: center;
  margin-top: 60px;
  padding-top: 20px;
  color: var(--muted-text);
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* =====================================================
   DARK MODE TOGGLE BUTTON (OPTIONAL)
===================================================== */
.dark-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--card-bg);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  z-index: 9999;
}

.lang-toggle {
  position: fixed;
  bottom: 20px;
  right: 80px; /* Sebelah kiri tombol dark mode */
  background: var(--card-bg);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 50px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  color: var(--primary-color);
  z-index: 9999;
  min-width: 45px;
}

/* ================================
   FLOATING PROGRESS LABEL (UPDATED)
================================ */
.progress-label {
  position: absolute;
  top: 24px;
  left: 0;
  transform: translateX(-50%);
  background: var(--secondary-color);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  pointer-events: none;
  transition: left 0.6s cubic-bezier(0.4, 0, 0.2, 1), background 0.3s;
  z-index: 10;
}

/* Panah Atas (Label di Bawah) */
.progress-label::after {
  content: "";
  position: absolute;
  /* Pindah posisi panah ke sisi ATAS kotak label */
  top: -5px;
  bottom: auto;
  /* Reset bottom */
  left: 50%;
  transform: translateX(-50%);

  /* Ubah bentuk segitiga jadi menghadap ATAS */
  border-width: 0 5px 5px 5px;
  border-style: solid;
  /* Warna default (sebelum kena class red/yellow/green) */
  border-color: transparent transparent var(--secondary-color) transparent;

  transition: border-color 0.3s;
}


/* ================================
   PROGRESS LABEL COLOR STATES
================================ */
.progress-label.red {
  background: #dc3545;
}

.progress-label.yellow {
  background: #ffc107;
  color: #333;
}

.progress-label.green {
  background: #28a745;
}

/* Warna Dinamis untuk Bar (Sama dengan Label) */
.progress-bar.red {
  background-color: #dc3545;
  /* Merah */
  box-shadow: 0 0 10px rgba(220, 53, 69, 0.4);
  /* Efek glow merah */
}

.progress-bar.yellow {
  background-color: #ffc107;
  /* Kuning */
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.4);
}

.progress-bar.green {
  background-color: #28a745;
  /* Hijau */
  box-shadow: 0 0 10px rgba(40, 167, 69, 0.4);
}

/* Update warna panah sesuai state (Perhatikan urutan transparent-nya berubah) */
.progress-label.red::after {
  border-bottom-color: #dc3545;
  /* Ganti border-top jadi border-bottom */
  border-top-color: transparent;
}

.progress-label.yellow::after {
  border-bottom-color: #ffc107;
  border-top-color: transparent;
}

.progress-label.green::after {
  border-bottom-color: #28a745;
  border-top-color: transparent;
}

/* =====================================================
   DASHBOARD / MENU UTAMA
===================================================== */
.dashboard-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 40px 0 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #eee;
}

.materi-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.materi-card {
  position: relative;
  transition: transform 0.2s, box-shadow 0.2s;
  text-decoration: none;
  /* Biar link gak ada garis bawah */
  color: inherit;
  display: block;
  /* Agar anchor tag full width */
  overflow: hidden;
}

.materi-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.materi-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.materi-card h2 {
  font-size: 1.25rem;
  margin: 10px 0 5px;
  color: var(--primary-color);
}

.materi-card p {
  font-size: 0.95rem;
  color: var(--muted-text);
  margin-bottom: 20px;
}

/* Status Icon (Gembok/Centang) */
.materi-status {
  font-size: 1.2rem;
}

/* Progress Bar Kecil di dalam Card */
.materi-progress {
  height: 6px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.materi-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--secondary-color);
  transition: width 0.5s ease;
}

/* Teks kecil di bawah progress */
.materi-card small {
  font-size: 0.8rem;
  color: #888;
  font-weight: 600;
}

/* Style saat Locked */
.materi-card.locked {
  cursor: not-allowed;
  opacity: 0.7;
}

.materi-card.locked:hover {
  transform: none;
  box-shadow: none;
}

/* =====================================================
   DASHBOARD PROGRESS BAR (KHUSUS DASHBOARD)
===================================================== */

/* Wrapper khusus dashboard: Tidak sticky, lebar terbatas, tengah */
.dashboard-progress-wrapper {
  background: var(--card-bg);
  padding: 25px;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  max-width: 600px;
  /* Batasi lebar agar enak dilihat */
  margin: 30px auto 10px auto;
  /* Tengah secara horizontal */
  position: relative;
  text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Header kecil di atas bar (Teks "Progres Keseluruhan") */
.dashboard-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-weight: 600;
  color: var(--primary-color);
  font-size: 0.95rem;
}

.dashboard-percent-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--secondary-color);
}

/* Container Bar di Dashboard */
.dashboard-bar-container {
  height: 12px;
  background-color: #eee;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
}

/* Bar-nya sendiri */
.dashboard-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--secondary-color), var(--success-color));
  border-radius: 20px;
  transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Warna dinamis bar dashboard */
.dashboard-bar-fill.red {
  background: #dc3545;
}

.dashboard-bar-fill.yellow {
  background: #ffc107;
}

.dashboard-bar-fill.green {
  background: #28a745;
}

/* =====================================================
   NEXT MATERIAL BUTTON AREA
===================================================== */
.next-action-area {
  margin-top: 40px;
  text-align: center;
  padding: 40px;
  background: #e8f5e9;
  /* Hijau muda lembut */
  border-radius: 16px;
  border: 1px solid #c8e6c9;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Judul selamat */
.next-action-area h3 {
  margin-top: 0;
  color: #2e7d32;
  font-size: 1.5rem;
}

.next-action-area p {
  color: #4caf50;
  margin-bottom: 25px;
}

/* Tombol Lanjut */
.btn-next {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--secondary-color);
  color: white;
  padding: 14px 28px;
  border-radius: 50px;
  /* Pill shape */
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(1, 126, 132, 0.3);
}

.btn-next:hover {
  background: #016266;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(1, 126, 132, 0.4);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dark mode adjustment */
body.dark .next-action-area {
  background: #1b2e1e;
  border-color: #2e7d32;
}

body.dark .next-action-area h3 {
  color: #81c784;
}

body.dark .next-action-area p {
  color: #a5d6a7;
}

/* =========================================
   KOMPONEN TAMBAHAN (DEEP DIVE / INFO BOX)
   ========================================= */

/* Default (Light Mode) */
.deep-dive {
  background-color: #f8f9fa;
  /* Abu-abu sangat muda */
  border-left: 4px solid #714b67;
  /* Ungu Odoo */
  padding: 15px;
  margin-top: 20px;
  border-radius: 4px;
  color: #333;
  /* Teks gelap */
}

.deep-dive h3 {
  margin-top: 0;
  color: #714b67;
  font-size: 1rem;
  font-weight: 700;
}

.deep-dive ul {
  margin-bottom: 0;
  padding-left: 20px;
}

.deep-dive p {
  margin-bottom: 10px;
}

.deep-dive ul li strong {
  padding: 2px 6px;
  border-radius: 4px;
}

/* Warna sesuai standar Odoo */
.overdue {
  background-color: #dc3545;
}

/* Merah */
.today {
  background-color: #ffc107;
  color: #212529 !important;
}

/* Kuning/Oranye */
.future {
  background-color: #28a745;
}

/* Hijau */
.planned {
  background-color: #6c757d;
}

/* Abu-abu */

/* Dark Mode Support untuk Deep Dive */
body.dark .deep-dive {
  background-color: #2c2c2c;
  /* Background Gelap */
  border-left: 4px solid #d4a5c9;
  /* Garis ungu lebih terang */
  color: #e0e0e0;
  /* Teks Putih Gading */
}

body.dark .deep-dive h3 {
  color: #d4a5c9;
  /* Judul Ungu Terang */
}

body.dark .deep-dive ul li,
body.dark .deep-dive p,
body.dark .deep-dive strong {
  color: #e0e0e0;
  /* Pastikan semua isi teks terbaca */
}

/* =========================================
   ALERT BOXES (WARNING & DANGER)
   ========================================= */

.alert {
  padding: 15px;
  margin: 20px 0;
  border: 1px solid transparent;
  border-radius: 4px;
  border-left-width: 5px;
  /* Garis tebal di kiri */
}

/* --- WARNING (KUNING) --- */
.alert.warning {
  color: #856404;
  background-color: #fff3cd;
  border-color: #ffeeba;
  border-left-color: #ffc107;
}

/* --- DANGER (MERAH) --- */
.alert.danger {
  color: #721c24;
  background-color: #f8d7da;
  border-color: #f5c6cb;
  border-left-color: #dc3545;
}

/* --- INFO (BIRU - Opsional) --- */
.alert.info {
  color: #0c5460;
  background-color: #d1ecf1;
  border-color: #bee5eb;
  border-left-color: #17a2b8;
}


/* =====================================================
   DARK MODE SUPPORT FOR ALERTS
   ===================================================== */

body.dark .alert.warning {
  background-color: #3e3006;
  color: #ffda6a;
  border-color: #584c08;
}

body.dark .alert.danger {
  background-color: #491217;
  /* Merah Gelap */
  color: #ffb3b3;
  border-color: #6a1a21;
}

body.dark .alert.info {
  background-color: #0d3c45;
  /* Biru Gelap */
  color: #aaddff;
  border-color: #16525e;
}

/* =====================================================
   LIGHTBOX (IMAGE ZOOM)
===================================================== */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(5px);
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-image {
  max-width: 90%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.lightbox-overlay.active .lightbox-image {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 2.5rem;
  font-weight: bold;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: all 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* Cursor pointer for zoomable images */
.image-placeholder img,
.content img {
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.image-placeholder img:hover,
.content img:hover {
  transform: scale(1.02);
}


/* =========================================
   TECHNICAL TABLE (SMTP CONFIG)
   ========================================= */
.technical-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 0.9em;
  color: inherit;
  /* Ikuti warna parent */
}

.technical-table tr {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.technical-table td {
  padding: 6px 4px;
}

.technical-table td:first-child {
  font-weight: 600;
  width: 35%;
}

/* Dark Mode Adjustment for Table */
body.dark .technical-table tr {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* =====================================================
   QUIZ COMPLETED STATE (READABLE)
   ===================================================== */
.quiz-status-banner {
  background-color: #d4edda;
  color: #155724;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
  border: 1px solid #c3e6cb;
  font-weight: 600;
  animation: slideDown 0.5s ease;
}

body.dark .quiz-status-banner {
  background-color: #1e4620;
  color: #a5d6a7;
  border-color: #2e7d32;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hilangkan style .locked lama yang bikin blur */
.locked {
  opacity: 1 !important;
  /* Force readable */
  pointer-events: auto !important;
  /* Allow scroll/select text */
}

/* Lock overlay lama (jika masih ada sisa) - hide aja */
.lock-overlay {
  display: none !important;
}

/* Visual cue for disabled inputs */
.quiz-completed-view input[type="radio"]:disabled {
  cursor: not-allowed;
}

.quiz-completed-view label {
  cursor: default;
  opacity: 1 !important;
  /* Pastikan label tetap jelas */
}