/* Zikr Reminder — Phase 1 viral features
   Tasbih counter · Peace Score · Life Clock · share buttons.
   Uses the shared design tokens from styles.css. */

/* ===== Tasbih counter (immersive overlay) ===== */
.tasbih-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: linear-gradient(160deg, #052e26 0%, #065f46 55%, #0a7d5a 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: calc(env(safe-area-inset-top, 0px) + 1rem) 1.1rem
           calc(env(safe-area-inset-bottom, 0px) + 1.25rem);
  overflow-y: auto;
  animation: tasbih-fade 0.28s ease;
}
@keyframes tasbih-fade { from { opacity: 0; } to { opacity: 1; } }

.tasbih-top {
  width: 100%;
  max-width: 460px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.tasbih-top h2 { font-size: 1.05rem; font-weight: 700; margin: 0; opacity: 0.95; }
.tasbih-close,
.tasbih-icon-btn {
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background 0.2s ease, transform 0.15s ease;
}
.tasbih-close:active,
.tasbih-icon-btn:active { transform: scale(0.9); }
.tasbih-close:hover,
.tasbih-icon-btn:hover { background: rgba(255, 255, 255, 0.24); }

.tasbih-dhikr-row {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  width: 100%;
  max-width: 460px;
  padding: 1rem 0.1rem 0.4rem;
  scrollbar-width: none;
}
.tasbih-dhikr-row::-webkit-scrollbar { display: none; }
.tasbih-chip {
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.12);
  border: 1.5px solid transparent;
  color: #fff;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.tasbih-chip.active {
  background: rgba(255, 255, 255, 0.96);
  color: #065f46;
  border-color: #fff;
}

.tasbih-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 460px;
  padding: 0.5rem 0;
}
.tasbih-arabic {
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
  font-size: 2.6rem;
  line-height: 1.4;
  margin: 0.25rem 0 0.1rem;
  text-align: center;
}
.tasbih-translit { font-size: 0.95rem; opacity: 0.78; margin-bottom: 0.25rem; text-align: center; }
.tasbih-meaning { font-size: 0.82rem; opacity: 0.6; margin-bottom: 1.1rem; text-align: center; }

.tasbih-button {
  position: relative;
  width: min(62vw, 244px);
  height: min(62vw, 244px);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.08));
  box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.12), 0 18px 50px rgba(0, 0, 0, 0.35);
  color: #fff;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.08s ease, box-shadow 0.2s ease;
}
.tasbih-button:active { transform: scale(0.95); box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.18), 0 10px 30px rgba(0, 0, 0, 0.35); }
.tasbih-count {
  font-size: 4.6rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.tasbih-tap-hint { font-size: 0.78rem; opacity: 0.65; margin-top: 0.4rem; }

.tasbih-round { margin-top: 1.1rem; font-size: 0.85rem; opacity: 0.85; font-variant-numeric: tabular-nums; }

.tasbih-goalbar {
  width: 100%;
  max-width: 360px;
  margin: 0.6rem auto 0;
}
.tasbih-goalbar-track {
  height: 8px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  overflow: hidden;
}
.tasbih-goalbar-fill {
  height: 100%;
  background: linear-gradient(90deg, #fde68a, #fbbf24);
  border-radius: 999px;
  transition: width 0.35s ease;
}
.tasbih-goalbar-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  opacity: 0.8;
  margin-top: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.tasbih-actions {
  display: flex;
  gap: 0.6rem;
  width: 100%;
  max-width: 460px;
  margin-top: 1.1rem;
}
.tasbih-actions .btn { flex: 1; }
.tasbih-ghost {
  background: rgba(255, 255, 255, 0.14);
  border: none;
  color: #fff;
}
.tasbih-ghost:hover { background: rgba(255, 255, 255, 0.24); }

/* ===== Peace Score card ===== */
.peace-card {
  background: var(--grad-card);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg, 20px);
  padding: 1.25rem 1.1rem;
  box-shadow: var(--shadow-md);
}
.peace-head {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.peace-ring { flex-shrink: 0; }
.peace-head-text { flex: 1; min-width: 0; }
.peace-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--c-text-muted);
  font-weight: 700;
  margin: 0;
}
.peace-tag {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0.15rem 0 0.1rem;
  color: var(--c-text);
}
.peace-sub { font-size: 0.82rem; color: var(--c-text-muted); line-height: 1.5; margin: 0; }

.peace-breakdown { margin-top: 1rem; display: grid; gap: 0.55rem; }
.peace-bar-row { display: grid; grid-template-columns: 92px 1fr 34px; align-items: center; gap: 0.6rem; }
.peace-bar-key { font-size: 0.78rem; color: var(--c-text-muted); }
.peace-bar-track { height: 7px; background: var(--c-bg-soft); border-radius: 999px; overflow: hidden; }
.peace-bar-fill { height: 100%; background: var(--grad-primary); border-radius: 999px; transition: width 0.7s ease; }
.peace-bar-val { font-size: 0.76rem; color: var(--c-text-soft); text-align: right; font-variant-numeric: tabular-nums; }

/* ===== Life Clock card ===== */
.lifeclock-card {
  background: linear-gradient(150deg, rgba(15, 23, 42, 0.92), rgba(6, 78, 59, 0.92));
  color: #fff;
  border-radius: var(--radius-lg, 20px);
  padding: 1.35rem 1.15rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
.lifeclock-card::after {
  content: '';
  position: absolute;
  top: -40%; right: -20%;
  width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.35), transparent 70%);
  pointer-events: none;
}
.lc-head { display: flex; align-items: center; gap: 0.6rem; position: relative; z-index: 1; }
.lc-head .lc-icon { font-size: 1.5rem; }
.lc-head h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.lc-head p { margin: 0.1rem 0 0; font-size: 0.76rem; opacity: 0.7; }

.lc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin: 1rem 0 0.4rem;
  position: relative; z-index: 1;
}
.lc-stat {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 0.75rem 0.6rem;
  text-align: center;
}
.lc-stat-val { font-size: 1.5rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.lc-stat-label { font-size: 0.72rem; opacity: 0.78; margin-top: 0.3rem; }

.lc-bar-wrap { margin-top: 0.9rem; position: relative; z-index: 1; }
.lc-bar-track { height: 9px; background: rgba(255, 255, 255, 0.16); border-radius: 999px; overflow: hidden; }
.lc-bar-fill { height: 100%; background: linear-gradient(90deg, #34d399, #fbbf24); border-radius: 999px; }
.lc-bar-label { display: flex; justify-content: space-between; font-size: 0.72rem; opacity: 0.8; margin-top: 0.4rem; }
.lc-note { font-size: 0.82rem; opacity: 0.85; line-height: 1.55; margin: 0.9rem 0 0; position: relative; z-index: 1; }
.lc-actions { display: flex; gap: 0.5rem; margin-top: 1rem; position: relative; z-index: 1; }
.lc-actions .btn { flex: 1; }

/* Share row used by Peace + Life Clock */
.feature-share-row { display: flex; gap: 0.5rem; margin-top: 1rem; }
.feature-share-row .btn { flex: 1; }

/* RTL niceties */
[dir="rtl"] .peace-bar-row { grid-template-columns: 34px 1fr 92px; }
[dir="rtl"] .peace-bar-val { text-align: left; }
