/* ==========================================================================
   Kunuzia - Minimalist Digital Tasbeeh & Community Support
   Theme: Obsidian Slate, Muted Brass Gold, Deep Cypress Green
   Standard Modern UI (Clean, fast, distraction-free)
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&family=Scheherazade+New:wght@400;700&display=swap');

:root {
  --bg-main: #0c1114;
  --bg-surface: #131a1e;
  --bg-surface-elevated: #1a2329;
  --bg-card: rgba(255, 255, 255, 0.035);
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-accent: rgba(197, 168, 128, 0.28);

  --gold-primary: #c5a880;
  --gold-light: #dfcbb1;
  --gold-glow: rgba(197, 168, 128, 0.12);

  --cypress: #2d5446;
  --cypress-light: #447a67;

  --text-primary: #f0f3f4;
  --text-secondary: #9aa7ab;
  --text-muted: #6b777a;

  --danger: #d9534f;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
  --font-arabic: 'Scheherazade New', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ── Top Navbar ── */
.navbar {
  width: 100%;
  max-width: 500px;
  padding: 16px 16px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--cypress), #162a22);
  border: 1px solid var(--border-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-primary);
  font-family: var(--font-arabic);
  font-size: 1.3rem;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--gold-light);
}

.brand-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: block;
  margin-top: -2px;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
}

.icon-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--gold-primary);
  border-color: var(--border-accent);
}

.icon-btn.active {
  background: var(--cypress);
  color: #fff;
  border-color: var(--cypress-light);
}

/* ── Main App Container ── */
.app-container {
  width: 100%;
  max-width: 480px;
  padding: 8px 16px 36px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Sacred Dhikr Hero Card (Astaghfirullah Focus) ── */
.dhikr-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 22px 18px 18px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.dhikr-arabic {
  font-family: var(--font-arabic);
  font-size: 2.7rem;
  line-height: 1.25;
  color: var(--gold-light);
  margin-bottom: 6px;
}

.dhikr-trans {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.dhikr-meaning {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* ── Voice Engine Ribbon ── */
.voice-ribbon {
  width: 100%;
  padding: 8px 14px;
  background: rgba(45, 84, 70, 0.15);
  border: 1px solid rgba(45, 84, 70, 0.35);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
}

.voice-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold-light);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cypress-light);
}

.status-dot.listening {
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: pulseDot 1.4s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* ── Counter Section ── */
.counter-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.count-stats-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 18px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.stat-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-pill-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
}

.stat-pill-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold-primary);
}

/* Circular Tapper */
.tapper-btn {
  width: 216px;
  height: 216px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #1e282e 0%, #11171b 80%);
  border: 2px solid var(--border-accent);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.6), inset 0 2px 6px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  transition: transform 0.08s ease, box-shadow 0.08s ease, border-color 0.2s ease;
}

.tapper-btn:active {
  transform: scale(0.965);
  border-color: var(--gold-primary);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
}

.tapper-count {
  font-size: 3.8rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.tapper-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 8px;
}

/* Controls (Reset, Undo) */
.tapper-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.action-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
}

.action-btn:hover {
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  border-color: var(--border-accent);
}

/* ── Daily Progress & History ── */
.stats-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 18px 16px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--gold-light);
  display: flex;
  align-items: center;
  gap: 7px;
}

.section-badge {
  font-size: 0.65rem;
  background: var(--bg-card);
  padding: 3px 8px;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

/* Progress bar */
.progress-wrap {
  margin-bottom: 14px;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--cypress), var(--gold-primary));
  width: 0%;
  transition: width 0.35s ease;
}

/* 7-Day History Grid */
.history-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.history-day-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 3px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.history-day-card.today {
  border-color: var(--gold-primary);
  background: rgba(197, 168, 128, 0.08);
}

.day-label {
  font-size: 0.62rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.day-val {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* ── Kunuzia Pledge & Shopping Support ── */
.support-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px 16px;
}

.pledge-banner {
  background: linear-gradient(135deg, rgba(45, 84, 70, 0.25), rgba(197, 168, 128, 0.1));
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
}

.pledge-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--gold-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pledge-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.stepper-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

@media (max-width: 380px) {
  .stepper-grid { grid-template-columns: 1fr; gap: 6px; }
}

.step-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  text-align: center;
}

.step-num {
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--gold-primary);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.step-title {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
}

.converter-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-container {
  position: relative;
  display: flex;
  align-items: center;
}

.converter-input {
  width: 100%;
  background: var(--bg-main);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.8rem;
  padding: 11px 75px 11px 12px;
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition);
}

.converter-input:focus {
  border-color: var(--gold-primary);
}

.btn-paste {
  position: absolute;
  right: 5px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-paste:hover {
  color: var(--gold-primary);
  border-color: var(--border-accent);
}

.btn-convert {
  background: linear-gradient(135deg, var(--cypress), #1a362b);
  border: 1px solid var(--cypress-light);
  color: #ffffff;
  padding: 11px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all var(--transition);
}

.btn-convert:active {
  transform: scale(0.985);
}

.btn-convert:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.converter-status {
  font-size: 0.74rem;
  text-align: center;
  margin-top: 8px;
  min-height: 18px;
  display: none;
}

.fallback-box {
  display: none;
  margin-top: 8px;
}

.btn-manual-open {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--gold-primary);
  color: #0c1114;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
}

/* Accordion Video Player */
.video-accordion {
  margin-top: 12px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 10px;
}

.video-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
}

.video-toggle:hover {
  color: var(--gold-primary);
}

.video-player-wrap {
  display: none;
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-top: 8px;
  background: #000;
}

.video-player-wrap iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ── Celebration Modal (ONLY on Daily Target or Timer) ── */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.22s ease;
}

.modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.celebration-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  max-width: 380px;
  width: 100%;
  padding: 22px 18px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
  transform: translateY(12px) scale(0.96);
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-backdrop.open .celebration-card {
  transform: translateY(0) scale(1);
}

.celeb-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--gold-primary);
  background: var(--gold-glow);
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.celeb-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  line-height: 1.35;
}

.celeb-message {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
}

.btn-whatsapp-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #25D366;
  color: #ffffff;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 700;
  width: 100%;
  margin-bottom: 8px;
  transition: opacity var(--transition);
}

.btn-whatsapp-share:hover {
  opacity: 0.92;
}

.btn-close-modal {
  background: none;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.76rem;
  width: 100%;
  cursor: pointer;
}

.btn-close-modal:hover {
  color: var(--text-primary);
  border-color: var(--border-accent);
}

/* ── Reset Dialog ── */
.dialog-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  max-width: 320px;
  width: 100%;
  padding: 20px;
  text-align: center;
}

.dialog-card h4 {
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.dialog-card p {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.dialog-actions {
  display: flex;
  gap: 8px;
}

.dialog-actions button {
  flex: 1;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger {
  background: var(--danger);
  border: none;
  color: #fff;
}

.btn-cancel {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

/* ── Toast ── */
.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-accent);
  color: var(--gold-light);
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.78rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 1000;
}

.toast-msg.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Site Footer ── */
.site-footer {
  width: 100%;
  max-width: 500px;
  padding: 16px 16px 36px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.7rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
}

.footer-nav a {
  color: var(--text-secondary);
  transition: color var(--transition);
}

.footer-nav a:hover {
  color: var(--gold-primary);
}

.footer-disclaimer-note {
  font-size: 0.65rem;
  line-height: 1.45;
  margin-bottom: 8px;
  color: var(--text-muted);
}

.footer-copy {
  font-size: 0.62rem;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ── Secondary Pages ── */
.page-container {
  width: 100%;
  max-width: 660px;
  padding: 20px 16px 40px;
}

.page-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  margin-bottom: 20px;
}

.page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 6px;
}

.page-subtitle {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 10px;
}

.page-content h3 {
  font-size: 0.98rem;
  color: var(--gold-primary);
  margin: 16px 0 6px;
}

.page-content p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}

.page-content ul {
  padding-left: 20px;
  margin-bottom: 12px;
}

.page-content li {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 5px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gold-primary);
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 14px;
}
