/* ============================================
   ZIKR & TASBIH COUNTER — /zikr
   The page reuses the design's .dua-* blocks (hero, shell, sidebar, card);
   only what the counter adds is defined here. Dark mode keys off body.dark,
   the same switch css/dark.css uses.
   ============================================ */

/* ---- Hero ---- */
.zikr-hero-highlight { color: #6ee7b7; }

/* ---- Sidebar: the design's category button, rendered as a link ---- */
a.zikr-cat-link { text-decoration: none; }
a.zikr-cat-link:focus-visible,
.zikr-title-link:focus-visible {
  outline: 2px solid #1f7a63;
  outline-offset: 2px;
}
.zikr-today .dua-source-item strong { color: #1f7a63; font-weight: 700; }
.zikr-related { position: sticky; top: 88px; }

/* ---- Card additions ---- */
.zikr-card { scroll-margin-top: 90px; }
.zikr-card.is-complete { border-left-color: #2eb872; }
.zikr-title-link { color: inherit; text-decoration: none; }
.zikr-title-link:hover { color: var(--dua-color, #1f7a63); }
.zikr-detail-title { font-size: 1.5rem; }
.zikr-virtue-label { font-weight: 700; }

.zikr-time-badge,
.zikr-featured-badge,
.zikr-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 50rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.zikr-time-badge { background: #f3f4f6; color: #4b5563; }
.zikr-featured-badge { background: #fef3c7; color: #b45309; }
.zikr-done-badge { background: #d1fae5; color: #047857; }

/* ---- Tasbih counter ---- */
.zikr-counter {
  display: flex;
  align-items: center;
  gap: 20px;
  background: #f9fafb;
  border: 1px solid #e9ecef;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 16px;
}
.zikr-ring {
  position: relative;
  width: 128px;
  height: 128px;
  flex-shrink: 0;
}
.zikr-ring-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  pointer-events: none;
}
.zikr-ring-track,
.zikr-ring-fill {
  fill: none;
  stroke-width: 8;
}
.zikr-ring-track { stroke: #e5e7eb; }
.zikr-ring-fill {
  stroke: var(--dua-color, #1f7a63);
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 0.25s ease, stroke 0.25s ease;
}
.zikr-tap {
  position: absolute;
  inset: 12px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #1f8a4c, #1f7a63);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(31, 122, 99, 0.35);
  transition: transform 0.08s ease, box-shadow 0.2s ease, background 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; /* no double-tap zoom while counting quickly */
  user-select: none;
}
.zikr-tap:hover { box-shadow: 0 8px 24px rgba(31, 122, 99, 0.45); }
.zikr-tap:active { transform: scale(0.95); }
.zikr-tap:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 3px;
}
.zikr-tap.is-pulsing { animation: zikr-pulse 0.25s ease; }
.zikr-tap[aria-disabled="true"] { cursor: default; }
.zikr-count {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.zikr-target {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.85;
}
@keyframes zikr-pulse {
  0% { transform: scale(1); }
  40% { transform: scale(0.93); }
  100% { transform: scale(1); }
}

.zikr-counter-side { flex: 1; min-width: 0; }
.zikr-counter-status {
  font-size: 14px;
  font-weight: 700;
  color: #1c1c1c;
  margin-bottom: 8px;
}
.zikr-progress {
  height: 8px;
  background: #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
}
.zikr-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #1f8a4c, #2eb872);
  border-radius: 8px;
  transition: width 0.25s ease;
}
.zikr-counter-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.zikr-counter-actions .dua-action-btn:disabled { opacity: 0.5; cursor: not-allowed; }
#zikrVibrateToggle[aria-pressed="false"] { opacity: 0.7; }

/* Completion state */
.zikr-counter.is-complete { background: #ecfdf5; border-color: #a7f3d0; }
.zikr-counter.is-complete .zikr-ring-fill { stroke: #2eb872; }
.zikr-counter.is-complete .zikr-tap { background: linear-gradient(145deg, #2eb872, #059669); }
.zikr-counter.is-complete .zikr-counter-status { color: #047857; }

/* ---- Dark mode ---- */
body.dark .zikr-today .dua-source-item strong { color: #2eb872; }
body.dark .zikr-time-badge { background: #1e2a30; color: #9ca3af; }
body.dark .zikr-featured-badge { background: #1c1306; color: #d97706; }
body.dark .zikr-done-badge { background: #0a2e1c; color: #2eb872; }
body.dark .zikr-counter { background: #061410; border-color: #1e2a30; }
body.dark .zikr-ring-track { stroke: #1e2a30; }
body.dark .zikr-counter-status { color: #e5e7eb; }
body.dark .zikr-progress { background: #1e2a30; }
body.dark .zikr-counter.is-complete { background: #0a1e17; border-color: #1a4d35; }
body.dark .zikr-counter.is-complete .zikr-counter-status { color: #2eb872; }
body.dark .zikr-tap { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5); }
body.dark a.zikr-cat-link:focus-visible,
body.dark .zikr-title-link:focus-visible { outline-color: #2eb872; }
body.dark .zikr-hero-highlight { color: #2eb872; }

/* ---- Responsive ---- */
@media (max-width: 991.98px) {
  body.dark .zikr-shell .dua-sidebar { background: #0b141a; }
  .zikr-related { position: static; }
}
@media (max-width: 575.98px) {
  .zikr-counter { flex-direction: column; align-items: stretch; text-align: center; gap: 14px; }
  .zikr-ring { width: 156px; height: 156px; margin: 0 auto; }
  .zikr-count { font-size: 2.4rem; }
  .zikr-counter-actions { justify-content: center; }
  .zikr-detail-title { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .zikr-tap,
  .zikr-tap.is-pulsing,
  .zikr-ring-fill,
  .zikr-progress-fill { transition: none; animation: none; }
}
