/*
 * ============================================================
 * SALAH — SHARED QURʾĀN READER
 * ============================================================
 *
 * Styles only the reusable SalahQuran reader/player.
 * No prayer-guide or Contextual Worship selectors live here.
 * ============================================================
 */


/* ------------------------------------------------------------
   OVERLAY
   ------------------------------------------------------------ */

.salah-quran-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;

  background: rgba(14, 42, 34, 0.48);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);

  opacity: 0;
  visibility: hidden;

  transition:
    opacity 180ms ease,
    visibility 180ms ease;
}

.salah-quran-overlay[hidden] {
  display: none !important;
}

.salah-quran-overlay.open {
  opacity: 1;
  visibility: visible;
}

body.salah-quran-open {
  overflow: hidden;
}


/* ------------------------------------------------------------
   CARD
   ------------------------------------------------------------ */

.salah-quran-card {
  width: min(760px, 100%);
  max-height: min(88vh, 900px);

  display: flex;
  flex-direction: column;

  overflow: hidden;

  background: #fffdf8;
  border: 1px solid rgba(13, 72, 57, 0.12);
  border-radius: 22px;

  box-shadow:
    0 24px 70px rgba(11, 45, 35, 0.24),
    0 3px 12px rgba(11, 45, 35, 0.08);

  transform: translateY(8px) scale(0.99);

  transition:
    transform 180ms ease;
}

.salah-quran-overlay.open .salah-quran-card {
  transform: translateY(0) scale(1);
}


/* ------------------------------------------------------------
   HEADER
   ------------------------------------------------------------ */

.salah-quran-head {
  flex: 0 0 auto;

  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;

  padding: 24px 26px 18px;

  border-bottom: 1px solid rgba(13, 72, 57, 0.08);
}

.salah-quran-head > div {
  min-width: 0;
}

.salah-quran-head .eyebrow {
  margin: 0 0 5px;

  color: #b3833d;

  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.2;

  text-transform: uppercase;
}

.salah-quran-head h2 {
  margin: 0;

  color: #0d4839;

  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 3vw, 2.1rem);
  font-weight: 600;
  line-height: 1.08;
}

.salah-quran-subtitle {
  margin: 7px 0 0;

  color: #6f786f;

  font-size: 0.8rem;
  line-height: 1.45;
}


/* ------------------------------------------------------------
   CLOSE BUTTON
   ------------------------------------------------------------ */

.salah-quran-close {
  flex: 0 0 auto;

  width: 42px;
  height: 42px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0;

  color: #0d4839;
  background: #f5f3ea;

  border: 1px solid #d6b66f;
  border-radius: 50%;

  font: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;

  cursor: pointer;

  box-shadow:
    inset 0 0 0 2px rgba(255, 255, 255, 0.7);

  transition:
    background 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.salah-quran-close:hover {
  background: #eee9dc;
  border-color: #c69b45;
  transform: translateY(-1px);
}

.salah-quran-close:focus-visible {
  outline: 3px solid rgba(184, 143, 64, 0.24);
  outline-offset: 3px;
}


/* ------------------------------------------------------------
   PLAYER TOOLBAR
   ------------------------------------------------------------ */

.salah-quran-toolbar {
  flex: 0 0 auto;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  padding: 12px 26px;

  background: #f7f5ee;
  border-bottom: 1px solid rgba(13, 72, 57, 0.08);
}

.salah-quran-player,
.salah-quran-rate {
  display: flex;
  align-items: center;
}

.salah-quran-player {
  gap: 5px;

  padding: 4px;

  background: #0d4839;
  border-radius: 999px;
}

.salah-quran-player button {
  min-height: 34px;

  border: 0;

  color: #fff;
  background: transparent;

  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;

  cursor: pointer;

  transition:
    background 140ms ease,
    opacity 140ms ease;
}

.salah-quran-player button:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.12);
}

.salah-quran-player button:disabled {
  cursor: default;
  opacity: 0.4;
}

.salah-quran-player button:focus-visible {
  outline: 2px solid #e1c680;
  outline-offset: 1px;
}


/* Main play button */

.salah-quran-play-all {
  display: inline-flex;
  align-items: center;
  gap: 7px;

  padding: 0 14px;

  border-radius: 999px !important;
}

.salah-quran-play-all > span:first-child {
  font-size: 0.7rem;
}


/* Pause / resume */

.salah-quran-pause,
.salah-quran-stop {
  position: relative;

  width: 34px;
  min-width: 34px;
  padding: 0;

  border-radius: 50% !important;
}

.salah-quran-pause::before,
.salah-quran-pause::after {
  content: "";

  position: absolute;
  top: 10px;

  width: 4px;
  height: 14px;

  background: currentColor;
  border-radius: 1px;
}

.salah-quran-pause::before {
  left: 11px;
}

.salah-quran-pause::after {
  right: 11px;
}


/* Resume triangle */

.salah-quran-pause[data-state="resume"]::before {
  top: 9px;
  left: 12px;

  width: 0;
  height: 0;

  background: transparent;

  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 11px solid currentColor;

  border-radius: 0;
}

.salah-quran-pause[data-state="resume"]::after {
  display: none;
}


/* Stop square */

.salah-quran-stop::before {
  content: "";

  position: absolute;
  inset: 11px;

  background: currentColor;
  border-radius: 2px;
}


/* ------------------------------------------------------------
   SPEED CONTROL
   ------------------------------------------------------------ */

.salah-quran-rate {
  gap: 3px;

  padding: 3px;

  background: #ebe8df;
  border: 1px solid rgba(13, 72, 57, 0.08);
  border-radius: 999px;
}

.salah-quran-rate button {
  min-height: 30px;
  padding: 0 11px;

  color: #53645d;
  background: transparent;

  border: 0;
  border-radius: 999px;

  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;

  cursor: pointer;

  transition:
    color 140ms ease,
    background 140ms ease;
}

.salah-quran-rate button:hover {
  color: #0d4839;
}

.salah-quran-rate button.active {
  color: #fff;
  background: #0d4839;
}

.salah-quran-rate button:focus-visible {
  outline: 2px solid #c7a75d;
  outline-offset: 2px;
}


/* ------------------------------------------------------------
   STATUS
   ------------------------------------------------------------ */

.salah-quran-status {
  flex: 0 0 auto;

  margin: 20px 26px;
  padding: 15px 17px;

  color: #52645d;
  background: #f6f4ed;

  border: 1px solid rgba(13, 72, 57, 0.09);
  border-radius: 13px;

  font-size: 0.82rem;
  line-height: 1.5;
}

.salah-quran-status[hidden] {
  display: none !important;
}

.salah-quran-status[data-state="loading"]::before {
  content: "";

  display: inline-block;

  width: 9px;
  height: 9px;

  margin-right: 8px;

  border: 2px solid rgba(13, 72, 57, 0.22);
  border-top-color: #0d4839;
  border-radius: 50%;

  vertical-align: -1px;

  animation: salah-quran-spin 0.8s linear infinite;
}

.salah-quran-status[data-state="error"] {
  color: #764b3d;
  background: #faf2ed;
  border-color: rgba(118, 75, 61, 0.14);
}

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


/* ------------------------------------------------------------
   SCROLLING BODY
   ------------------------------------------------------------ */

.salah-quran-body {
  min-height: 0;
  flex: 1 1 auto;

  overflow-y: auto;
  overscroll-behavior: contain;

  padding: 20px 26px 28px;

  scrollbar-width: thin;
  scrollbar-color:
    rgba(13, 72, 57, 0.28)
    transparent;
}

.salah-quran-body::-webkit-scrollbar {
  width: 7px;
}

.salah-quran-body::-webkit-scrollbar-track {
  background: transparent;
}

.salah-quran-body::-webkit-scrollbar-thumb {
  background: rgba(13, 72, 57, 0.24);
  border-radius: 999px;
}


/* ------------------------------------------------------------
   PASSAGES
   ------------------------------------------------------------ */

.salah-quran-passage + .salah-quran-passage {
  margin-top: 26px;
  padding-top: 24px;

  border-top: 1px solid rgba(13, 72, 57, 0.11);
}

.salah-quran-passage-head {
  margin: 0 0 14px;
}

.salah-quran-passage-head small {
  display: block;

  margin-bottom: 3px;

  color: #b3833d;

  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.09em;
}

.salah-quran-passage-head h3 {
  margin: 0;

  color: #0d4839;

  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}


/* ------------------------------------------------------------
   ATTRIBUTION
   ------------------------------------------------------------ */

.salah-quran-attribution {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;

  margin: 0 0 12px;

  color: #8a8f88;

  font-size: 0.63rem;
  line-height: 1.4;
}


/* ------------------------------------------------------------
   ĀYAHS
   ------------------------------------------------------------ */

.salah-quran-ayahs {
  display: grid;
  gap: 10px;
}

.salah-quran-ayah {
  position: relative;

  padding: 18px 18px 15px;

  background: #f8f6ef;

  border: 1px solid rgba(13, 72, 57, 0.09);
  border-radius: 15px;
}

.salah-quran-arabic-row {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.salah-quran-verse-number {
  flex: 0 0 auto;

  width: 27px;
  height: 27px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-top: 3px;

  color: #0d4839;
  background: #e9f1ec;

  border: 1px solid rgba(13, 72, 57, 0.09);
  border-radius: 50%;

  font-size: 0.62rem;
  font-weight: 700;
}

.salah-quran-arabic {
  flex: 1 1 auto;

  margin: 0;

  color: #0d4839;

  font-family:
    "Noto Naskh Arabic",
    "Traditional Arabic",
    "Amiri",
    serif;

  font-size: clamp(1.45rem, 3.2vw, 1.9rem);
  font-weight: 400;
  line-height: 1.9;

  text-align: right;
}

.salah-quran-transliteration {
  margin: 12px 0 0;

  color: #34594d;

  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.55;
}

.salah-quran-english {
  margin: 7px 0 0;

  color: #6c746e;

  font-size: 0.76rem;
  line-height: 1.55;
}


/* ------------------------------------------------------------
   PER-ĀYAH PLAY
   ------------------------------------------------------------ */

.salah-quran-ayah-play {
  width: 31px;
  height: 31px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-top: 12px;
  padding: 0;

  color: #0d4839;
  background: #e9f1ec;

  border: 1px solid rgba(13, 72, 57, 0.1);
  border-radius: 50%;

  font: inherit;
  font-size: 0.66rem;

  cursor: pointer;

  transition:
    color 140ms ease,
    background 140ms ease,
    transform 140ms ease;
}

.salah-quran-ayah-play:hover {
  color: #fff;
  background: #0d4839;
  transform: translateY(-1px);
}

.salah-quran-ayah-play.playing {
  color: #fff;
  background: #0d4839;
}

.salah-quran-ayah-play:focus-visible {
  outline: 3px solid rgba(184, 143, 64, 0.22);
  outline-offset: 2px;
}


/* ------------------------------------------------------------
   TABLET
   ------------------------------------------------------------ */

@media (max-width: 760px) {
  .salah-quran-overlay {
    padding: 16px;
  }

  .salah-quran-card {
    max-height: 90vh;
    border-radius: 19px;
  }

  .salah-quran-head {
    padding:
      20px
      20px
      16px;
  }

  .salah-quran-toolbar {
    padding:
      11px
      20px;
  }

  .salah-quran-body {
    padding:
      17px
      20px
      22px;
  }

  .salah-quran-status {
    margin:
      17px
      20px;
  }
}


/* ------------------------------------------------------------
   MOBILE
   ------------------------------------------------------------ */

@media (max-width: 520px) {
  .salah-quran-overlay {
    align-items: flex-end;

    padding:
      12px
      10px
      10px;
  }

  .salah-quran-card {
    width: 100%;
    max-height: 92vh;

    border-radius:
      20px
      20px
      16px
      16px;
  }

  .salah-quran-head {
    gap: 12px;

    padding:
      18px
      17px
      14px;
  }

  .salah-quran-head h2 {
    font-size: 1.55rem;
  }

  .salah-quran-close {
    width: 38px;
    height: 38px;
  }

  .salah-quran-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;

    padding:
      10px
      17px;
  }

  .salah-quran-player {
    align-self: flex-start;
  }

  .salah-quran-rate {
    align-self: flex-start;
  }

  .salah-quran-status {
    margin:
      14px
      17px;
  }

  .salah-quran-body {
    padding:
      14px
      17px
      20px;
  }

  .salah-quran-ayah {
    padding:
      15px
      14px
      13px;
  }

  .salah-quran-arabic-row {
    gap: 9px;
  }

  .salah-quran-verse-number {
    width: 24px;
    height: 24px;

    font-size: 0.58rem;
  }

  .salah-quran-arabic {
    font-size: 1.4rem;
    line-height: 1.85;
  }

  .salah-quran-transliteration {
    font-size: 0.75rem;
  }

  .salah-quran-english {
    font-size: 0.73rem;
  }
}


/* ------------------------------------------------------------
   VERY SMALL MOBILE
   ------------------------------------------------------------ */

@media (max-width: 360px) {
  .salah-quran-overlay {
    padding-left: 6px;
    padding-right: 6px;
  }

  .salah-quran-head,
  .salah-quran-toolbar,
  .salah-quran-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .salah-quran-status {
    margin-left: 14px;
    margin-right: 14px;
  }

  .salah-quran-play-all {
    padding-left: 11px;
    padding-right: 11px;
  }
}


/* ------------------------------------------------------------
   REDUCED MOTION
   ------------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  .salah-quran-overlay,
  .salah-quran-card,
  .salah-quran-close,
  .salah-quran-player button,
  .salah-quran-rate button,
  .salah-quran-ayah-play {
    transition: none;
  }

  .salah-quran-status[data-state="loading"]::before {
    animation-duration: 1.5s;
  }
}
/* ============================================================
   ACTIVE QURʾĀN READING SESSION
   ============================================================ */

.salah-quran-card .salah-quran-reading-session {
  display: flex;
  align-items: center;
  gap: 7px;

  width: fit-content;
  max-width: calc(100% - 44px);

  margin: 0 22px 10px;
  padding: 6px 7px 6px 11px;

  border: 1px solid rgba(14, 59, 46, .13);
  border-radius: 999px;

  background:
    linear-gradient(
      180deg,
      rgba(242, 247, 243, .96),
      rgba(235, 243, 237, .96)
    );

  color: #315247;

  box-shadow:
    0 2px 8px rgba(14, 59, 46, .045);

  font-family:
    'DM Sans',
    system-ui,
    sans-serif;

  font-size: 9px;
  line-height: 1;
}

.salah-quran-card .salah-quran-reading-session[hidden] {
  display: none !important;
}

.salah-quran-card .salah-quran-reading-session-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 18px;
  height: 18px;

  border-radius: 50%;

  background: rgba(201, 169, 106, .14);
  color: #8c7450;

  font-size: 12px;
  line-height: 1;

  flex: 0 0 auto;
}

.salah-quran-card .salah-quran-reading-session-time {
  color: #0e3b2e;

  font-size: 11px;
  line-height: 1;
  font-weight: 800;

  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;

  white-space: nowrap;
}

.salah-quran-card .salah-quran-reading-session-copy {
  color: #718078;

  font-size: 9px;
  line-height: 1;
  font-weight: 600;

  white-space: nowrap;
}


/* ------------------------------------------------------------
   TIMER ACTION
   Specificity is intentional: generic site button styles must
   not turn this back into a browser-default rectangle.
   ------------------------------------------------------------ */

.salah-quran-card
.salah-quran-reading-session
button.salah-quran-reading-session-toggle {
  appearance: none;
  -webkit-appearance: none;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: auto;
  min-width: 0;
  min-height: 26px;

  margin: 0 0 0 3px;
  padding: 6px 10px;

  border: 1px solid #0e3b2e;
  border-radius: 999px;

  background: #0e3b2e;
  color: #fff;

  box-shadow:
    0 2px 6px rgba(14, 59, 46, .11);

  font-family:
    'DM Sans',
    system-ui,
    sans-serif;

  font-size: 8px;
  line-height: 1;
  font-weight: 700;

  letter-spacing: .01em;
  text-transform: none;

  cursor: pointer;

  transition:
    background .16s ease,
    border-color .16s ease,
    box-shadow .16s ease,
    transform .16s ease;
}

.salah-quran-card
.salah-quran-reading-session
button.salah-quran-reading-session-toggle:hover {
  border-color: #155442;
  background: #155442;

  box-shadow:
    0 3px 8px rgba(14, 59, 46, .15);

  transform: translateY(-1px);
}

.salah-quran-card
.salah-quran-reading-session
button.salah-quran-reading-session-toggle:active {
  transform: translateY(0);
}

.salah-quran-card
.salah-quran-reading-session
button.salah-quran-reading-session-toggle:focus-visible {
  outline: 2px solid rgba(201, 169, 106, .75);
  outline-offset: 2px;
}


/* ------------------------------------------------------------
   PAUSED
   ------------------------------------------------------------ */

.salah-quran-card
.salah-quran-reading-session:has(
  .salah-quran-reading-session-copy
) {
  transition:
    background .18s ease,
    border-color .18s ease;
}


/* ------------------------------------------------------------
   COMPLETE
   ------------------------------------------------------------ */

.salah-quran-card .salah-quran-reading-session.complete {
  border-color: rgba(201, 169, 106, .34);

  background:
    linear-gradient(
      180deg,
      rgba(250, 246, 236, .98),
      rgba(247, 241, 226, .98)
    );
}

.salah-quran-card
.salah-quran-reading-session.complete
.salah-quran-reading-session-icon {
  background: rgba(201, 169, 106, .2);
}

.salah-quran-card
.salah-quran-reading-session.complete
.salah-quran-reading-session-time {
  color: #735f37;
}


/* ------------------------------------------------------------
   MOBILE
   ------------------------------------------------------------ */

@media (max-width: 560px) {
  .salah-quran-card .salah-quran-reading-session {
    max-width: calc(100% - 28px);

    margin-right: 14px;
    margin-left: 14px;

    padding-left: 9px;
  }

  .salah-quran-card
  .salah-quran-reading-session
  button.salah-quran-reading-session-toggle {
    padding-right: 9px;
    padding-left: 9px;
  }
}
