/* ==========================================================================
   ebcedim.com — Faydalı Dualar kenar menüsü
   Sitenin mevcut renk değişkenlerini (zümrüt, altın, slate) kullanır;
   karanlık mod otomatik uyum sağlar.
   ========================================================================== */

/* ---- Sayfa düzeni: geniş ekranda solda menü, sağda mevcut içerik ---- */
.page-layout {
  flex: 1 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Dar ekranda menü, ana içeriğin altında tam genişlikte görünür */
.page-layout > .dua-sidebar {
  order: 2;
  width: auto;
  max-width: 1040px;
  margin: 0 1.25rem 3rem;
}

@media (min-width: 1040px) {
  .page-layout > .dua-sidebar {
    margin: 0 auto 3rem;
    width: calc(100% - 2.5rem);
  }
}

@media (min-width: 1240px) {
  .page-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1040px);
    justify-content: center;
    column-gap: 1.5rem;
    align-items: start;
    padding: 0 1.25rem;
  }
  .page-layout > .main-wrapper {
    grid-column: 2;
    grid-row: 1;
    margin: 0;
    padding-left: 0;
    padding-right: 0;
  }
  .page-layout > .dua-sidebar {
    order: 0;
    grid-column: 1;
    grid-row: 1;
    width: 100%;
    margin: 2.25rem 0 3rem;
    position: sticky;
    top: 1.25rem;
    max-height: calc(100vh - 2.5rem);
    overflow-y: auto;
    scrollbar-width: thin;
  }
}

/* ---- Menü kartı ---- */
.dua-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.dua-sidebar-head {
  position: relative;
  padding: 1.25rem 1.25rem 1.1rem;
  background:
    radial-gradient(ellipse 120% 90% at 0% 0%, rgba(147, 51, 234, 0.22), transparent 60%),
    linear-gradient(135deg, #1e1240 0%, #2a1660 55%, #3b1d6e 100%);
  color: #fff;
}

.dua-sidebar-head::after {
  content: "";
  position: absolute;
  left: 1.25rem;
  right: 1.25rem;
  bottom: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-500), transparent);
  opacity: 0.7;
}

.dua-sidebar-arabic {
  font-family: 'Amiri', 'Scheherazade New', serif;
  font-size: 1.35rem;
  line-height: 1.2;
  color: #fcd34d;
  direction: rtl;
  text-align: right;
  margin-bottom: 0.15rem;
}

.dua-sidebar-title {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.dua-sidebar-sub {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.72);
  margin-top: 0.2rem;
  line-height: 1.45;
}

/* ---- Konu listesi ---- */
.dua-nav {
  list-style: none;
  padding: 0.6rem 0.6rem 0.4rem;
}

.dua-group + .dua-group {
  border-top: 1px dashed var(--border-subtle);
}

.dua-group {
  padding: 0.55rem 0.15rem;
}

.dua-group-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0 0.5rem 0.35rem;
}

.dua-group-no {
  flex: none;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--gold-700);
  background: var(--gold-100);
  border: 1px solid var(--border-gold);
}

body.dark-mode .dua-group-no {
  color: #fcd34d;
}

.dua-group-name {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.dua-sub {
  list-style: none;
}

.dua-link {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.dua-link:hover {
  background: var(--emerald-50);
  border-color: var(--emerald-100);
  color: var(--emerald-700);
}

body.dark-mode .dua-link:hover {
  color: #6ee7b7;
}

.dua-link:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 1px;
}

.dua-link-icon {
  flex: none;
  font-size: 1rem;
  line-height: 1.35;
}

.dua-link-text {
  flex: 1;
}

.dua-link-harf {
  color: var(--gold-600);
  font-weight: 800;
}

.dua-link-arrow {
  flex: none;
  margin-top: 0.2rem;
  color: var(--text-muted);
  transition: transform var(--transition-fast);
}

.dua-link:hover .dua-link-arrow {
  transform: translateX(2px);
  color: currentColor;
}

.dua-sidebar-foot {
  margin: 0 0.9rem 0.9rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
  font-size: 0.72rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ---- Okuma penceresi ---- */
.dua-dialog {
  width: min(720px, calc(100vw - 2rem));
}

.dua-dialog .detail-dialog-title {
  font-size: 1.3rem;
  line-height: 1.3;
}

.dua-dialog-body {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.dua-lead {
  font-size: 1rem;
  color: var(--text-primary);
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--gold-500);
  background: var(--gold-50);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin-bottom: 1.1rem;
}

.dua-section-title {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--emerald-700);
  margin: 1.35rem 0 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body.dark-mode .dua-section-title {
  color: #6ee7b7;
}

.dua-section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}

.dua-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  margin-bottom: 0.75rem;
}

.dua-card-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--gold-700);
  margin-bottom: 0.4rem;
}

body.dark-mode .dua-card-title {
  color: #fcd34d;
}

.dua-arabic {
  font-size: 1.55rem;
  line-height: 2.1;
  color: var(--text-primary);
  text-align: right;
  margin-bottom: 0.6rem;
}

.dua-okunus,
.dua-anlam {
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
}

.dua-okunus {
  font-style: italic;
  color: var(--text-primary);
}

.dua-okunus span,
.dua-anlam span {
  font-style: normal;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.25rem;
}

.dua-kaynak {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}

.dua-list {
  padding-left: 1.15rem;
  margin-bottom: 0.5rem;
}

.dua-list li {
  margin-bottom: 0.45rem;
}

.dua-list li::marker {
  color: var(--gold-500);
}

.dua-list strong,
.dua-text strong {
  color: var(--text-primary);
}

.dua-text {
  margin-bottom: 0.6rem;
}

.dua-note {
  margin-top: 1.1rem;
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  background: var(--indigo-50);
  border: 1px solid var(--indigo-100);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

@media (max-width: 640px) {
  .dua-dialog {
    padding: 1.15rem;
  }
  .dua-arabic {
    font-size: 1.35rem;
  }
}

/* ---- Pencere içi bağlantı düğmesi (ör. Vâkıa Sûresi'ni oku) ---- */
.dua-open-btn {
  margin-top: 0.7rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--emerald-500);
  background: var(--emerald-50);
  color: var(--emerald-700);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.dua-open-btn:hover { background: var(--emerald-600); color: #fff; }
body.dark-mode .dua-open-btn { color: #6ee7b7; }
body.dark-mode .dua-open-btn:hover { color: #fff; }

.dua-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
  padding: 0.3rem 0.7rem;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.dua-back-btn:hover { color: var(--text-primary); border-color: var(--text-muted); }
.dua-back-btn[hidden] { display: none; }

/* ---- Sûre okuma görünümü ---- */
.sure-besmele {
  text-align: center;
  font-size: 1.7rem;
  color: var(--emerald-700);
  margin: 0.25rem 0 0.75rem;
}
body.dark-mode .sure-besmele { color: #6ee7b7; }

.sure-toolbar {
  display: flex;
  gap: 1rem;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.sure-toolbar label { display: inline-flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.sure-toolbar input { accent-color: var(--emerald-600); }

.sure-list { list-style: none; }

.sure-ayet {
  padding: 0.9rem 0.25rem;
  border-bottom: 1px solid var(--border-subtle);
}
.sure-ayet:last-child { border-bottom: 0; }

.sure-ar {
  font-size: 1.6rem;
  line-height: 2.2;
  color: var(--text-primary);
  text-align: right;
}
.sure-no { color: var(--gold-600); font-size: 1.25rem; white-space: nowrap; }

.sure-ok {
  font-style: italic;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-top: 0.25rem;
}
.sure-ok b { font-style: normal; color: var(--gold-600); margin-right: 0.2rem; }

.sure-tr {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

.sure-gizle-ok .sure-ok,
.sure-gizle-tr .sure-tr { display: none; }

@media (max-width: 640px) {
  .sure-ar { font-size: 1.35rem; }
}

.dua-kaynak a { color: var(--emerald-700); text-decoration: underline; text-underline-offset: 2px; }
body.dark-mode .dua-kaynak a { color: #6ee7b7; }

/* Numaralı adım listesi (Hilal uygulaması) */
.dua-adim { list-style: decimal; }
.dua-adim li::marker { color: var(--gold-600); font-weight: 800; }
.dua-ar-satir { font-size: 1.3rem; margin: 0 0.35rem; color: var(--text-primary); }

/* ==========================================================================
   Okunabilirlik iyileştirmesi (kenar menüsü)
   ========================================================================== */
@media (min-width: 1240px) {
  .page-layout { grid-template-columns: 320px minmax(0, 1040px); }
}
.dua-sidebar-title { font-size: 1.3rem; }
.dua-sidebar-sub { font-size: 0.86rem; line-height: 1.5; color: rgba(255, 255, 255, 0.85); }
.dua-group-name {
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
}
.dua-group-no { width: 1.65rem; height: 1.65rem; font-size: 0.82rem; }
.dua-link {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.005em;
  padding: 0.6rem 0.65rem;
  color: var(--text-primary);
}
.dua-link-harf { font-weight: 800; }
.dua-link-icon { font-size: 1.1rem; line-height: 1.4; }
.dua-sidebar-foot { font-size: 0.8rem; line-height: 1.55; color: var(--text-secondary); }

/* ==========================================================================
   Sakinleştirme: menü göz alıcı olmasın, odak hesaplayıcıda kalsın
   ========================================================================== */
.dua-sidebar {
  box-shadow: var(--shadow-sm);
}
.dua-sidebar-head {
  background:
    radial-gradient(ellipse 120% 90% at 100% 0%, rgba(245, 158, 11, 0.10), transparent 60%),
    linear-gradient(135deg, #f6f2fd 0%, #fbf7ee 100%);
  color: #3b1d6e;
  border-bottom: 1px solid var(--border-subtle);
}
.dua-sidebar-head::after { opacity: 0.35; }
.dua-sidebar-arabic { color: var(--gold-600); }
.dua-sidebar-title { color: #3b1d6e; font-size: 1.2rem; }
.dua-sidebar-sub { color: var(--text-muted); font-size: 0.84rem; }
.dua-link {
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--text-secondary);
}
.dua-link:hover { color: var(--emerald-700); }
.dua-link-harf { font-weight: 700; color: var(--gold-600); }
.dua-group-name { color: var(--text-muted); font-weight: 700; }
.dua-group-no { opacity: 0.85; }

body.dark-mode .dua-sidebar-head {
  background:
    radial-gradient(ellipse 120% 90% at 100% 0%, rgba(245, 158, 11, 0.08), transparent 60%),
    linear-gradient(135deg, #17122b 0%, #141a2b 100%);
  color: #e9e3ff;
}
body.dark-mode .dua-sidebar-title { color: #e9e3ff; }
body.dark-mode .dua-sidebar-arabic { color: #fcd34d; }

/* Âlim kartlarında kısa kimlik satırı */
.dua-card-kim {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin: -0.2rem 0 0.4rem;
}

/* Âlim kartları: isim belirgin olsun */
.dua-card-title:has(+ .dua-card-kim) {
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #3b1d6e;
  margin-bottom: 0.15rem;
  padding-left: 0.6rem;
  border-left: 3px solid var(--gold-500);
}
.dua-card-title:has(+ .dua-card-kim) + .dua-card-kim {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding-left: 0.6rem;
  margin: 0 0 0.55rem;
}
body.dark-mode .dua-card-title:has(+ .dua-card-kim) { color: #e9e3ff; }

/* ---- Telefon / dar ekran: "Dualar" yüzen düğmesi ---- */
.dua-fab {
  position: fixed;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 50;
  display: none;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.15rem;
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #2a1660, #3b1d6e);
  color: #fde68a;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 10px 28px -8px rgba(59, 29, 110, 0.55);
  cursor: pointer;
}
.dua-fab:active { transform: scale(0.97); }
.dua-fab {
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, box-shadow 0.2s ease !important;
}
@media (max-width: 1239px) {
  .dua-fab { display: inline-flex; }
}
@media (max-width: 640px) {
  .dua-fab {
    padding: 0.42rem 0.78rem !important;
    font-size: 0.78rem !important;
    gap: 0.3rem !important;
    right: 0.75rem !important;
    bottom: calc(0.6rem + env(safe-area-inset-bottom, 0px)) !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45) !important;
    opacity: 0.96 !important;
    border-radius: 9999px !important;
  }
  /* Form alanları odaklandığında Dualar düğmesini gizle (çakışma ve klavye engeli önleme) */
  body:has(input:focus, textarea:focus) .dua-fab {
    transform: translateY(160%) !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

/* Kaydırma esnasında akıllı gizlenme sınıfı */
.dua-fab.dua-fab-hidden,
.dua-fab.dua-fab-collision-hide {
  transform: translateY(160%) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.dua-konu-liste { display: flex; flex-direction: column; gap: 0.5rem; }
.dua-konu-btn {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
  margin-top: 0;
  border-radius: var(--radius-md);
  border-color: var(--border-subtle);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-weight: 600;
  padding: 0.75rem 0.9rem;
}
.dua-konu-btn b { color: var(--gold-600); }
.dua-konu-btn:hover { background: var(--emerald-50); color: var(--emerald-700); border-color: var(--emerald-100); }
body.dark-mode .dua-konu-btn { color: var(--text-primary); }
