/* ==========================================================================
   quran-dua.css — Вкладка «Дуа из Корана»
   ========================================================================== */

/* --- Контейнер вкладки: на всю ширину, скролл страницы --- */
#tab-dua {
  overflow-y: auto;
  padding: 24px 32px;
}

/* --- Заголовок --- */
.dua-header {
  text-align: center;
  margin-bottom: 20px;
}

.dua-title {
  font-family: var(--font-arabic, 'Amiri', serif);
  font-size: 1.6rem;
  color: var(--emerald, #059669);
  direction: rtl;
  margin: 0 0 4px;
}

.dua-subtitle {
  font-size: 0.85rem;
  color: var(--medium-gray, #888);
  margin: 0;
}

/* --- Фильтры (горизонтальные pills) --- */
.dua-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 16px;
}

.dua-filter {
  padding: 5px 14px;
  border: 1.5px solid #d1fae5;
  border-radius: 20px;
  background: transparent;
  color: #6b7280;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.dua-filter:hover {
  border-color: var(--emerald, #059669);
  color: var(--emerald, #059669);
  background: color-mix(in srgb, var(--emerald) 4%, transparent);
}

.dua-filter.active {
  background: var(--emerald, #059669);
  border-color: var(--emerald, #059669);
  color: #fff;
}

.dua-filter-count {
  font-size: 0.65rem;
  opacity: 0.7;
  margin-inline-start: 2px;
}

/* --- Поиск --- */
.dua-search-bar {
  margin-bottom: 20px;
}

.dua-search-bar input {
  width: 100%;
  padding: 10px 16px;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  font-size: 0.85rem;
  background: var(--quran-bg, #fff);
  color: var(--quran-text, #333);
  outline: none;
  box-sizing: border-box;
  transition: border-color 0.15s;
}

.dua-search-bar input:focus {
  border-color: var(--emerald, #059669);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--emerald) 10%, transparent);
}

/* --- Сетка дуа: 3 в строку --- */
.dua-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.dua-empty {
  text-align: center;
  color: var(--medium-gray, #888);
  padding: 40px;
  font-size: 0.9rem;
}

/* --- Карточка дуа --- */
.dua-card {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  background: #fff;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.dua-card:hover {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border-color: #d1fae5;
}

/* Арабский текст дуа */
.dua-card-arabic {
  font-family: var(--font-arabic, 'Amiri', serif);
  font-size: 1.4rem;
  line-height: 2;
  color: var(--quran-arabic, #1a1a1a);
  text-align: center;
  margin-bottom: 10px;
  padding: 8px 0;
}

/* Полный перевод аята */
.dua-card-translation {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--quran-text, #333);
  text-align: center;
  margin-bottom: 6px;
}

/* Русский заголовок (fallback если нет перевода) */
.dua-card-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--quran-text, #333);
  text-align: center;
  margin-bottom: 6px;
}

/* Контекст */
.dua-card-context {
  font-size: 0.78rem;
  color: var(--medium-gray, #888);
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.5;
  font-style: italic;
}

/* Мета-информация */
.dua-card-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.dua-card-ref {
  font-size: 0.75rem;
  color: var(--emerald, #059669);
  text-decoration: none;
  font-weight: 500;
}

.dua-card-ref:hover {
  text-decoration: underline;
}

.dua-prophet-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  background: rgba(197, 160, 89, 0.1);
  border: 1px solid rgba(197, 160, 89, 0.2);
  border-radius: 12px;
  color: #a8873d;
  font-weight: 500;
}

.dua-card-category {
  font-size: 0.68rem;
  color: var(--medium-gray, #999);
}

/* Кнопки действий */
.dua-card-actions {
  display: flex;
  justify-content: center;
  gap: 4px;
  padding-top: 4px;
}

.dua-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--medium-gray, #888);
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}

.dua-action-btn:hover {
  background: color-mix(in srgb, var(--emerald) 8%, transparent);
  color: var(--emerald, #059669);
}


/* ==========================================================================
   Модалка полного дуа
   ========================================================================== */

.dua-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.dua-modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
}

.dua-modal-close {
  position: absolute;
  top: 12px; right: 14px;
  width: 32px; height: 32px;
  border: none;
  background: transparent;
  color: var(--medium-gray, #888);
  font-size: 1.4rem;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dua-modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
}

.dua-modal-arabic {
  font-family: var(--font-arabic, 'Amiri', serif);
  font-size: 1.5rem;
  line-height: 2.2;
  color: var(--quran-arabic, #1a1a1a);
  text-align: center;
  margin-bottom: 16px;
  padding: 12px 0;
}

.dua-modal-translation {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--quran-text, #333);
  text-align: center;
  margin-bottom: 12px;
}

.dua-modal-context {
  font-size: 0.8rem;
  color: var(--medium-gray, #888);
  text-align: center;
  font-style: italic;
  margin-bottom: 16px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--emerald) 4%, transparent);
  border-radius: 8px;
}

.dua-modal-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.dua-modal-ref {
  font-size: 0.8rem;
  color: var(--emerald, #059669);
  font-weight: 500;
}

.dua-modal-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.dua-modal-btn {
  padding: 8px 18px;
  border: 1.5px solid #d1fae5;
  border-radius: 8px;
  background: transparent;
  color: var(--emerald, #059669);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}

.dua-modal-btn:hover {
  background: color-mix(in srgb, var(--emerald) 6%, transparent);
}

/* ==========================================================================
   Ночной режим
   ========================================================================== */

.night-mode .dua-card {
  background: #1e293b;
  border-color: var(--quran-border);
}

.night-mode .dua-card:hover {
  border-color: var(--emerald-dark, #065f46);
}

.night-mode .dua-card-arabic {
  color: var(--quran-arabic, #f0e6d3);
}

.night-mode .dua-card-title,
.night-mode .dua-card-translation {
  color: #e0e0e0;
}

.night-mode .dua-filter {
  border-color: #2d6a4f;
  color: #9ca3af;
}

.night-mode .dua-filter:hover {
  color: var(--emerald-light, #6ee7b7);
  border-color: #059669;
}

.night-mode .dua-filter.active {
  background: #059669;
  border-color: #059669;
  color: #fff;
}

.night-mode .dua-search-bar input {
  background: #1e293b;
  border-color: var(--quran-border);
  color: #e0e0e0;
}

.night-mode .dua-action-btn {
  color: #9ca3af;
}

.night-mode .dua-action-btn:hover {
  color: var(--emerald-light, #6ee7b7);
}

.night-mode .dua-modal-content {
  background: #1e293b;
}

.night-mode .dua-modal-arabic {
  color: var(--quran-arabic, #f0e6d3);
}

.night-mode .dua-modal-translation {
  color: #e0e0e0;
}

.night-mode .dua-modal-context {
  background: color-mix(in srgb, var(--emerald) 8%, transparent);
}

.night-mode .dua-modal-btn {
  border-color: var(--emerald-dark, #065f46);
  color: var(--emerald-light, #6ee7b7);
}

/* ==========================================================================
   Мобильный
   ========================================================================== */

@media (max-width: 1024px) {
  .dua-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 767px) {
  #tab-dua {
    padding: 16px;
  }

  .dua-list {
    grid-template-columns: 1fr;
  }

  .dua-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .dua-card {
    padding: 16px;
  }

  .dua-card-arabic {
    font-size: 1.2rem;
  }
}
