@font-face {
  font-family: "UthmanicHafs";
  src: url("/static/fonts/qcf-uthmanic-digital.woff2") format("woff2");
}

@font-face {
  font-family: "LPMQIsepMisbah";
  src: url("/static/fonts/LPMQIsepMisbah-Regular.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
}

:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
  --light-color: #ecf0f1;
  --dark-color: #2c3e50;
  --soft1: rgba(240, 240, 255, 0.6);
  --soft2: rgba(245, 255, 240, 0.6);
  --row1: rgba(255, 255, 255, 0.9);
  --row2: rgba(250, 250, 250, 0.9);
  --muted: #6c757d;
  --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.1);
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  color: var(--dark-color);
}

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

h3 {
  color: var(--primary-color);
  font-weight: 600;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 10px;
}

h3:after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--secondary-color);
}

/* Navigation Styles */
.navigation {
  padding: 15px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.navigation:hover {
  box-shadow: var(--shadow-hover);
}

.navigation.sticky-top {
  position: sticky;
  top: 0;
  z-index: 1020;
  border-radius: 12px 12px 0 0;
}

.btn {
  border-radius: 8px;
  font-weight: 500;
  padding: 8px 16px;
  transition: all 0.2s ease;
}

.btn-sm {
  padding: 3px 9px;
  font-size: 0.74rem;
  border-radius: 6px;
}

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

.btn-primary {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-primary:hover {
  background-color: #2980b9;
  border-color: #2980b9;
}

.btn-outline-primary {
  color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.btn-outline-primary:hover {
  background-color: var(--secondary-color);
  color: white;
}

.form-control,
.form-select {
  border-radius: 8px;
  border: 1px solid #ddd;
  padding: 10px 12px;
  transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.25);
}

/* Quran Content Styles */
.quran-content {
  margin-top: 1.5rem;
  font-size: 1.3rem;
  line-height: 2;
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.ayat-item {
  margin-bottom: 1.5rem;
  padding: 15px;
  border-radius: 10px;
  position: relative;
}

/* Warna berbeda untuk baris ganjil dan genap */
.ayat-item:nth-child(odd) {
  background: var(--row1);
  border-left: 4px solid var(--secondary-color);
}

.ayat-item:nth-child(even) {
  background: var(--row2);
  border-left: 4px solid var(--primary-color);
}

/* Hapus efek hover yang menyebabkan gerakan */
.ayat-item:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.ayat-number {
  background: var(--accent-color);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-weight: 700;
  margin-right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ayat-text {
  line-height: 2;
}

.word {
  padding: 5px 10px;
  border-radius: 8px;
  margin: 3px;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-block;
  position: relative;
}

.word:nth-child(odd) {
  background: var(--soft1);
}

.word:nth-child(even) {
  background: var(--soft2);
}

.word:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
  background: rgba(52, 152, 219, 0.1);
}

.word[data-tooltip] {
  position: relative;
}

.word[data-tooltip]::after,
.word[data-tooltip]::before {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.word[data-tooltip]:hover::after,
.word[data-tooltip]:hover::before {
  opacity: 1;
}

.word[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, -12px);
  background: rgba(33, 37, 41, 0.95);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 1.05rem;
  font-weight: 600;
  white-space: nowrap;
  z-index: 50;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.word[data-tooltip]:hover::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translate(-50%, -2px);
  border-width: 8px;
  border-style: solid;
  border-color: rgba(33, 37, 41, 0.95) transparent transparent transparent;
  z-index: 49;
}

.word[data-tooltip-type="arabic"]:hover::after {
  font-family: "LPMQIsepMisbah", "UthmanicHafs", "Amiri Quran", "Scheherazade New", serif;
  font-size: 1.5rem;
  direction: rtl;
  text-align: right;
  white-space: normal;
  line-height: 1.6;
}

.word[data-tooltip-type="latin"]:hover::after {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1.15rem;
}

.stop-indicator {
  width: 10px;
  height: 10px;
  background: var(--accent-color);
  border-radius: 50%;
  display: inline-block;
  vertical-align: middle;
  margin: 0 6px;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
}

.ayat-text.short-view sub {
  font-size: 0.65em;
  bottom: -0.25em;
  position: relative;
  opacity: 0.85;
}

.arabic {
  direction: rtl;
  text-align: right;
  font-family: "LPMQIsepMisbah", "UthmanicHafs", "Amiri Quran", "Scheherazade New", serif;
  font-size: 1.8rem;
  font-feature-settings: "liga" 1, "calt" 1;
  unicode-bidi: bidi-override;
  white-space: normal;
  word-break: break-word;
  line-height: 2.2;
  color: var(--primary-color);
}

/* Modal Styles */
.modal-content {
  border-radius: 12px;
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal-header {
  background-color: var(--primary-color);
  color: white;
  border-radius: 12px 12px 0 0;
  border-bottom: none;
}

.modal-title {
  font-weight: 600;
}

.modal-footer {
  border-top: none;
  background-color: #f8f9fa;
  border-radius: 0 0 12px 12px;
}

.readonly-field {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  margin-bottom: 10px;
  border-left: 3px solid var(--secondary-color);
}
.readonly-display {
  font-size: 1.25rem; /* lebih besar dari normal */
  font-weight: 500;
  padding: 4px 0;
  border-bottom: 1px solid #e9ecef; /* garis tipis bawah */
}

.editable-area {
  margin-top: 15px;
}

.page-info-small {
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 500;
}

.page-info-small-bottom {
  font-size: 0.9rem;
  color: var(--muted);
  text-align: center;
  margin-top: 15px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 8px;
}

.bg-warning {
  background-color: #fff3cd !important;
  border-radius: 4px;
}

/* Loading Spinner */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Style untuk Judul Surat - Background yang Serasi */
.surah-header {
  margin-bottom: 1.2rem;
  padding: 0.8rem 1rem;
  background: linear-gradient(
    135deg,
    #3498db 0%,
    #2980b9 100%
  ); /* Gradasi biru yang serasi */
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3); /* Shadow biru */
  border-left: 5px solid #1f4e79; /* Border biru gelap */
}

.surah-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.95rem;
  font-weight: 600;
  color: white; /* Teks putih untuk kontras */
}

.surah-number {
  font-weight: 700;
  margin-right: 0.3rem;
  color: #fff;
  flex-shrink: 0; /* Pastikan tidak menyusut */
}

.surah-indo {
  font-weight: 600;
  color: #fff;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.separator {
  margin: 0 0.5rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 300;
  font-size: 1.2rem;
  flex-shrink: 0; /* Pastikan tidak menyusut */
  display: inline-block; /* Pastikan tampil */
}

.bismillah {
  font-family: "LPMQIsepMisbah", "UthmanicHafs", "Amiri Quran", "Scheherazade New", serif;
  font-size: 1.9rem;
  color: #fff;
  font-weight: 500;
  flex: 2;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.surah-arabic {
  font-family: "LPMQIsepMisbah", "UthmanicHafs", "Amiri Quran", "Scheherazade New", serif;
  font-size: 1.9rem;
  color: #fff;
  font-weight: 500;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
}

/* Style untuk ayat-item yang memiliki surah-header */
.ayat-item:has(.surah-header) {
  border-top: 3px solid #3498db; /* Border biru yang sama */
  padding-top: 1.5rem;
  margin-top: 0.5rem;
}

/* Perbaikan tampilan untuk tipe konten yang berbeda */
.ayat-text.trans-view,
.ayat-text.id-view,
.ayat-text.en-view,
.ayat-text.short-view {
  font-style: normal;
  line-height: 1.8;
}

.ayat-text.short-view sub {
  font-size: 0.65em;
  bottom: -0.25em;
  position: relative;
  opacity: 0.85;
  color: #2c3e50;
}

/* Tambahkan class berdasarkan tipe konten */
/* Word styling retains alternating background from general .word rules */

/* Highlight untuk kata yang diedit */
.word.bg-warning {
  background-color: #fff3cd !important;
  border-radius: 4px;
  box-shadow: 0 0 0 2px #ffc107;
  transition: all 0.3s ease;
  position: relative;
  z-index: 10;
}

/* Animasi pulse untuk highlight */
@keyframes highlightPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(255, 193, 7, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 193, 7, 0);
  }
}

.word.bg-warning {
  animation: highlightPulse 1.5s ease-in-out;
}

/* PERBAIKAN: Highlight untuk kata yang diupdate secara massal */
.word.bg-info {
  background-color: #d1ecf1 !important;
  border-radius: 4px;
  box-shadow: 0 0 0 2px #bee5eb;
  transition: all 0.3s ease;
  position: relative;
  z-index: 9;
}

/* Animasi untuk highlight info */
@keyframes highlightInfoPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(91, 192, 222, 0.7);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(91, 192, 222, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(91, 192, 222, 0);
  }
}

.word.bg-info {
  animation: highlightInfoPulse 1.5s ease-in-out;
}

/* Bottom Navigation Styles */
.navigation {
  padding: 15px 20px;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.navigation:hover {
  box-shadow: var(--shadow-hover);
}

.ayat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* QA Modal Tailwind-inspired styling */
.qa-modal-dialog {
  max-width: 720px;
}

.qa-modal {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  box-shadow: 0 22px 45px rgba(15, 23, 42, 0.18);
}

.qa-modal-header {
  background: linear-gradient(135deg, #334155 0%, #0f172a 100%);
  color: #f8fafc;
  border: none;
  border-radius: 18px 18px 0 0;
  padding: 20px 24px;
}

.qa-modal-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.qa-modal-subtitle {
  font-size: 0.85rem;
  font-weight: 500;
  color: rgba(226, 232, 240, 0.8);
  margin-left: 0.5rem;
}

.qa-modal-body {
  background: #f8fafc;
  padding: 24px;
}

.qa-modal-footer {
  background: #e2e8f0;
  border: none;
  border-radius: 0 0 18px 18px;
  padding: 16px 24px;
}

.qa-status-text {
  font-size: 0.85rem;
  color: #64748b;
}

.tektok-history-table th,
.tektok-history-table td {
  font-size: 0.82rem;
  white-space: nowrap;
}

.tektok-history-table tbody tr td {
  padding-top: 6px;
  padding-bottom: 6px;
}

.qa-accordion {
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qa-accordion-item {
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
}

.qa-question-button {
  background: #ffffff;
  color: #0f172a;
  font-weight: 600;
  font-size: 1rem;
  padding: 16px 22px;
  box-shadow: none;
}

.qa-question-button:focus {
  box-shadow: none;
}

.qa-question-button:not(.collapsed) {
  color: #1d4ed8;
  background: #eff6ff;
  box-shadow: inset 0 -1px 0 rgba(30, 64, 175, 0.15);
}

.qa-question-text {
  display: block;
  line-height: 1.5;
}

.qa-accordion-body {
  background: #f8fafc;
  padding: 20px 24px;
  border-top: 1px solid #e2e8f0;
}

.qa-answer-content {
  color: #1f2937;
  font-size: 0.98rem;
  line-height: 1.7;
}

.qa-answer-content p {
  margin-bottom: 1rem;
}

.qa-answer-content ul,
.qa-answer-content ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

.qa-answer-content li {
  margin-bottom: 0.5rem;
}

.qa-answer-content h1,
.qa-answer-content h2,
.qa-answer-content h3,
.qa-answer-content h4,
.qa-answer-content h5,
.qa-answer-content h6 {
  color: #0f172a;
  font-weight: 600;
  line-height: 1.35;
  margin-top: 1.25rem;
  margin-bottom: 0.75rem;
}

.qa-answer-content h1 {
  font-size: 1.5rem;
}

.qa-answer-content h2 {
  font-size: 1.35rem;
}

.qa-answer-content h3 {
  font-size: 1.2rem;
}

.qa-answer-content h4 {
  font-size: 1.1rem;
}

.qa-answer-content h5 {
  font-size: 1.05rem;
}

.qa-answer-content h6 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.qa-answer-content blockquote {
  border-left: 4px solid #cbd5f5;
  padding-left: 1rem;
  color: #475569;
  font-style: italic;
  margin: 1.2rem 0;
}

.qa-answer-content a {
  color: #2563eb;
  text-decoration: none;
}

.qa-answer-content a:hover {
  text-decoration: underline;
}

.qa-timestamp {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: #94a3b8;
  font-weight: 500;
}

.qa-modal .btn {
  border-radius: 10px;
  font-weight: 600;
}

.qa-modal .btn.btn-secondary {
  background: #cbd5f5;
  border: none;
  color: #1e293b;
}

.qa-modal .btn.btn-primary {
  background: #2563eb;
  border: none;
}

.qa-modal .btn.btn-secondary:hover {
  background: #94a3b8;
}

.qa-modal .btn.btn-primary:hover {
  background: #1d4ed8;
}

/* Perbaikan untuk pageInfoBottom di dalam navigasi */
.page-info-small-bottom {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Footer Container - untuk membuat footer dekat dengan navigasi */
.footer-container {
  margin-top: 0.5rem; /* Jarak minimal dengan navigasi */
  padding: 0 15px; /* Padding sama dengan navigasi */
}

/* Footer Styles */
footer {
  padding: 0.8rem 0;
  background: linear-gradient(
    to right,
    rgba(248, 249, 250, 0.8),
    rgba(233, 236, 239, 0.8)
  );
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.copyright {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.copyright p {
  margin-bottom: 0;
  letter-spacing: 0.3px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .navigation {
    padding: 12px;
  }

  .quran-content {
    padding: 15px;
    font-size: 1.1rem;
  }

  .arabic {
    font-size: 1.5rem;
  }

  .ayat-number {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }

  .footer-container {
    margin-top: 0.3rem;
    padding: 0 10px;
  }

  footer {
    padding: 0.6rem 0;
  }

  .copyright {
    font-size: 0.75rem;
  }

  .surah-header {
    padding: 0.6rem 0.8rem;
    margin-bottom: 1rem;
  }

  .surah-title {
    font-size: 0.85rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .separator {
    display: none; /* Sembunyikan separator di mobile */
  }

  .bismillah,
  .surah-arabic {
    font-size: 1rem;
  }

  .surah-title > span {
    width: 100%;
    text-align: left;
  }

  .page-info-small-bottom {
    max-width: 150px;
    font-size: 0.75rem;
    padding: 6px 8px;
  }

  .navigation .d-flex {
    flex-direction: column;
    gap: 10px;
  }

  .navigation .d-flex.align-items-center {
    justify-content: center;
  }
}

@media (max-width: 576px) {
  .page-info-small-bottom {
    max-width: 100px;
    font-size: 0.7rem;
  }
}
