/* === Reset dasar === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  background: #f8f9fa;
  color: #212529;
  line-height: 1.6;
}

/* === Running Text (Marquee Fixed) === */
#runningText {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: #222;
  color: #fff;
  font-size: 16px;
  padding: 6px 10px;
  z-index: 1000;
  white-space: nowrap;
  overflow: hidden;
}

#runningText span {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 15s linear infinite;
}

@keyframes marquee {
  from {
    transform: translateX(0%);
  }
  to {
    transform: translateX(-100%);
  }
}

/* === Sidebar dan Wrap === */
#wrap {
  display: flex;
  min-height: 100vh;
}


/* Sidebar */
#sidebar {
  width: 250px;
  min-height: 200px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 10px;
  border-right: 1px solid #ccc;
  background: #f9f9f9;

  /* Scrollbar halus */
  scrollbar-width: thin;
  scrollbar-color: #ccc #f9f9f9;
}

#sidebar input {
  width: 100%;
  padding: 6px;
  margin-bottom: 10px;
  border: 1px solid #aaa;
  border-radius: 4px;
}

#sidebarList {
  font-size: 14px;
  line-height: 1.1;  
}

/* Judul Bab di Sidebar */
#sidebarList h4 {
  color: #444;
  font-size: 15px;
  font-weight: bold;
  margin: 10px 0 6px;
  padding: 4px 8px;
  border-left: 4px solid #0066cc;
  background: #f0f8ff;
  border-radius: 4px;
  
}

/* Materi aktif/tidak aktif */
#sidebarList li.materi-active {
  color: blue;
  cursor: pointer;
  font-weight: 500;
  background: #e6f0ff;
  border-radius: 4px;
  padding: 2px 6px;
  
}

#sidebarList li.materi-inactive {
  color: #888;
  cursor: pointer;
  font-style: italic;
}

/* === Konten utama === */
#main {
  flex: 1;
  padding: 16px;
}

.controls-top {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.controls-top button {
  padding: 6px 10px;
  border: 1px solid #444;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.controls-top button:hover {
  background: #ddd;
}

h1#judul {
  margin-bottom: 10px;
  font-size: 22px;
  color: #333;
}

/* === Area visual (foto + canvas) === */
.visual-area {
  position: relative;
  margin-bottom: 12px;
}

.visual-area img {
  width: 70%;
  max-width: 2500px;
  height: auto;
  max-height: 2500px;
  object-fit: contain;
  display: block;
  margin-bottom: 10px;
  border: 2px solid #ccc;
  border-radius: 6px;
}

/* === Canvas Interaktif === */
#kanvas {
  cursor: pointer;
  background: transparent;
  border: 2px dashed #555;
  display: block;
  touch-action: none;
}

/* === Status Label === */
#statusLabel {
  margin-bottom: 10px;
  font-size: 14px;
  color: #555;
}

/* === Section Konten === */
section#konten .section {
  margin-bottom: 16px;
  padding: 10px;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
}

section#konten h3 {
  margin-bottom: 6px;
  font-size: 16px;
  color: #222;
}

/* === Tools bawah === */
#tools {
  margin: 12px 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

#tools button {
  padding: 6px 12px;
  border: 1px solid #444;
  background: #fff;
  border-radius: 4px;
  cursor: pointer;
}

#tools button:hover {
  background: #ddd;
}

/* === Toolbar Tulis === */
#toolbar_tulis {
  margin: 8px 0;
  padding: 8px;
  background: #e9ecef;
  border: 2px solid #555;
  border-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

#toolbar_tulis button {
  padding: 6px 12px;
  border: 1px solid #444;
  background: #fff;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
  transition: background 0.2s;
}

#toolbar_tulis button:hover {
  background: #ddd;
}


/* Slider ukuran pena */
#toolbar_tulis input[type=range] {
  accent-color: #444;
  cursor: pointer;
}

.slider .judul-materi {
  white-space: normal;   /* biar teks panjang turun baris */
  line-height: 0.5;      /* atur tinggi baris */
  margin-bottom: 1px;    /* jarak antar judul */
}

/* Tombol pena berwarna (bulat) */
#toolbar_tulis .pen {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid #333;
  padding: 0;
}

#toolbar_tulis .pen[data-color="#0000ff"] { background: #0000ff; }
#toolbar_tulis .pen[data-color="#ffc107"] { background: #ffc107; }
#toolbar_tulis .pen[data-color="#28a745"] { background: #28a745; }
#toolbar_tulis .pen[data-color="#dc3545"] { background: #dc3545; }

/* === Popup Quran === */
#quranPopup h3 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: bold;
}

#quranPopup .arab {
  font-size: 20px;
  direction: rtl;
  text-align: right;
  margin-bottom: 6px;
}

#quranPopup .id {
  font-size: 14px;
  margin-bottom: 6px;
}

#quranPopup .tafsir-link {
  display: inline-block;
  margin-top: 6px;
  color: #007bff;
  text-decoration: none;
  font-size: 13px;
}
#quranPopup .tafsir-link:hover {
  text-decoration: underline;
}

/* === Responsif === */
@media (max-width: 768px) {
  #wrap {
    flex-direction: column;
  }
  #sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 2px solid #ccc;
  }
  .controls-top {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* === Isi dalam kotak materi === */
#tujuan,
#materi,
#cerita,
#muhasabah,
#pertanyaan,
#testimoni,
#refrensi {
  padding: 12px 14px;
  text-align: justify;
  line-height: 1.6;
}

.closed-message {
  font-family: "Georgia", serif;
  font-style: italic;
  font-size: 20px;
  font-weight: bold;
  color: red;
  text-align: center;
  padding: 10px;
}

