/* ============================================================
   SALATY ADDITIONAL STYLES — All 28 Points
   ============================================================ */

/* Point 1 — Sticky next prayer bar already in hero, ensure sticky */
.salaty-hero { position: relative; }
.salaty-next-prayer { transition: opacity 0.5s ease; }

/* Point 3 — Qibla Compass Page */
.salaty-qibla-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 24px;
  max-width: 500px;
  margin: 0 auto;
}
.salaty-qibla-canvas-wrap {
  position: relative;
  margin: 24px 0;
}
#salatyQiblaCanvas {
  width: 300px;
  height: 340px;
  max-width: 100%;
}

/* Point 4 — Hijri Calendar */
.salaty-calendar-section {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.salaty-calendar-section table th {
  color: var(--clr-text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--clr-border);
}

/* Point 5 — Adhan Audio Controls */
.salaty-adhan-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  margin-bottom: 16px;
}
#salatyAdhanToggle {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--clr-border);
  background: var(--clr-surface);
  color: var(--clr-text);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
#salatyAdhanToggle:hover { background: var(--clr-primary); color: #fff; border-color: var(--clr-primary); }

/* Point 6 — Verse of Day */
#salatyVerseOfDay { margin-bottom: 24px; }

/* Point 7 — Continue Reading */
#salatyContinueReading {
  display: none;
  margin-bottom: 20px;
}

/* Point 8 — Quran Search Bar */
.salaty-quran-search-wrap {
  position: relative;
  margin-bottom: 20px;
}
#salatyQuranSearchBar {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-md);
  background: var(--clr-surface);
  color: var(--clr-text);
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}
#salatyQuranSearchBar:focus { border-color: var(--clr-primary); }
.salaty-quran-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--clr-text-muted);
  pointer-events: none;
}
#salatyQuranSearchResults {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  max-height: 360px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow-lg);
  display: none;
}

/* Point 9 — Font Size Slider */
.salaty-font-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--clr-surface-2);
  border-bottom: 1px solid var(--clr-border);
}
.salaty-font-controls label { font-size: 0.78rem; color: var(--clr-text-muted); white-space: nowrap; }
#salatyFontSlider {
  flex: 1;
  accent-color: var(--clr-primary);
  cursor: pointer;
}
#salatyFontLabel { font-size: 0.78rem; font-weight: 600; color: var(--clr-primary); min-width: 36px; }

/* Point 10 — Juz Navigation */
.salaty-juz-section {
  border-bottom: 1px solid var(--clr-border);
}
.salaty-juz-section-title {
  padding: 8px 16px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clr-text-light);
}

/* Point 11 — Mobile Bottom Navigation */
#salatyBottomNav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--clr-surface);
  border-top: 1px solid var(--clr-border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 90;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.08);
}
.salaty-bnav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 16px;
  color: var(--clr-text-muted);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: color var(--transition);
}
.salaty-bnav-item span:first-child { font-size: 1.2rem; }
.salaty-bnav-item.active, .salaty-bnav-item:hover { color: var(--clr-primary); }

/* Point 13 — Mobile prayer cards horizontal scroll */
@media (max-width: 768px) {
  .salaty-prayer-grid {
    display: flex !important;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .salaty-prayer-grid::-webkit-scrollbar { display: none; }
  .salaty-prayer-card {
    flex: 0 0 130px;
    scroll-snap-align: start;
  }
}

/* Point 14 — Install button */
#salatyInstallBtn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--clr-accent);
  color: #1a2e22;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
}
#salatyInstallBtn:hover { background: var(--clr-accent-light); }

/* Notification bell */
#salatyNotifyBtn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--clr-border);
  background: var(--clr-surface);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all var(--transition);
}
#salatyNotifyBtn:hover { background: var(--clr-surface-2); border-color: var(--clr-primary); }

/* Settings panel (mobile) */
#salatySettingsPanel {
  position: fixed;
  bottom: 60px;
  left: 0;
  right: 0;
  background: var(--clr-surface);
  border-top: 1px solid var(--clr-border);
  padding: 20px;
  z-index: 89;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  box-shadow: var(--shadow-lg);
}
#salatySettingsPanel.is-open { transform: translateY(0); }

/* ─── Data source indicator (Point 27) ─── */
.salaty-source-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.salaty-source-db  { background: #dcfce7; color: #166534; }
.salaty-source-api { background: #fef9c3; color: #854d0e; }
[data-theme="dark"] .salaty-source-db  { background: #14532d; color: #86efac; }
[data-theme="dark"] .salaty-source-api { background: #451a03; color: #fbbf24; }

/* ─── Surah sidebar Juz section ─── */
.salaty-sidebar-section { border-bottom: 1px solid var(--clr-border); }
.salaty-sidebar-section-title {
  padding: 6px 16px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clr-text-light);
  background: var(--clr-surface-2);
}

/* ─── City pages & Surah pages ─── */
.salaty-breadcrumb { font-size: 0.85rem; color: rgba(255,255,255,.7); }
.salaty-breadcrumb a { color: rgba(255,255,255,.8); text-decoration: underline; cursor: pointer; pointer-events: auto; }
.salaty-breadcrumb a:hover { color: #fff; }

/* ─── FAQ accordion ─── */
.salaty-faq-toggle:hover { background: var(--clr-surface-2) !important; }

/* ─── RTL fixes ─── */
/* RTL header handled in additions.css FIX 10 block below */
[dir="rtl"] .salaty-nav { flex-direction: row-reverse; }
[dir="rtl"] .salaty-surah-sidebar { border-right: none; border-left: 1px solid var(--clr-border); }
[dir="rtl"] .salaty-surah-item { flex-direction: row-reverse; text-align: right; }
[dir="rtl"] .salaty-city-bar__inner { flex-direction: row-reverse; }
[dir="rtl"] .salaty-next-prayer { flex-direction: row-reverse; }
[dir="rtl"] .salaty-next-prayer__countdown { margin-left: 0; margin-right: auto; }
/* Remove conflicting rules below — replaced by section at bottom */
[dir="rtl"] #salatyQuranSearchBar { padding: 12px 42px 12px 16px; }
[dir="rtl"] .salaty-quran-search-icon { left: auto; right: 14px; }
[dir="rtl"] .salaty-ayah__footer { flex-direction: row-reverse; }
[dir="rtl"] .salaty-ayah__actions { flex-direction: row-reverse; }
[dir="rtl"] .salaty-hero__date { text-align: left; }
[dir="rtl"] .salaty-modal__header { flex-direction: row-reverse; }

/* ─── Print styles ─── */
@media print {
  .salaty-header, .salaty-city-bar, #salatyBottomNav,
  .salaty-surah-sidebar, .salaty-quran-header__controls,
  .salaty-ayah__actions { display: none !important; }
  .salaty-quran-layout { grid-template-columns: 1fr; }
  .salaty-ayah__text { font-size: 18pt; }
}

/* ─── Quran page with sidebar ─── */
.salaty-surah-sidebar {
  display: flex;
  flex-direction: column;
}
.salaty-sidebar-tabs {
  display: flex;
  border-bottom: 1px solid var(--clr-border);
}
.salaty-sidebar-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: none;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--clr-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  font-family: inherit;
}
.salaty-sidebar-tab.active {
  color: var(--clr-primary);
  border-bottom-color: var(--clr-primary);
}

/* ─── Blog article listing (Point 22) ─── */
.salaty-article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin: 24px 0;
}
.salaty-article-card {
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
  display: flex;
  flex-direction: column;
}
.salaty-article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.12);
}
.salaty-article-card__thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--clr-primary-dark, #064d2a), var(--clr-primary, #0d5c3a));
}
.salaty-article-card__thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
  display: block;
}
.salaty-article-card:hover .salaty-article-card__thumb img {
  transform: scale(1.05);
}
.salaty-article-card__thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
}
.salaty-article-card__cat {
  position: absolute; top: 12px; left: 12px;
  background: var(--clr-primary); color: #fff;
  font-size: 0.7rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .06em;
  padding: 3px 10px; border-radius: 20px;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}
.salaty-article-card__body { padding: 20px; flex: 1; display: flex; flex-direction: column; }
.salaty-article-card__title {
  font-size: 1.05rem; font-weight: 700;
  line-height: 1.4; margin: 0 0 10px;
}
.salaty-article-card__title a { color: var(--clr-text); text-decoration: none; }
.salaty-article-card__title a:hover { color: var(--clr-primary); }
.salaty-article-card__excerpt {
  font-size: 0.875rem; color: var(--clr-text-muted);
  line-height: 1.65; margin-bottom: auto;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}
.salaty-article-card__footer {
  display: flex; align-items: center; gap: 8px;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--clr-border);
  flex-wrap: wrap;
}
.salaty-article-card__date { font-size: 0.78rem; color: var(--clr-text-muted); }
.salaty-article-card__read {
  margin-left: auto;
  background: var(--clr-primary, #0d5c3a);
  color: #fff; font-size: 0.72rem; font-weight: 700;
  padding: 3px 10px; border-radius: 20px;
}

/* ─── Smooth transitions only on specific interactive elements ─── */
.salaty-prayer-card, .salaty-surah-item, .salaty-city-option,
.salaty-ayah, .salaty-btn, .salaty-btn-icon {
  transition: all 0.2s ease !important;
}

/* ─── RTL: Next prayer bar — complete fix ─── */
[dir="rtl"] .salaty-next-prayer {
  flex-direction: row-reverse;
  text-align: right;
}
/* In RTL: countdown goes to the LEFT (which is visually first in RTL) */
[dir="rtl"] .salaty-next-prayer__countdown {
  margin-left: 0;
  margin-right: auto;
  order: -1;         /* push countdown to start in RTL */
}
[dir="rtl"] .salaty-next-prayer__time {
  order: 0;
}
[dir="rtl"] .salaty-next-prayer__info {
  order: 1;
  text-align: right;
}
[dir="rtl"] .salaty-next-prayer__label,
[dir="rtl"] .salaty-next-prayer__name {
  text-align: right;
}

/* ─── Hijri date BiDi fix ─── */
#salatyHijriDate {
  unicode-bidi: isolate;
  direction: ltr; /* outer container is LTR to preserve day/month/year order */
}
#salatyHijriDate [dir="rtl"] {
  display: inline;
}

/* Lang dropdown rules consolidated below */

/* ─── Quran sidebar scroll fix ─── */
.salaty-surah-list {
  overflow-y: auto !important;
  flex: 1 1 0 !important;
  min-height: 0 !important;
  max-height: calc(100vh - 220px);
}
.salaty-surah-sidebar {
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  overflow: hidden !important;
}
#salatySurahPanel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#salatyJuzPanel {
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

/* ─── RTL sidebar tabs ─── */
[dir="rtl"] .salaty-sidebar-tabs {
  flex-direction: row-reverse;
}

/* ─── Hamburger button — show on mobile only ─── */
.salaty-mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.salaty-mobile-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--clr-text);
  border-radius: 2px;
  transition: all 0.2s;
}
.salaty-mobile-toggle[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.salaty-mobile-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.salaty-mobile-toggle[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

@media (max-width: 768px) {
  .salaty-mobile-toggle { display: flex; }
  .salaty-nav { display: none; } /* hide desktop nav on mobile — drawer handles it */
}

/* ─── FIX 10: RTL header layout ─── */
/* In RTL: logo is on the RIGHT, hamburger on the LEFT */
[dir="rtl"] .salaty-header__inner {
  flex-direction: row !important; /* keep normal flow — logo right, actions left */
}
[dir="rtl"] .salaty-header__actions {
  order: 0;  /* actions stay at their natural position */
  margin-right: 0;
}
[dir="rtl"] .salaty-logo {
  margin-right: 0;
  margin-left: auto; /* push logo to the right */
}
[dir="rtl"] .salaty-nav {
  margin-right: auto;
  margin-left: 0;
}
/* On mobile RTL: hamburger left, site name right */
@media (max-width: 768px) {
  [dir="rtl"] .salaty-header__inner {
    flex-direction: row !important;
  }
  [dir="rtl"] .salaty-mobile-toggle {
    order: -1;  /* hamburger first = leftmost */
    margin-right: 0;
  }
  [dir="rtl"] .salaty-logo {
    margin-left: auto;
    margin-right: 0;
  }
  [dir="rtl"] .salaty-header__actions {
    order: 1;
    margin-left: 0;
  }
}

/* ─── FIX 8: Lang dropdown RTL — position under button, within screen ─── */
#salatyLangWrap {
  position: relative !important;
}
#salatyLangDropdown {
  max-width: calc(100vw - 16px) !important;
  position: absolute !important;
  top: calc(100% + 8px) !important;
}
/* LTR: drop right-aligned to button */
[dir="ltr"] #salatyLangDropdown {
  right: 0 !important;
  left: auto !important;
}
/* RTL: drop left-aligned to button (so it opens to the left, stays in screen) */
[dir="rtl"] #salatyLangDropdown {
  left: 0 !important;
  right: auto !important;
}

/* ─── FIX 4: Quran sidebar — scrollable on mobile ─── */
@media (max-width: 768px) {
  #salatySurahSidebar.is-open {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 280px !important;
    height: 100vh !important;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    z-index: 9999 !important;
    background: var(--clr-surface) !important;
    box-shadow: 4px 0 24px rgba(0,0,0,.2) !important;
    display: flex !important;
    flex-direction: column !important;
  }
  [dir="rtl"] #salatySurahSidebar.is-open {
    left: auto !important;
    right: 0 !important;
    box-shadow: -4px 0 24px rgba(0,0,0,.2) !important;
  }
  /* Sidebar list must fill and scroll */
  #salatySurahSidebar.is-open .salaty-surah-list {
    flex: 1 !important;
    overflow-y: scroll !important;
    -webkit-overflow-scrolling: touch !important;
    min-height: 0 !important;
  }
}

/* ─── Bottom nav: exactly 4 items ─── */
#salatyBottomNav {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
}

/* ═══════════════════════════════════════════
   AdSense Ad Zones
   ═══════════════════════════════════════════ */
.ad-zone {
  border-radius: 6px;
  background: #f5f5f5;
  border: 1px dashed #ddd;
  min-height: 90px;
  width: 100%;
  max-width: 100%;
  display: block;
  box-sizing: border-box;
  /* NO overflow:hidden — collapses ins width to 0 */
  /* NO padding — reduces measured width */
}
.ad-zone ins.adsbygoogle {
  display: block !important;
  width: 100% !important;
  min-width: 300px;
  min-height: 90px;
}
.ad-zone-banner  { min-height: 90px; }
.ad-zone-rect    { min-height: 250px; }
.ad-zone-sidebar { min-height: 600px; }
