/* =========================================================
   HIGHLIGHT & TEXT UTILITIES
========================================================= */

.highlight {
  color: var(--color-primary);
}

mark {
  background: #fff2b3;
  padding: 2px 6px;
  border-radius: 4px;
}

.bgkuning {
  background: #f6fe0f;
}

.bgmerah {
  background: #fb7c44;
}

.bghijau {
  background: #4cff2e;
}

/* =========================================================
   TWO COLUMN SYSTEM
========================================================= */
.two-column {
  display: flex;
  align-items: center;
  gap: 32px;
}

/* SETIAP KOLOM */
.two-column .half {
  flex: 1;
}

/* GAMBAR AMAN */
.two-column img {
  height: auto;
  display: block;
}

/* =========================================================
   ORDERED LIST (OL) — RAPI & SEJAJAR DENGAN UL LIST-ICON
========================================================= */
ol {
  margin: 0;
  padding-left: 25px;
  /* samakan dengan ruang ikon UL */
  counter-reset: step;
}

ol li {
  margin-bottom: 8px;
  line-height: 1.45;
  padding-left: 6px;
  /* jarak teks dari angka */
}

/* =========================================================
   OPSIONAL: JIKA INGIN ANGKA LEBIH TEGAS & KONSISTEN
========================================================= */
ol li::marker {
  font-weight: 700;
  color: var(--color-primary-dark);
}

/* =========================================================
   ICON LIST SYSTEM (BASE)
========================================================= */
.list-icon {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.list-icon li {
  position: relative;
  padding-left: 32px;
  /* ruang ikon */
  margin-bottom: 8px;
  line-height: 1.45;
}

/* ICON BASE */
.list-icon li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.25em;
  width: 18px;
  height: 18px;
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

/* =========================================================
   ICON VARIANTS
========================================================= */
/* BENAR (CHECK) */
.list-icon li.benar::before {
  background-image: url('../../icon/check.png');
}

/* SALAH (CROSS) */
.list-icon li.salah::before {
  background-image: url('../../icon/cross.png');
}

/* =========================================================
   BUTTONS
========================================================= */
.btn-primary,
.btn-secondary,
.action-btn.btn-primary {
  display: inline-block;
  margin-top: 24px;
  padding: 14px 26px;
  border-radius: var(--radius-md);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.1s ease;
  /* Tambahan untuk menyetarakan <button> dan <a> */
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

/* PRIMARY */
.btn-primary,
.action-btn.btn-primary {
  background: linear-gradient(180deg, #2a9d66, var(--color-primary-dark));
  color: #fff;
}

.btn-primary:hover,
.action-btn.btn-primary:hover {
  opacity: 0.9;
}

/* SECONDARY */
.btn-secondary {
  background: #fff;
  color: var(--color-primary-dark);
  border: 2px solid var(--color-primary);
}

.btn-secondary:hover {
  background: var(--color-primary);
  color: #fff;
}

/* CLICK FEEDBACK (JS) */
.btn-primary.clicked,
.btn-secondary.clicked,
.action-btn.btn-primary.clicked {
  transform: scale(0.97);
}

/* =========================================================
   NAVIGATION STATES
========================================================= */
.main-nav a {
  display: block;
  padding: 14px 18px;
}

.main-nav a.active {
  background: var(--color-primary);
  color: #fff;
}

/* Badge "Hot" untuk Menu Navigasi */
.nav-menu > li {
  position: relative;
}

.hot-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background-color: #ef4444;
  /* A bright red */
  color: white;
  padding: 2px 5px;
  border-radius: 5px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
  pointer-events: none;
  /* The badge itself isn't clickable */
  z-index: 10;
}

/* =========================================================
   FOOTER TEXT
========================================================= */
.site-footer p {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: 12px;
}

/* =========================================================
   SMALL UTILITIES
========================================================= */
.text-center {
  text-align: center;
}

.mt-24 {
  margin-top: 24px;
}

.mb-24 {
  margin-bottom: 24px;
}

/* =========================================================
   ACTION BUTTONS (Edit, Fullscreen, History)
========================================================= */
.action-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 600;
  font-family:
    'Roboto',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  line-height: 1.4;
  min-width: 120px;
  justify-content: center;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.action-btn:active {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.action-btn-icon {
  font-size: 18px;
  line-height: 1;
  display: inline-block;
}

/* Edit Button */
.action-btn-edit {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: #ffffff;
}

.action-btn-edit:hover {
  background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
}

/* Fullscreen Button */
.action-btn-fullscreen {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: #ffffff;
}

.action-btn-fullscreen:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

/* History Button */
.action-btn-history {
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  color: #ffffff;
}

.action-btn-history:hover {
  background: linear-gradient(135deg, #5a6268 0%, #484f54 100%);
}

/* Save Button */
.action-btn-save {
  background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
  color: #ffffff;
}

.action-btn-save:hover {
  background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
}

/* Cancel Button */
.action-btn-cancel {
  background: #f8f9fa;
  color: #495057;
  border: 2px solid #dee2e6;
}

.action-btn-cancel:hover {
  background: #e9ecef;
  border-color: #adb5bd;
}

/* Delete Button */
.action-btn-delete {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: #ffffff;
}

.action-btn-delete:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

/* Close Button (Fullscreen Modal) */
.action-btn-close {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: #ffffff;
  font-size: 16px;
  padding: 10px 20px;
}

.action-btn-close:hover {
  background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .action-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .action-btn {
    width: 100%;
    min-width: auto;
  }
}

/* =========================================================
   TYPOGRAPHY & AI CONTENT
========================================================= */

/* Roboto default untuk konten AI */
.ql-editor,
#fullscreenContent,
.result-content {
  font-family: 'Roboto', sans-serif !important;
  font-size: 19px;
  line-height: 1.6;
  color: #333;
}

/* KHUSUS TEKS ARAB - HARUS SETELAH ROBOTO AGAR MENANG */
.arabic,
[dir='rtl'],
[dir='rtl'] *,
.ql-editor :lang(ar),
#fullscreenContent :lang(ar),
.result-content :lang(ar) {
  font-family: 'Amiri', serif !important;
  direction: rtl !important;
  text-align: right !important;
  font-weight: 700 !important;
  unicode-bidi: isolate !important;
}

/* Override heading styles inside AI content */
.ql-editor h1,
#fullscreenContent h1,
.result-content h1 {
  font-size: 28px !important;
  margin-bottom: 15px !important;
  border-bottom: 1px solid #eee;
  padding-bottom: 5px;
  color: #000 !important;
}

.ql-editor h2,
#fullscreenContent h2,
.result-content h2 {
  font-size: 22px !important;
  margin-bottom: 12px !important;
  color: ##218838 !important;
}

.ql-editor h2::after,
#fullscreenContent h2::after,
.result-content h2::after {
  display: none !important;
}

/* Spasi paragraf */
.ql-editor p,
#fullscreenContent p,
.result-content p {
  margin-top: 0;
  margin-bottom: 1.2rem;
}

/* Amiri Bold & Rata Kanan untuk Teks Arab */
/* Target lebih luas dan kuat agar tidak ter-override oleh editor */
.arabic,
[dir='rtl'],
[dir='rtl'] *,
.ql-direction-rtl,
.ql-direction-rtl *,
.ql-editor .arabic,
.ql-editor [dir='rtl'],
.ql-editor .ql-direction-rtl,
#fullscreenContent .arabic,
#fullscreenContent [dir='rtl'],
#fullscreenContent .ql-direction-rtl,
#fullscreenContent [dir='rtl'] *,
.result-content .arabic,
.result-content [dir='rtl'],
.result-content .ql-direction-rtl,
.result-content [dir='rtl'] * {
  font-family: 'Amiri', serif !important;
  font-weight: 700 !important;
  direction: rtl !important;
  text-align: right !important;
  unicode-bidi: isolate;
}

/* Memastikan elemen blok dalam mode RTL benar-benar rata kanan */
p[dir='rtl'],
div[dir='rtl'],
li[dir='rtl'],
.ql-direction-rtl,
.ql-editor p[dir='rtl'],
.ql-editor .ql-direction-rtl,
#fullscreenContent p[dir='rtl'],
#fullscreenContent .ql-direction-rtl,
.result-content p[dir='rtl'],
.result-content .ql-direction-rtl {
  text-align: right !important;
  display: block !important;
}

/* Ukuran khusus teks arab dalam konten */
/* Editor (Dikecilkan sedikit agar tidak terlalu dominan di layar edit) */
.ql-editor .arabic,
.ql-editor [dir='rtl'],
.ql-editor .ql-direction-rtl {
  font-size: 25px !important;
  display: block;
  margin: 1rem 0;
  line-height: 1.6 !important;
}

/* Preview & Fullscreen (Dibesarkan agar sangat jelas dibaca) */
#fullscreenContent .arabic,
#fullscreenContent [dir='rtl'],
.result-content .arabic,
.result-content [dir='rtl'] {
  font-size: 35px !important;
  /* Ukuran ditingkatkan agar lebih mantap dibaca */
  display: block;
  margin: 1.5rem 0;
  line-height: 1.8 !important;
}

/* =========================================================
   QUILL EDITOR STYLE ADJUSTMENTS
========================================================= */
#editor-container {
  height: 600px;
  /* Tinggi kotak editor tetap */
  background: #fff;
  border-radius: 8px;
  border: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ql-toolbar {
  background: #f8fafc;
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: 1px solid #ddd !important;
}

.ql-container {
  font-size: 19px;
  flex: 1;
  overflow: hidden;
  /* Biarkan ql-editor yang scroll */
  border: none !important;
}

.ql-editor {
  height: 100%;
  overflow-y: auto !important;
  /* Scrollbar muncul di sini */
  padding: 30px !important;
}

/* Memastikan scrollbar editor selalu terlihat di sebelah kanan */
.ql-editor::-webkit-scrollbar {
  width: 10px;
}

.ql-editor::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.ql-editor::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 5px;
}

.ql-editor::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.result-display-container {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #ddd;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.result-content {
  padding: 30px;
  min-height: 300px;
}
