/* ══════════════════════════════════════════════════════════════
   IAR — How Do I Pray? V6 — Guided Mode overlay styles
═══════════════════════════════════════════════════════════════ */

/* Lock body scroll when open */
body.gm-lock { overflow: hidden; }

/* ── Overlay shell ───────────────────────────────────────── */
.gm-overlay {
  position: fixed; inset: 0; z-index: 10000;
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease;
  font-family: 'Crimson Text', Georgia, serif;
  color: var(--text);
}
.gm-overlay.open { opacity: 1; pointer-events: auto; }

.gm-backdrop {
  position: absolute; inset: 0;
  background: rgba(18, 45, 30, .62);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.gm-panel {
  position: absolute; inset: 0;
  margin: auto;
  width: min(760px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  top: 1rem; bottom: 1rem;
  display: flex; flex-direction: column;
  background: var(--cream);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0,0,0,.4), 0 0 0 1px rgba(255,255,255,.2);
  overflow: hidden;
  transform: translateY(16px);
  transition: transform .24s cubic-bezier(.2,.9,.3,1);
}
.gm-overlay.open .gm-panel { transform: translateY(0); }

/* ── Header ──────────────────────────────────────────────── */
.gm-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, var(--teal-dark) 0%, var(--teal) 100%);
  color: #fff;
  padding: .9rem 1.1rem;
  flex-shrink: 0;
}
.gm-header-left { min-width: 0; }
.gm-label {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem; font-weight: 700;
  line-height: 1.15;
}
.gm-sub {
  font-size: .82rem; opacity: .8;
  margin-top: .12rem;
  font-style: italic;
}
.gm-header-right { display: flex; gap: .35rem; flex-shrink: 0; }
.gm-icon-btn {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  color: #fff;
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.gm-icon-btn:hover { background: rgba(255,255,255,.2); border-color: rgba(255,255,255,.4); }
.gm-icon-btn svg { width: 16px; height: 16px; }

/* ── Progress strip ──────────────────────────────────────── */
.gm-progress {
  padding: .75rem 1.1rem .65rem;
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.gm-progress-bar {
  height: 6px;
  background: var(--gold-light);
  border-radius: 3px;
  overflow: hidden;
}
.gm-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--teal) 0%, var(--gold) 100%);
  border-radius: 3px;
  transition: width .35s cubic-bezier(.2,.9,.3,1);
}
.gm-progress-meta {
  display: flex; justify-content: space-between;
  margin-top: .4rem;
  font-size: .78rem; color: var(--muted);
  font-family: 'Playfair Display', serif;
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ── Body (scroll area) ──────────────────────────────────── */
.gm-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.4rem 1.6rem 1.6rem;
  scroll-behavior: smooth;
}

/* ── Step card ───────────────────────────────────────────── */
.gm-step-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1.1rem;
}
.gm-step-num {
  font-family: 'Playfair Display', serif;
  font-size: 2.4rem; font-weight: 700;
  color: var(--gold);
  line-height: 1;
  letter-spacing: -.02em;
  opacity: .9;
}
.gm-step-heading { min-width: 0; }
.gm-step-cat {
  font-size: .72rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .1rem;
  font-family: 'Playfair Display', serif;
  font-weight: 600;
}
.gm-step-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--teal-dark);
  margin: 0 0 .15rem;
  line-height: 1.15;
  border: none; padding: 0;
}
.gm-step-ar {
  font-family: 'Amiri', serif;
  font-size: 1.3rem;
  color: var(--teal);
  direction: rtl;
  line-height: 1.6;
}
.gm-step-ill {
  width: 96px; height: 112px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .4rem;
  color: var(--teal);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.gm-step-ill svg { width: 100%; height: 100%; display: block; }

.gm-step-desc {
  font-size: 1.1rem;
  line-height: 1.75;
  color: var(--text);
  margin: 0 0 1.2rem;
}

/* ── Say block ───────────────────────────────────────────── */
.gm-say {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--teal);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.2rem;
  margin: .9rem 0;
  box-shadow: 0 2px 8px rgba(30,90,51,.06);
}
.gm-say-head {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem;
  margin-bottom: .6rem;
  padding-bottom: .5rem;
  border-bottom: 1px dashed var(--border);
}
.gm-say-label {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: 'Playfair Display', serif;
  font-size: .72rem;
  color: var(--teal-dark);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.gm-say-label::before {
  content: '';
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--gold);
  border-radius: 50%;
}

.gm-ar-toggle {
  display: flex;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px;
  font-size: .72rem;
}
.gm-ar-toggle button {
  background: none; border: none;
  padding: .28rem .7rem;
  border-radius: 18px;
  cursor: pointer;
  color: var(--muted);
  font-family: 'Crimson Text', serif;
  font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
}
.gm-ar-toggle button.active {
  background: var(--teal);
  color: #fff;
}
.gm-ar-toggle button:hover:not(.active) { color: var(--teal-dark); }

.gm-say-ar {
  font-family: 'Amiri', serif;
  font-size: 1.7rem;
  text-align: center;
  direction: rtl;
  color: var(--teal-dark);
  line-height: 2.1;
  margin: .2rem 0 .3rem;
}
.gm-say-ar-lg { font-size: 2.1rem; }
.gm-say-trl {
  text-align: center;
  font-style: italic;
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: .3rem;
  line-height: 1.55;
}
.gm-say-trn {
  text-align: center;
  font-size: 1.02rem;
  color: var(--text);
  line-height: 1.55;
}

.gm-followup-label {
  font-family: 'Playfair Display', serif;
  font-size: .85rem;
  color: var(--teal-dark);
  font-style: italic;
  margin: 1rem 0 -.3rem;
  padding-left: .1rem;
}

/* ── Tip ──────────────────────────────────────────────────── */
.gm-tip {
  background: var(--gold-light);
  border-left: 3px solid var(--gold);
  padding: .7rem .9rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .95rem;
  line-height: 1.6;
  margin: 1rem 0 .5rem;
}
.gm-tip strong { color: var(--gold); font-family: 'Playfair Display', serif; }

/* ── Read-more link ─────────────────────────────────────── */
.gm-readmore {
  display: inline-flex; align-items: center; gap: .35rem;
  background: none; border: 1px solid var(--border);
  padding: .5rem .9rem;
  border-radius: 20px;
  margin-top: .8rem;
  cursor: pointer;
  font-family: 'Playfair Display', serif;
  font-size: .82rem; font-weight: 600;
  color: var(--teal-dark);
  transition: all .15s;
}
.gm-readmore:hover {
  background: var(--teal-light);
  border-color: var(--teal);
}
.gm-readmore svg { width: 12px; height: 12px; }

/* ── Footer ──────────────────────────────────────────────── */
.gm-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: .8rem;
  padding: .85rem 1.1rem;
  background: #fff;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.gm-nav {
  display: inline-flex; align-items: center; gap: .4rem;
  background: #fff;
  border: 1.5px solid var(--border);
  padding: .55rem 1rem;
  border-radius: 22px;
  cursor: pointer;
  font-family: 'Playfair Display', serif;
  font-size: .9rem; font-weight: 600;
  color: var(--teal-dark);
  transition: all .15s;
}
.gm-nav:hover:not(:disabled) { border-color: var(--teal); background: var(--teal-light); }
.gm-nav:disabled { opacity: .4; cursor: not-allowed; }
.gm-nav svg { width: 14px; height: 14px; }
.gm-nav-primary {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}
.gm-nav-primary:hover:not(:disabled) {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
  color: #fff;
}

/* ── Learned checkbox ───────────────────────────────────── */
.gm-learned {
  display: inline-flex; align-items: center; gap: .5rem;
  cursor: pointer;
  font-size: .9rem;
  font-family: 'Crimson Text', serif;
  color: var(--muted);
  user-select: none;
}
.gm-learned input { position: absolute; opacity: 0; pointer-events: none; }
.gm-box {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
  position: relative;
  flex-shrink: 0;
}
.gm-box::after {
  content: '';
  width: 10px; height: 5px;
  border: 2px solid #fff; border-top: 0; border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
  transition: opacity .15s;
}
.gm-learned input:checked + .gm-box {
  background: var(--teal);
  border-color: var(--teal);
}
.gm-learned input:checked + .gm-box::after { opacity: 1; }
.gm-learned:hover .gm-box { border-color: var(--teal); }

/* ── Completion screen ──────────────────────────────────── */
.gm-complete {
  text-align: center;
  padding: 1.5rem .5rem;
}
.gm-complete-check {
  width: 72px; height: 72px;
  margin: 0 auto 1.2rem;
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 8px 24px rgba(30,90,51,.35);
}
.gm-complete-check svg { width: 36px; height: 36px; }
.gm-complete h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.7rem;
  color: var(--teal-dark);
  margin: 0 0 .6rem;
  border: none; padding: 0;
}
.gm-complete p {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 460px; margin: .4rem auto;
  line-height: 1.65;
}
.gm-complete-count {
  font-family: 'Playfair Display', serif;
  color: var(--gold) !important;
  font-weight: 700;
  font-size: 1rem !important;
  margin-top: 1rem !important;
}
.gm-complete-btns {
  display: flex; gap: .6rem; justify-content: center;
  margin-top: 1.5rem; flex-wrap: wrap;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 640px) {
  .gm-panel {
    width: 100vw;
    max-height: 100vh;
    top: 0; bottom: 0;
    border-radius: 0;
  }
  .gm-body { padding: 1.1rem 1rem 1.3rem; }
  .gm-step-head { grid-template-columns: auto 1fr; gap: .7rem; }
  .gm-step-ill {
    grid-column: 1 / -1;
    width: 88px; height: 100px;
    justify-self: center;
    margin-top: .3rem;
  }
  .gm-step-num { font-size: 2rem; }
  .gm-step-name { font-size: 1.3rem; }
  .gm-step-ar { font-size: 1.1rem; }
  .gm-step-desc { font-size: 1rem; }
  .gm-say-ar { font-size: 1.4rem; }
  .gm-say-ar-lg { font-size: 1.7rem; }
  .gm-footer { padding: .7rem .8rem; gap: .5rem; }
  .gm-nav { padding: .5rem .8rem; font-size: .82rem; }
  .gm-learned { font-size: .8rem; }
  .gm-learned span:last-child { display: none; }
  .gm-ar-toggle { font-size: .68rem; }
  .gm-ar-toggle button { padding: .25rem .55rem; }
}
