/* ============================================
   ALHAMMAD PRAYER APP — style.css
   Enhanced Edition: Fixed Tasbih Ring Alignment + Polished UI
   ============================================ */

:root {
  /* Dark Theme (default) */
  --bg-primary: #0d1f16;
  --bg-secondary: #132a1e;
  --bg-card: #1a3a2a;
  --bg-card2: #1f4533;
  --bg-nav: #0a1710;
  --text-primary: #f0ede4;
  --text-secondary: #a8c4b0;
  --text-muted: #6a8f76;
  --gold: #c9a84c;
  --gold-light: #e8c76a;
  --gold-dim: #7a6430;
  --accent-gold: #D29B1A;
  --accent-gold-dim: #EDC154;
  --accent: #2d8c5e;
  --accent-light: #3aaa72;
  --accent-glow: rgba(45, 140, 94, 0.15);
  --success: #3f9dd8; /* Blue for Subhanallah progress bar */
  --border: rgba(45, 140, 94, 0.2);
  --border-strong: rgba(201, 168, 76, 0.3);
  --prayer-active-bg: linear-gradient(135deg, #1e5c3e, #2d8c5e);
  --ring-bg: rgba(255, 255, 255, 0.08);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.12);
  --header-height: 60px;
  --nav-height: 68px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="light"] {
  --bg-primary: #f8f5ef;
  --bg-secondary: #f0ebe2;
  --bg-card: #ffffff;
  --bg-card2: #f9f6ef;
  --bg-nav: #ffffff;
  --text-primary: #1a2e22;
  --text-secondary: #4a6b56;
  --text-muted: #8aaa96;
  --gold: #a07830;
  --gold-light: #c09040;
  --gold-dim: #d4b870;
  --accent-gold: #a07830;
  --accent-gold-dim: #d4b870;
  --accent: #1e7048;
  --accent-light: #28905e;
  --accent-glow: rgba(30, 112, 72, 0.08);
  --border: rgba(30, 112, 72, 0.12);
  --border-strong: rgba(160, 120, 48, 0.25);
  --prayer-active-bg: linear-gradient(135deg, #1e7048, #28905e);
  --ring-bg: rgba(0, 0, 0, 0.05);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* ========== GOLD ACCENT THEME ========== */
[data-theme-accent="gold"] {
  --gold: #e8c948;
  --gold-light: #f5d860;
  --gold-dim: #b09030;
  --border-strong: rgba(232, 201, 72, 0.6);
  --accent-glow: rgba(232, 201, 72, 0.25);
  --prayer-active-bg: linear-gradient(135deg, #1e5c3e, #e8c948);
}

[data-theme="light"][data-theme-accent="gold"] {
  --gold: #c09020;
  --gold-light: #d8a830;
  --gold-dim: #e8c870;
  --border-strong: rgba(192, 144, 32, 0.5);
  --accent-glow: rgba(192, 144, 32, 0.2);
  --prayer-active-bg: linear-gradient(135deg, #1e7048, #c09020);
}

/* Gold Accent overrides — high impact */
[data-theme-accent="gold"] .page-title,
[data-theme-accent="gold"] .next-prayer-name,
[data-theme-accent="gold"] .ziyarat-card-title,
[data-theme-accent="gold"] .asma-name,
[data-theme-accent="gold"] .dhikr-item-text-ar {
  color: #e8c948;
  text-shadow: 0 0 12px rgba(232, 201, 72, 0.35);
}

[data-theme-accent="gold"] .bottom-nav {
  border-top: 2px solid rgba(232, 201, 72, 0.5);
  box-shadow: 0 -4px 20px rgba(232, 201, 72, 0.15);
}

[data-theme-accent="gold"] .nav-btn.active {
  color: #e8c948;
  text-shadow: 0 0 8px rgba(232, 201, 72, 0.4);
}

[data-theme-accent="gold"] .prayer-card.active {
  border-color: rgba(232, 201, 72, 0.7);
  box-shadow: 0 0 20px rgba(232, 201, 72, 0.25), 0 4px 16px rgba(0,0,0,0.3);
}

[data-theme-accent="gold"] .saved-item-category,
[data-theme-accent="gold"] .dhikr-item-count,
[data-theme-accent="gold"] .qadha-count {
  background: #e8c948;
  color: #1a1a1a;
}

[data-theme-accent="gold"] .btn-primary {
  background: #e8c948;
  color: #1a1a1a;
  border: 1px solid #f5d860;
  box-shadow: 0 0 15px rgba(232, 201, 72, 0.3);
}

[data-theme-accent="gold"] .settings-group-label {
  color: #e8c948;
  text-shadow: 0 0 8px rgba(232, 201, 72, 0.2);
}

[data-theme-accent="gold"] .toggle-slider {
  background: #2d5c3e;
}

[data-theme-accent="gold"] .toggle input:checked + .toggle-slider {
  background: #e8c948;
}

[data-theme-accent="gold"] .tasbih-ring-progress {
  stroke: #e8c948;
  filter: drop-shadow(0 0 6px rgba(232, 201, 72, 0.5));
}

[data-theme-accent="gold"] .quote-source,
[data-theme-accent="gold"] .saved-item-source {
  color: #e8c948;
}

[data-theme="light"][data-theme-accent="gold"] .page-title,
[data-theme="light"][data-theme-accent="gold"] .next-prayer-name,
[data-theme="light"][data-theme-accent="gold"] .ziyarat-card-title,
[data-theme="light"][data-theme-accent="gold"] .asma-name,
[data-theme="light"][data-theme-accent="gold"] .dhikr-item-text-ar {
  color: #c09020;
  text-shadow: 0 0 8px rgba(192, 144, 32, 0.2);
}

[data-theme="light"][data-theme-accent="gold"] .bottom-nav {
  border-top: 2px solid rgba(192, 144, 32, 0.4);
  box-shadow: 0 -4px 20px rgba(192, 144, 32, 0.1);
}

[data-theme="light"][data-theme-accent="gold"] .nav-btn.active {
  color: #c09020;
  text-shadow: 0 0 6px rgba(192, 144, 32, 0.3);
}

[data-theme="light"][data-theme-accent="gold"] .prayer-card.active {
  border-color: rgba(192, 144, 32, 0.6);
  box-shadow: 0 0 16px rgba(192, 144, 32, 0.15), 0 4px 16px rgba(0,0,0,0.1);
}

[data-theme="light"][data-theme-accent="gold"] .saved-item-category,
[data-theme="light"][data-theme-accent="gold"] .dhikr-item-count,
[data-theme="light"][data-theme-accent="gold"] .qadha-count {
  background: #c09020;
  color: #fff;
}

[data-theme="light"][data-theme-accent="gold"] .btn-primary {
  background: #c09020;
  color: #fff;
  border: 1px solid #d8a830;
  box-shadow: 0 0 12px rgba(192, 144, 32, 0.2);
}

[data-theme="light"][data-theme-accent="gold"] .settings-group-label {
  color: #c09020;
  text-shadow: 0 0 6px rgba(192, 144, 32, 0.15);
}

[data-theme="light"][data-theme-accent="gold"] .toggle input:checked + .toggle-slider {
  background: #c09020;
}

[data-theme="light"][data-theme-accent="gold"] .tasbih-ring-progress {
  stroke: #c09020;
  filter: drop-shadow(0 0 4px rgba(192, 144, 32, 0.3));
}

[data-theme="light"][data-theme-accent="gold"] .quote-source,
[data-theme="light"][data-theme-accent="gold"] .saved-item-source {
  color: #c09020;
}

/* ============ BASE RESET ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Cairo', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100dvh;
  overflow: hidden;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

body.lang-en {
  direction: ltr;
}

/* Language visibility */
.lang-ar .en {
  display: none !important;
}

.lang-ar .ar,
.lang-en .ar,
.lang-en .en {
  display: block;
}

span.ar,
span.en {
  display: inline;
}

/* AI Chat language visibility */
body.lang-en .ai-chat-subtitle.ar,
body.lang-en .ai-chat-fab-label.ar {
  display: none !important;
}

body.lang-ar .ai-chat-subtitle.en,
body.lang-ar .ai-chat-fab-label.en {
  display: none !important;
}

/* Calendar page language visibility */
body.lang-en #page-events .ar,
body.lang-en .events-calendar-intro .ar {
  display: none !important;
}

body.lang-ar #page-events .en,
body.lang-ar .events-calendar-intro .en {
  display: none !important;
}

/* Global Android tap highlight fix */
* {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* ============ SPLASH SCREEN ============ */
.splash {
  position: fixed;
  inset: 0;
  z-index: 999;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.splash.fade-out {
  opacity: 0;
  pointer-events: none;
}

.splash-inner {
  text-align: center;
  animation: splashIn 0.8s ease forwards;
}

@keyframes splashIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.bismillah {
  font-family: 'Amiri', serif;
  font-size: 1.3rem;
  color: var(--gold);
  letter-spacing: 0.08em;
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.splash-title {
  font-family: 'Amiri', serif;
  font-size: 3.8rem;
  color: var(--gold);
  line-height: 1;
  text-shadow: 0 0 40px rgba(201, 168, 76, 0.2);
}

.splash-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-top: 0.5rem;
  margin-bottom: 2rem;
}

.splash-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.splash-loader span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 1.2s ease-in-out infinite;
}

.splash-loader span:nth-child(2) {
  animation-delay: 0.2s;
}

.splash-loader span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes pulse {
  0%,
  80%,
  100% {
    opacity: 0.2;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============ APP LAYOUT ============ */
.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-width: 500px;
  margin: 0 auto;
  position: relative;
  background: var(--bg-primary);
  box-shadow: var(--shadow);
}

.app.hidden {
  display: none;
}

/* ============ OFFLINE BANNER ============ */
.offline-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: linear-gradient(135deg, #7a5c20, #a07830);
  color: #fff;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  animation: bannerSlideDown 0.3s ease;
  pointer-events: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.offline-banner.hidden {
  display: none;
}

.offline-icon {
  font-size: 0.85rem;
}

.offline-text {
  line-height: 1.3;
}

@keyframes bannerSlideDown {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============ HEADER ============ */
.app-header {
  height: var(--header-height);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.2rem;
  flex-shrink: 0;
  position: relative;
  z-index: 10;
  backdrop-filter: blur(4px);
}

.header-title {
  font-family: 'Amiri', serif;
  font-size: 1.7rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  -webkit-tap-highlight-color: transparent;
}

.icon-btn:active {
  transform: scale(0.92);
  background: var(--accent-glow);
  border-color: var(--gold-dim);
}

/* ============ PAGES ============ */
.pages-container {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.page {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0 0 1rem;
  opacity: 0;
  transform: translateX(40px) scale(0.96) translateZ(-20px);
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.32, 0.72, 0, 1), transform 0.5s cubic-bezier(0.32, 0.72, 0, 1), filter 0.5s ease;
  -webkit-overflow-scrolling: touch;
  will-change: transform, opacity, filter;
  filter: blur(2px) brightness(0.9);
  z-index: 1;
}

.lang-en .page {
  transform: translateX(-40px) scale(0.96) translateZ(-20px);
}

.page.active {
  opacity: 1;
  transform: translateX(0) scale(1) translateZ(0);
  pointer-events: all;
  filter: blur(0) brightness(1);
  z-index: 10;
  transition-delay: 0.05s;
}

.page.active ~ .page {
  z-index: 1;
}

/* Premium iOS-style page stacking */
.page {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Staggered entrance for child elements */
.page.active .next-prayer-card,
.page.active .prayer-list,
.page.active .qadha-home-widget,
.page.active .daily-quote,
.page.active .tasbih-container,
.page.active .qibla-container,
.page.active .quote-card,
.page.active .ziyarat-card,
.page.active .asma-card {
  animation: pageElementIn 0.4s cubic-bezier(0.32, 0.72, 0, 1) 0.15s both;
}

@keyframes pageElementIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Custom scrollbar */
.modal-sheet::-webkit-scrollbar {
  width: 4px;
}

.modal-sheet::-webkit-scrollbar-track {
  background: transparent;
}

.modal-sheet::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.modal-sheet::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dim);
}

.page-title {
  font-family: 'Amiri', serif;
  font-size: 1.5rem;
  color: var(--gold);
  text-align: center;
  padding: 1.2rem 1rem 0.8rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.2rem;
  font-weight: 600;
}

/* ============ HOME PAGE ============ */
.home-top {
  background: var(--bg-secondary);
  padding: 1.4rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.greeting-text {
  font-family: 'Amiri', serif;
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.hijri-date {
  font-family: 'Amiri', serif;
  font-size: 1.05rem;
  color: var(--gold);
  margin-bottom: 0.2rem;
}

.greg-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Location bar */
.location-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.7rem 1.2rem;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.location-bar svg {
  flex-shrink: 0;
  color: var(--accent-light);
}

.location-bar span {
  flex: 1;
}

.refresh-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  border-radius: 50%;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.refresh-btn:active {
  color: var(--gold);
  background: var(--accent-glow);
  transform: rotate(90deg);
}

/* Next prayer card */
.next-prayer-card {
  margin: 1rem 1.2rem;
  background: var(--prayer-active-bg);
  border-radius: 24px;
  padding: 1.4rem 1rem;
  text-align: center;
  border: 1px solid rgba(201, 168, 76, 0.25);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.next-prayer-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='1.5'%3E%3Ccircle cx='30' cy='30' r='22'/%3E%3Ccircle cx='30' cy='30' r='14'/%3E%3C/g%3E%3C/svg%3E") center/70px;
  pointer-events: none;
}

.next-label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.next-prayer-name {
  font-family: 'Amiri', serif;
  font-size: 1.8rem;
  color: #fff;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.next-prayer-time {
  font-size: 2.6rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.next-countdown {
  font-size: 0.75rem;
  color: var(--accent-gold);
  letter-spacing: 0.1em;
  font-family: monospace;
  font-weight: bold;
  margin-top: 18px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8), 0 0 8px rgba(243, 200, 83, 0.4);
}

/* Prayer list */
.prayer-list {
  padding: 0 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prayer-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  background: var(--bg-card);
  border-radius: 14px;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
  cursor: pointer;
}

.prayer-item.current {
  border-color: var(--gold-dim);
  background: var(--bg-card2);
  box-shadow: 0 0 0 1px var(--gold-dim) inset, var(--shadow-sm);
}

.prayer-item.passed {
  opacity: 0.5;
}

.prayer-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.prayer-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.2s;
}

.prayer-item.current .prayer-dot {
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.prayer-name {
  font-family: 'Amiri', serif;
  font-size: 1.1rem;
  color: var(--text-primary);
  font-weight: 500;
}

.prayer-item.current .prayer-name {
  color: var(--gold);
  font-weight: 600;
}

.prayer-time-display {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.04em;
  font-family: monospace;
}

.prayer-item.current .prayer-time-display {
  color: var(--gold-light);
  font-size: 1.2rem;
}

/* Daily quote on home */
.daily-quote {
  margin: 1rem 1.2rem;
  padding: 1rem 1.2rem;
  background: var(--bg-card);
  border-radius: 16px;
  border-right: 4px solid var(--gold);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s;
}

.lang-en .daily-quote {
  border-right: none;
  border-left: 4px solid var(--gold);
}

.quote-icon {
  font-family: 'Amiri', serif;
  font-size: 2rem;
  color: var(--gold-dim);
  line-height: 1;
  margin-bottom: 0.4rem;
}

.quote-text {
  font-family: 'Amiri', serif;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.quote-source {
  font-size: 0.75rem;
  color: var(--gold-dim);
  margin-top: 0.6rem;
}

/* ============ QIBLA PAGE ============ */
.qibla-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 1rem 1.5rem;
  gap: 1.2rem;
}

.compass-wrap {
  position: relative;
  width: 280px;
  height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(var(--shadow-sm));
}

.compass-center-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  z-index: 10;
  box-shadow: 0 0 12px var(--gold);
  border: 2px solid var(--bg-card);
}

#compassCanvas {
  border-radius: 50%;
  display: block;
  box-shadow: var(--shadow-sm);
}

.qibla-info {
  text-align: center;
}

.qibla-angle-label,
.qibla-dist-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  letter-spacing: 0.05em;
}

.qibla-angle-val {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 0.8rem;
}

.qibla-dist-val {
  font-size: 1.2rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.qibla-status {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  min-height: 2rem;
}

.btn-primary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.85rem 2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 60px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-primary:active {
  transform: scale(0.96);
  background: var(--accent-light);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ============ TASBIH PAGE (FIXED RING ALIGNMENT) ============ */
.tasbih-container {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.5rem 1rem 1rem;
  gap: 0.75rem;
  min-height: 60vh;
}

/* Centered ring & button wrapper using relative container */
.tasbih-ring-wrap {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1rem 0;
  width: 100%;
  height: auto;
}

/* SVG ring perfectly centered around the button */
.tasbih-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 180px;
  height: 180px;
  pointer-events: none;
  z-index: 1;
}

.tasbih-btn {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--accent);
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition: all 0.15s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  -webkit-tap-highlight-color: transparent;
  z-index: 2;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(2px);
}

/* Clean active effect - golden glow ring exactly around button */
.tasbih-btn:active {
  transform: scale(0.96);
  background: var(--accent-glow);
  border-color: var(--gold);
  box-shadow: 0 0 0 6px rgba(201, 168, 76, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.tasbih-phrase {
  font-family: 'Amiri', serif;
  font-size: 1.7rem;
  color: var(--gold);
  text-align: center;
  margin-bottom: 0.2rem;
}

.tasbih-phrase-en {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: -0.2rem;
}

.tasbih-count-display {
  font-size: 4rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
  transition: transform 0.1s ease;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tasbih-count-display.bump {
  transform: scale(1.12);
  color: var(--gold);
}

.tasbih-total-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  align-items: baseline;
}

#tasbihTarget {
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 1rem;
}

/* Phrase selector grid */
.tasbih-phrases-selector {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
  margin: 0.5rem 0;
}

.phrase-btn {
  padding: 0.7rem 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 40px;
  color: var(--text-secondary);
  font-family: 'Amiri', serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.phrase-btn.active {
  border-color: var(--gold);
  background: var(--bg-card2);
  color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold-dim);
}

.phrase-btn:active {
  transform: scale(0.96);
}

/* Controls */
.tasbih-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0.8rem 0 0.4rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.btn-ghost {
  padding: 0.55rem 1.4rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: 40px;
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-ghost:active {
  background: var(--accent-glow);
  border-color: var(--accent);
  transform: scale(0.96);
}

.tasbih-sets {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  align-items: baseline;
  background: var(--bg-card);
  padding: 0.4rem 1rem;
  border-radius: 40px;
  border: 1px solid var(--border);
}

#tasbihSets {
  color: var(--gold);
  font-weight: 800;
  font-size: 1.1rem;
}

/* ============ TASBIH AL-ZAHRA (SA) PHASES ============ */
.tasbih-phase-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin-bottom: 0.5rem;
}

.tasbih-phase-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Amiri', serif;
  text-align: center;
}

.tasbih-phase-sub {
  font-size: 0.85rem;
  color: #ffffff;
  background-color: var(--bg-card); /* Solid background to remove transparency */
  padding: 4px 12px;
  border-radius: 12px;
  font-weight: 500;
  display: inline-block;
  text-align: center;
}

.tasbih-phase-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.4rem;
}

.phase-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ring-bg);
  border: 2px solid var(--border);
  transition: all 0.3s ease;
}

.phase-dot.active {
  background: var(--gold);
  border-color: var(--gold);
  box-shadow: 0 0 8px rgba(201, 168, 76, 0.4);
  transform: scale(1.2);
}

.phase-dot.completed {
  background: var(--success);
  border-color: var(--success);
}

.phase-line {
  width: 24px;
  height: 2px;
  background: var(--border);
  border-radius: 1px;
  transition: all 0.3s ease;
}

.phase-line.completed {
  background: var(--success);
}

/* Phase Progress Bars */
.tasbih-phases-progress {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  margin: 0.5rem 0;
}

.phase-progress-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.phase-progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.phase-progress-label .phase-target {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.phase-progress-bar {
  width: 100%;
  height: 14px;
  background-image: 
    radial-gradient(circle at center, var(--text-muted) 35%, transparent 42%),
    linear-gradient(to bottom, transparent 48%, var(--border) 48%, var(--border) 52%, transparent 52%);
  background-size: 14px 14px, 100% 100%;
  background-repeat: repeat-x, no-repeat;
  border-radius: 7px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.phase-progress-fill {
  height: 100%;
  background-image: 
    radial-gradient(circle at center, var(--gold) 40%, transparent 48%),
    linear-gradient(to bottom, transparent 46%, var(--gold) 46%, var(--gold) 54%, transparent 54%);
  background-size: 14px 14px, 100% 100%;
  background-repeat: repeat-x, no-repeat;
  border-radius: 7px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: inset -5px 0 10px rgba(0,0,0,0.2);
}

.phase-progress-item[data-phase="0"] .phase-progress-fill { 
  background-image: radial-gradient(circle at center, var(--gold) 40%, transparent 48%), linear-gradient(to bottom, transparent 48%, var(--gold) 48%, var(--gold) 52%, transparent 52%);
}
.phase-progress-item[data-phase="1"] .phase-progress-fill { 
  background-image: radial-gradient(circle at center, var(--accent) 40%, transparent 48%), linear-gradient(to bottom, transparent 48%, var(--accent) 48%, var(--accent) 52%, transparent 52%);
}
.phase-progress-item[data-phase="2"] .phase-progress-fill { 
  background-image: radial-gradient(circle at center, var(--success) 40%, transparent 48%), linear-gradient(to bottom, transparent 48%, var(--success) 48%, var(--success) 52%, transparent 52%);
}

/* Total Counter */
.tasbih-total {
  display: flex;
  gap: 6px;
  align-items: baseline;
  background: var(--bg-card);
  padding: 0.4rem 1rem;
  border-radius: 40px;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-secondary);
}

#tasbihTotalCount {
  color: var(--gold);
  font-weight: 800;
  font-size: 1.1rem;
}

/* Completion Overlay */
.tasbih-completion {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 10, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 10000;
  animation: completionIn 0.5s ease both;
}

@keyframes completionIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.tasbih-completion.hidden {
  display: none;
}

.completion-icon {
  font-size: 4rem;
  animation: completionIcon 1s ease infinite;
}

@keyframes completionIcon {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.completion-text {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Amiri', serif;
  text-align: center;
}

.completion-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 280px;
}

.completion-btn {
  margin-top: 1rem;
  padding: 0.8rem 2rem;
  background: var(--gold);
  color: var(--bg-primary);
  border: none;
  border-radius: 40px;
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.completion-btn:active {
  transform: scale(0.96);
}

/* ============ QUOTES PAGE ============ */
.quotes-container {
  overflow: hidden;
  position: relative;
  padding: 0 1rem;
}

.quote-card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 2rem 1.5rem;
  border: 1px solid var(--border-strong);
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: transform 0.4s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: var(--shadow-card);
}









.big-quote-mark {
  font-family: 'Amiri', serif;
  font-size: 3rem;
  color: var(--gold-dim);
  line-height: 1;
  margin-bottom: 1rem;
}

.big-quote-text {
  font-family: 'Amiri', serif;
  font-size: 1.2rem;
  color: var(--text-primary);
  line-height: 1.8;
  text-align: center;
  flex: 1;
}

.big-quote-source {
  font-size: 0.8rem;
  color: var(--gold);
  text-align: center;
  margin-top: 1.2rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

.quote-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin-top: 1.2rem;
}

.quote-nav-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.quote-nav-btn:active {
  background: var(--accent-glow);
  border-color: var(--accent);
  transform: scale(0.92);
}

.quote-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}

.quote-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: all 0.2s ease;
}

.quote-dot.active {
  background: var(--gold);
  width: 20px;
  border-radius: 6px;
}

/* ============ SETTINGS PANEL ============ */
.settings-list {
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-group {
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.settings-group-label {
  padding: 0.7rem 1rem 0.5rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1rem;
  border-bottom: 1px solid var(--border);
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item-info {
  flex: 1;
}

.settings-item-label {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 3px;
  font-weight: 500;
}

.settings-item-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.settings-badge {
  background: var(--accent-glow);
  color: var(--accent-light);
  font-size: 0.7rem;
  padding: 4px 12px;
  border-radius: 30px;
  border: 1px solid var(--accent);
  white-space: nowrap;
}

.settings-select {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-select:active {
  border-color: var(--gold);
}

.settings-select[type="text"] {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.settings-select[type="text"]::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

#adhanPreviewBtn,
#adhanPreviewBtnModal {
  flex-shrink: 0;
  padding: 8px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 40px;
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
}

#adhanPreviewBtn:active,
#adhanPreviewBtnModal:active {
  background: var(--accent-glow);
  border-color: var(--gold);
  transform: scale(0.94);
}

#adhanPreviewBtn.playing,
#adhanPreviewBtnModal.playing {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent-light);
  animation: pulse 1.2s ease-in-out infinite;
}

.settings-val {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-sm {
  padding: 6px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 40px;
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-sm:active {
  background: var(--accent-glow);
  transform: scale(0.94);
}

/* Toggle switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 45px;
  height: 27px;
  flex-shrink: 0;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: rgba(30, 50, 40, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 27px;
  cursor: pointer;
  transition: background 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 1px rgba(255, 255, 255, 0.05);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(145deg, #e0e0e0, #ffffff);
  left: 2px;
  top: 2px;
  transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
}

.toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, var(--accent), rgba(42, 92, 62, 0.8));
  border-color: rgba(201, 168, 76, 0.3);
  box-shadow: 0 0 16px rgba(42, 92, 62, 0.4), inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle input:checked + .toggle-slider::before {
  background: linear-gradient(145deg, #ffffff, #f0f0f0);
  transform: translateX(19px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.toggle input:active + .toggle-slider::before {
  width: 26px;
  transition: width 0.2s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toggle input:checked:active + .toggle-slider::before {
  transform: translateX(15px);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="light"] .toggle-slider {
  background: rgba(200, 200, 200, 0.5);
  border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .toggle input:checked + .toggle-slider {
  background: linear-gradient(135deg, #2a7a4a, #1e5e36);
}

/* ============ BOTTOM NAVIGATION ============ */
.bottom-nav {
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--bg-nav);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding-top: 6px;
  flex-shrink: 0;
  backdrop-filter: blur(8px);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.nav-btn::after {
  content: '';
  position: absolute;
  bottom: -4px;
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--gold);
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

.nav-btn.active::after {
  transform: scaleX(1);
}

.nav-btn.active {
  color: var(--gold);
}

.nav-btn.active svg {
  stroke: var(--gold);
}

.nav-btn svg {
  transition: stroke 0.2s;
  width: 24px;
  height: 24px;
}

.nav-btn:active {
  transform: scale(0.94);
}

/* ============ MODAL SHEET ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-sheet {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-radius: 28px 28px 0 0;
  border-top: 1px solid var(--border-strong);
  padding-bottom: var(--safe-bottom);
  max-height: 85dvh;
  overflow-y: auto;
  animation: sheetUp 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
  touch-action: pan-y;
}

.modal-sheet.dragging {
  transition: none !important;
}

/* Alhammad AI Floating Chat Button */
.ai-chat-fab {
  position: fixed;
  bottom: calc(80px + var(--safe-bottom));
  right: 16px;
  z-index: 100;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dim) 100%);
  border: 2px solid var(--border-strong);
  color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3), 0 0 0 3px rgba(201, 168, 76, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: aiFabAppear 0.5s ease-out;
}

.ai-chat-fab:active {
  transform: scale(0.92);
}

.ai-chat-fab.hidden {
  display: none;
}

@keyframes aiFabAppear {
  from { opacity: 0; transform: translateY(20px) scale(0.8); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-chat-fab-label {
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
}

/* AI Chat Modal */
.ai-chat-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.ai-chat-modal.hidden {
  display: none;
}

.ai-chat-backdrop {
  position: absolute;
  top: -200vh;
  bottom: -200vh;
  left: -200vw;
  right: -200vw;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.ai-chat-sheet {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: 80dvh;
  background: var(--bg-primary);
  border-radius: 24px 24px 0 0;
  border-top: 2px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  animation: aiSheetUp 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
}

@keyframes aiSheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.ai-chat-handle {
  width: 40px;
  height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  margin: 10px auto 6px;
}

.ai-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ai-chat-brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.ai-chat-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-gold-dim) 0%, var(--accent-gold) 100%);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-chat-header-icon svg {
  width: 22px;
  height: 22px;
}

.ai-chat-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-chat-title {
  font-family: 'Amiri', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-gold);
  letter-spacing: 0.02em;
}

.ai-chat-subtitle {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.ai-chat-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  margin-right: 10px;
  transition: all 0.3s;
  flex-shrink: 0;
}

.ai-chat-status.online {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2), 0 0 10px rgba(76, 175, 80, 0.4);
}

.ai-chat-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

.ai-chat-close:active {
  transform: scale(0.9);
  background: var(--border-strong);
}

.ai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.ai-chat-messages::-webkit-scrollbar {
  width: 4px;
}

.ai-chat-messages::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* AI Message Bubbles */
.ai-msg-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  animation: aiMsgIn 0.3s ease;
}

.ai-msg-row.user {
  flex-direction: row-reverse;
}

@keyframes aiMsgIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ai-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.ai-msg-avatar.bot {
  background: linear-gradient(135deg, var(--accent-gold-dim) 0%, var(--accent-gold) 100%);
  color: var(--bg-primary);
}

.ai-msg-avatar.user {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}

.ai-msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.85rem;
  line-height: 1.6;
  word-break: break-word;
}

.ai-msg-bubble.bot {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.ai-msg-bubble.user {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.15) 0%, rgba(201, 168, 76, 0.05) 100%);
  border: 1px solid rgba(201, 168, 76, 0.2);
  color: var(--text-primary);
  border-bottom-right-radius: 4px;
}

.ai-msg-bubble.loading {
  animation: aiPulse 1.6s ease-in-out infinite;
}

@keyframes aiPulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.ai-typing-dots {
  display: inline-flex;
  gap: 4px;
  padding: 2px 0;
}

.ai-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-gold);
  animation: aiDotBounce 1.4s ease-in-out infinite;
}

.ai-typing-dots span:nth-child(2) { animation-delay: 0.2s; }

.ai-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiDotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

.ai-msg-sender {
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: 0.7;
}

.ai-msg-sender.bot { color: var(--accent-gold); }

.ai-msg-sender.user { color: var(--text-muted); text-align: right; }

/* AI Trash Button */
.ai-trash-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.ai-trash-btn:active {
  color: #ff4444;
  background: rgba(255, 68, 68, 0.1);
}

/* AI Chat Input */
.ai-chat-input-row {
  display: flex;
  padding: 12px 16px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  background: var(--bg-primary);
}

.ai-chat-input {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 12px 95px 12px 16px; /* Space for TWO buttons */
  color: var(--text-primary);
  font-family: inherit;
  font-size: 16px; /* 16px prevents iOS zoom bug */
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

body.lang-ar .ai-chat-input {
  padding: 12px 16px 12px 95px; /* Space for TWO buttons in RTL */
}

.ai-chat-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 4px 20px rgba(212, 175, 55, 0.15);
}

.ai-chat-send {
  position: absolute;
  top: 16px;
  right: 20px; /* Inside the input */
  width: 40px;
  height: 40px;
  padding: 0;
  background: linear-gradient(135deg, var(--accent-gold-dim) 0%, var(--accent-gold) 100%);
  border: none;
  border-radius: 50%; /* Circle looks better inside a pill */
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 2px 10px rgba(212, 175, 55, 0.3);
}

body.lang-ar .ai-chat-send {
  right: auto;
  left: 20px;
}

.ai-chat-send svg {
  width: 18px;
  height: 18px;
  stroke: var(--bg-primary);
}

.ai-chat-send:active:not(:disabled) {
  transform: scale(0.95);
}

.ai-chat-send:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* AI Chat RTL */
body.lang-ar .ai-chat-fab {
  right: auto;
  left: 16px;
}

body.lang-ar .ai-msg-row.user {
  flex-direction: row;
}

body.lang-ar .ai-msg-bubble.bot {
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 4px;
}

body.lang-ar .ai-msg-bubble.user {
  border-bottom-right-radius: 16px;
  border-bottom-left-radius: 4px;
}

body.lang-ar .ai-msg-sender.user {
  text-align: left;
}

/* AI Chat Error */
.ai-error-text {
  color: var(--error);
  font-style: italic;
  font-size: 0.8rem;
}

/* AI Chat Rate Limit Warning */
.ai-rate-limit {
  padding: 8px 12px;
  background: rgba(201, 168, 76, 0.08);
  border: 1px solid rgba(201, 168, 76, 0.2);
  border-radius: 10px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin: 8px 16px;
}

/* AI Chat Page Styles (page-based, not modal) */
.ai-chat-page-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 0;
}

.ai-chat-page-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-card);
  position: sticky;
  top: 0;
  z-index: 5;
}

.ai-chat-page-header .ai-chat-header-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-gold-dim) 0%, var(--accent-gold) 100%);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-chat-page-header .ai-chat-header-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.ai-lang-toggle {
  padding: 6px 12px;
  border-radius: 20px;
  border: 2px solid var(--accent-gold);
  background: transparent;
  color: var(--accent-gold);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.ai-lang-toggle:active {
  transform: scale(0.92);
  background: rgba(201, 168, 76, 0.15);
}

.ai-chat-back-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: 8px;
  transition: all 0.2s;
}

.ai-chat-back-btn:active {
  transform: scale(0.9);
  background: var(--border-strong);
}

body.lang-ar .ai-chat-back-btn svg {
  transform: scaleX(-1);
}

.ai-lang-switch-status {
  padding: 6px 16px;
  font-size: 0.75rem;
  text-align: center;
  flex-shrink: 0;
}

.ai-lang-blocked {
  color: var(--error);
  font-weight: 600;
}

.ai-lang-warning {
  color: var(--accent-gold);
  font-weight: 600;
}

/* Modal swipe-down to go Home */
.modal-sheet.swipe-down {
  transition: transform 0.25s ease-in;
  transform: translateY(100%) !important;
}

.modal-backdrop.swipe-down {
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* Event Countdown Banner on Home */
.event-countdown-banner {
  margin: 0 1rem 0.5rem;
  border-radius: 16px;
  overflow: hidden;
  animation: fadeInUp 0.5s ease;
}

.event-countdown-inner {
  padding: 0.9rem 1.2rem;
  text-align: center;
  border-radius: 16px;
  border: 1px solid;
}

.event-countdown-inner.event-mourning {
  background: linear-gradient(135deg, rgba(138, 64, 64, 0.15), rgba(60, 20, 20, 0.25));
  border-color: rgba(180, 50, 50, 0.3);
  color: #e8c0c0;
}

.event-countdown-inner.event-celebration {
  background: linear-gradient(135deg, rgba(201, 168, 76, 0.15), rgba(60, 50, 20, 0.25));
  border-color: rgba(201, 168, 76, 0.3);
  color: #e8d8b0;
}

.event-countdown-inner.event-special {
  background: linear-gradient(135deg, rgba(106, 143, 170, 0.15), rgba(20, 30, 50, 0.25));
  border-color: rgba(106, 143, 170, 0.3);
  color: #c0d8e8;
}

.event-countdown-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
  margin-bottom: 4px;
}

.event-countdown-name {
  font-family: 'Amiri', serif;
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.event-countdown-amaal {
  font-size: 0.8rem;
  opacity: 0.85;
  line-height: 1.4;
}

/* Events Calendar Page */
.events-calendar-intro {
  padding: 0 1rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.events-calendar-grid {
  display: grid;
  gap: 12px;
  padding: 0 1rem 2rem;
}

.events-calendar-card {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 1.1rem 1.3rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

.events-calendar-card:active {
  transform: scale(0.98);
}

.events-calendar-card.event-today {
  border-width: 2px;
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.15);
}

.events-calendar-card.event-mourning {
  border-left: 4px solid rgba(180, 50, 50, 0.6);
}

.events-calendar-card.event-mourning.event-today {
  border-color: rgba(180, 50, 50, 0.8);
  box-shadow: 0 0 20px rgba(180, 50, 50, 0.15);
}

.events-calendar-card.event-celebration {
  border-left: 4px solid rgba(201, 168, 76, 0.6);
}

.events-calendar-card.event-celebration.event-today {
  border-color: rgba(201, 168, 76, 0.8);
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.15);
}

.events-calendar-card.event-special {
  border-left: 4px solid rgba(106, 143, 170, 0.6);
}

.events-calendar-card.event-special.event-today {
  border-color: rgba(106, 143, 170, 0.8);
  box-shadow: 0 0 20px rgba(106, 143, 170, 0.15);
}

.event-card-days {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.7;
  margin-bottom: 6px;
  font-weight: 600;
}

.event-card-name {
  font-family: 'Amiri', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.event-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  direction: ltr;
}

.event-card-amaal {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

body.lang-en .event-card-name,
body.lang-en .event-countdown-name {
  font-family: 'Cairo', sans-serif;
}


.modal-sheet.dismissed {
  transform: translateY(110%) !important;
  transition: transform 0.25s ease-in;
}

/* Modal backdrop fade out */
.modal-backdrop.fade-out {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.more-menu-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  background: var(--bg-primary);
  border-radius: 24px 24px 0 0;
  border-top: 2px solid var(--border-strong);
  padding: 1rem 1.5rem 2rem;
  overflow-y: auto;
  animation: slideUpMenu 0.3s ease;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
  transition: transform 0.3s ease;
  touch-action: pan-y;
}

.more-menu-sheet.dragging {
  transition: none !important;
}

.more-menu-sheet.dismissed {
  transform: translateY(110%) !important;
  transition: transform 0.25s ease-in;
}

.more-menu-backdrop.fade-out {
  opacity: 0;
  transition: opacity 0.25s ease;
}

@keyframes sheetUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.modal-handle {
  width: 48px;
  height: 5px;
  background: var(--border);
  border-radius: 4px;
  margin: 12px auto 0;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem 0.8rem;
  font-family: 'Amiri', serif;
  font-size: 1.25rem;
  color: var(--gold);
  border-bottom: 1px solid var(--border);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  border-radius: 50%;
  transition: all 0.2s;
}

.modal-close:active {
  background: var(--accent-glow);
  transform: scale(0.9);
}

.modal-body {
  padding: 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ============ UTILITIES ============ */
.hidden {
  display: none !important;
}

/* ============ ENHANCED ANIMATIONS ============ */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.prayer-item {
  animation: fadeInUp 0.3s ease forwards;
  opacity: 0;
}

.prayer-item:nth-child(1) {
  animation-delay: 0.05s;
}

.prayer-item:nth-child(2) {
  animation-delay: 0.1s;
}

.prayer-item:nth-child(3) {
  animation-delay: 0.15s;
}

.prayer-item:nth-child(4) {
  animation-delay: 0.2s;
}

.prayer-item:nth-child(5) {
  animation-delay: 0.25s;
}

.prayer-item:nth-child(6) {
  animation-delay: 0.3s;
}

.prayer-item:nth-child(7) {
  animation-delay: 0.35s;
}

/* Sunrise dashed style */
.prayer-item.sunrise {
  opacity: 0.6;
  background: transparent;
  border-style: dashed;
}

/* ============ RESPONSIVE TOUCH OPTIMIZATIONS ============ */
@media (hover: hover) {
  .icon-btn:hover,
  .nav-btn:hover,
  .phrase-btn:hover,
  .btn-primary:hover {
    filter: brightness(1.05);
  }
}

/* Ensure proper RTL handling for modals */
.lang-en .modal-sheet {
  direction: ltr;
}

.lang-ar .modal-sheet {
  direction: rtl;
}

/* Imsak / Iftar card (only visible in Ramadan) */
.ramadan-card {
  margin: 0.8rem 1.2rem;
  background: var(--bg-card2);
  border-radius: 16px;
  padding: 0.8rem;
  border-right: 4px solid var(--gold);
  text-align: center;
}
.ramadan-card.hidden { display: none; }

/* Travel mode indicator */
.travel-badge {
  background: #4a2a1a;
  color: #ffcc80;
  font-size: 0.7rem;
  border-radius: 20px;
  padding: 2px 10px;
  margin-left: 8px;
}

/* ============ EVENT‑SPECIFIC THEMES ============ */
/* Muharram (1-6, 8-9) - Dark & somber mourning */
body[data-theme-event="muharram"] {
  --bg-primary: #0a0808 !important;
  --bg-secondary: #111111 !important;
  --bg-card: #1a1414 !important;
  --bg-card2: #241c1c !important;
  --text-primary: #d4c5c5 !important;
  --text-secondary: #a09090 !important;
  --gold: #a67c52 !important;
  --accent: #7a3a2a !important;
  --accent-light: #9a4a3a !important;
  --border: rgba(120, 60, 40, 0.4) !important;
}
body[data-theme-event="muharram"] .next-prayer-card {
  background: linear-gradient(135deg, #2a1a1a, #1a0f0f);
}

/* Ashura (10 Muharram) - Deep Mourning Crimson */
body[data-theme-event="ashura"] {
  --bg-primary: #150000 !important;
  --bg-secondary: #2b0000 !important;
  --bg-card: #3d0000 !important;
  --bg-card2: #520000 !important;
  --bg-nav: #0a0000 !important;
  --text-primary: #ffcccc !important;
  --text-secondary: #ff9999 !important;
  --text-muted: #cc6666 !important;
  --gold: #ff0000 !important;
  --gold-light: #ff3333 !important;
  --gold-dim: #800000 !important;
  --accent: #b30000 !important;
  --accent-light: #ff1a1a !important;
  --accent-glow: rgba(255, 0, 0, 0.4) !important;
  --border: rgba(255, 0, 0, 0.3) !important;
  --border-strong: rgba(255, 0, 0, 0.6) !important;
  --prayer-active-bg: linear-gradient(135deg, #3d0000 0%, #520000 100%) !important;
  background: linear-gradient(135deg, #0a0000 0%, #150000 100%) !important;
}

/* Abbas (7 Muharram) - Dark red mourning */
body[data-theme-event="abbas"] {
  --bg-primary: #0c0a0a !important;
  --bg-secondary: #141010 !important;
  --bg-card: #1c1616 !important;
  --bg-card2: #261e1e !important;
  --bg-nav: #080505 !important;
  --text-primary: #d8c8c8 !important;
  --text-secondary: #a08080 !important;
  --text-muted: #6a5050 !important;
  --gold: #8a4040 !important;
  --gold-light: #a05050 !important;
  --gold-dim: #4a2020 !important;
  --accent: #5a2828 !important;
  --accent-light: #7a3838 !important;
  --accent-glow: rgba(138, 64, 64, 0.12) !important;
  --border: rgba(100, 50, 50, 0.35) !important;
  --border-strong: rgba(138, 64, 64, 0.5) !important;
  --prayer-active-bg: linear-gradient(135deg, #3a1818, #5a2828) !important;
  background-image: none !important;
}

/* Ramadan - Deep green & gold */
body[data-theme-event="ramadan"] {
  --bg-primary: #050a14 !important;
  --bg-secondary: #09142b !important;
  --bg-card: #0c1a3b !important;
  --bg-card2: #122452 !important;
  --bg-nav: #03060a !important;
  --text-primary: #e6f0ff !important;
  --text-secondary: #b3d1ff !important;
  --text-muted: #80b3ff !important;
  --gold: #ffc107 !important;
  --gold-light: #ffd54f !important;
  --gold-dim: #b28704 !important;
  --accent: #ffd54f !important;
  --accent-light: #ffe082 !important;
  --accent-glow: rgba(255, 193, 7, 0.25) !important;
  --border: rgba(255, 193, 7, 0.3) !important;
  --border-strong: rgba(255, 213, 79, 0.5) !important;
  --prayer-active-bg: linear-gradient(135deg, #0c1a3b 0%, #122452 100%) !important;
  background: linear-gradient(135deg, #03060a 0%, #050a14 100%) !important;
}

/* FESTIVE EID THEME (Ghadir, Fitr, Adha) - Royal Emerald & Soft Gold */
body[data-theme-event="ghadir"], body[data-theme-event="eid_ghadir"] {
  --bg-primary: #042411 !important;
  --bg-secondary: #083b1d !important;
  --bg-card: #0c4d26 !important;
  --bg-card2: #116131 !important;
  --bg-nav: #02170b !important;
  --text-primary: #f2fcf6 !important;
  --text-secondary: #c9e8d4 !important;
  --text-muted: #95bfa6 !important;
  --gold: #e6c563 !important;
  --gold-light: #fce895 !important;
  --gold-dim: #998036 !important;
  --accent: #2dc475 !important;
  --accent-light: #45e892 !important;
  --accent-glow: rgba(45, 196, 117, 0.2) !important;
  --border: rgba(230, 197, 99, 0.25) !important;
  --border-strong: rgba(230, 197, 99, 0.45) !important;
  --prayer-active-bg: linear-gradient(135deg, #0c4d26, #2dc475) !important;
  background: 
    radial-gradient(circle at top right, rgba(230, 197, 99, 0.25) 0%, transparent 60%),
    radial-gradient(circle at bottom left, rgba(45, 196, 117, 0.2) 0%, transparent 60%),
    linear-gradient(135deg, #02170b, #042411) !important;
}
/* Imam Ali's Martyrdom - Dark crimson */
body[data-theme-event="wafat_ali"] {
  --bg-primary: #2a0a0a !important;
  --bg-secondary: #2a1010 !important;
  --bg-card: #3a1818 !important;
  --bg-card2: #4a2020 !important;
  --text-primary: #e0c8c8 !important;
  --text-secondary: #c09090 !important;
  --gold: #c07040 !important;
  --accent: #9a3030 !important;
  --accent-light: #b84040 !important;
  --border: rgba(180, 70, 50, 0.5) !important;
}

/* Imam Hussain's Birth - Rich azure blue & silver */
body[data-theme-event="birth_hussain"] {
  --bg-primary: #eef4f9 !important;
  --bg-secondary: #dceaf5 !important;
  --bg-card: #ffffff !important;
  --bg-card2: #f2f8fd !important;
  --bg-nav: #c8dff0 !important;
  --text-primary: #0d2035 !important;
  --text-secondary: #1e4a72 !important;
  --text-muted: #4a7aa0 !important;
  --gold: #2e7bb5 !important;
  --gold-light: #4a9ad4 !important;
  --gold-dim: #b8d8f0 !important;
  --accent: #1a6a9e !important;
  --accent-light: #2880bc !important;
  --accent-glow: rgba(30, 106, 158, 0.1) !important;
  --border: rgba(30, 106, 158, 0.15) !important;
  --border-strong: rgba(74, 154, 212, 0.4) !important;
  --prayer-active-bg: linear-gradient(135deg, #1a6a9e, #2e7bb5) !important;
  background-image: linear-gradient(135deg, #eef4f9 0%, #ffffff 50%, #e0edf8 100%) !important;
}

/* Event banner styling */
.event-banner {
  text-align: center;
  padding: 10px;
  font-family: 'Amiri', serif;
  font-size: 1.2rem;
  font-weight: bold;
  border-bottom: 2px solid var(--gold);
  margin-top: 0;
  animation: fadeSlideDown 0.5s ease;
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* White Modern Marble Theme - Birth of Prophet Muhammad & Imam Ali */
body[data-theme-event="birth_prophet"],
body[data-theme-event="prophet_birth"],
body[data-theme-event="birth_ali"],
body[data-theme-event="ali_birth"] {
  --bg-primary: #f5f7f6 !important;
  --bg-secondary: #eef2f0 !important;
  --bg-card: #ffffff !important;
  --bg-card2: #f9fbf9 !important;
  --bg-nav: #e5eae7 !important;
  --text-primary: #1c3326 !important;
  --text-secondary: #3d664e !important;
  --text-muted: #708e7c !important;
  --gold: #b3923b !important;
  --gold-light: #c9a84c !important;
  --gold-dim: #ebdcb2 !important;
  --accent: #1e6b45 !important;
  --accent-light: #28a764 !important;
  --accent-glow: rgba(30, 107, 69, 0.1) !important;
  --border: rgba(0, 0, 0, 0.08) !important;
  --border-strong: rgba(179, 146, 59, 0.4) !important;
  --prayer-active-bg: linear-gradient(135deg, #1e6b45, #28a764) !important;
  background-image: linear-gradient(135deg, #f4f7f5 0%, #ffffff 50%, #eaeedd 100%) !important;
  background-attachment: fixed !important;
}
body[data-theme-event="birth_prophet"] #splash,
body[data-theme-event="prophet_birth"] #splash,
body[data-theme-event="birth_ali"] #splash,
body[data-theme-event="ali_birth"] #splash {
  background: linear-gradient(135deg, #ffffff, #f0f4f2) !important;
  color: #1c3326 !important;
}
body[data-theme-event="birth_prophet"] .splash-title,
body[data-theme-event="prophet_birth"] .splash-title,
body[data-theme-event="birth_ali"] .splash-title,
body[data-theme-event="ali_birth"] .splash-title {
  color: #b3923b !important;
  text-shadow: 0 2px 10px rgba(179, 146, 59, 0.2) !important;
}

/* Slate Mourning Theme - Imam Ali Wafat */
body[data-theme-event="wafat_ali"] {
  --bg-primary: #1c2022 !important;
  --bg-secondary: #252a2d !important;
  --bg-card: #2e3438 !important;
  --bg-card2: #383f44 !important;
  --bg-nav: #141719 !important;
  --text-primary: #e0e5e8 !important;
  --text-secondary: #90a4ae !important;
  --text-muted: #607d8b !important;
  --gold: #78909c !important;
  --gold-light: #b0bec5 !important;
  --gold-dim: #455a64 !important;
  --accent: #37474f !important;
  --accent-light: #455a64 !important;
  --accent-glow: rgba(120, 144, 156, 0.1) !important;
  --border: rgba(255, 255, 255, 0.05) !important;
  --border-strong: rgba(144, 164, 174, 0.3) !important;
  --prayer-active-bg: linear-gradient(135deg, #37474f, #455a64) !important;
  background-image: none !important;
}
body[data-theme-event="wafat_ali"] #splash {
  background: #1c2022 !important;
  color: #e0e5e8 !important;
}

/* Mint Green Celebration Layout - Eid al-Fitr */
body[data-theme-event="eid_fitr"] {
  --bg-primary: #e8f5e9 !important;
  --bg-secondary: #c8e6c9 !important;
  --bg-card: #ffffff !important;
  --bg-card2: #f1f8e9 !important;
  --bg-nav: #a5d6a7 !important;
  --text-primary: #1b5e20 !important;
  --text-secondary: #2e7d32 !important;
  --text-muted: #4caf50 !important;
  --gold: #fbc02d !important;
  --gold-light: #fff59d !important;
  --gold-dim: #f9a825 !important;
  --accent: #2e7d32 !important;
  --accent-light: #4caf50 !important;
  --border: rgba(46, 125, 50, 0.15) !important;
  --border-strong: rgba(251, 192, 45, 0.5) !important;
  --prayer-active-bg: linear-gradient(135deg, #2e7d32, #4caf50) !important;
}

/* Olive Gold Theme Layout - Eid al-Adha */
body[data-theme-event="eid_adha"] {
  --bg-primary: #f4f3ef !important;
  --bg-secondary: #e8e5d7 !important;
  --bg-card: #ffffff !important;
  --bg-card2: #fbfbfa !important;
  --bg-nav: #d1cebd !important;
  --text-primary: #3e3b2b !important;
  --text-secondary: #6b6649 !important;
  --text-muted: #8d8756 !important;
  --gold: #bfa15f !important;
  --gold-light: #dec48e !important;
  --gold-dim: #8c733e !important;
  --accent: #8d8756 !important;
  --accent-light: #aba36e !important;
  --border: rgba(141, 135, 86, 0.15) !important;
  --border-strong: rgba(191, 161, 95, 0.5) !important;
  --prayer-active-bg: linear-gradient(135deg, #8d8756, #bfa15f) !important;
}

/* Majestic Emerald and Gold Theme - Eid al-Ghadir */
body[data-theme-event="eid_ghadir"] {
  --bg-primary: #052416 !important;
  --bg-secondary: #0b3321 !important;
  --bg-card: #11422c !important;
  --bg-card2: #18543a !important;
  --bg-nav: #03170e !important;
  --text-primary: #f4f9f6 !important;
  --text-secondary: #99ccb2 !important;
  --text-muted: #66997f !important;
  --gold: #daa520 !important;
  --gold-light: #ffd700 !important;
  --gold-dim: #aa8018 !important;
  --accent: #1b8a5a !important;
  --accent-light: #2bc483 !important;
  --accent-glow: rgba(218, 165, 32, 0.15) !important;
  --border: rgba(218, 165, 32, 0.25) !important;
  --border-strong: rgba(218, 165, 32, 0.5) !important;
  --prayer-active-bg: linear-gradient(135deg, #1b8a5a, #daa520) !important;
}

/* Imam Hassan's Birth - Warm gold & marble white */
body[data-theme-event="birth_hassan"] {
  --bg-primary: #fdfcf8 !important;
  --bg-secondary: #f5f0e8 !important;
  --bg-card: #ffffff !important;
  --bg-card2: #faf7f0 !important;
  --bg-nav: #ede5d4 !important;
  --text-primary: #2a2010 !important;
  --text-secondary: #5a4820 !important;
  --text-muted: #9a8a60 !important;
  --gold: #b3923b !important;
  --gold-light: #d4aa50 !important;
  --gold-dim: #e8d8a0 !important;
  --accent: #7a6530 !important;
  --accent-light: #a08840 !important;
  --accent-glow: rgba(179, 146, 59, 0.12) !important;
  --border: rgba(179, 146, 59, 0.15) !important;
  --border-strong: rgba(179, 146, 59, 0.4) !important;
  --prayer-active-bg: linear-gradient(135deg, #7a6530, #b3923b) !important;
  background-image: linear-gradient(135deg, #fdfcf8 0%, #ffffff 50%, #f5f0e4 100%) !important;
}

/* Imam Hassan's Martyrdom (28 Safar) - Slate mourning */
body[data-theme-event="wafat_hassan"] {
  --bg-primary: #1c2022 !important;
  --bg-secondary: #252a2d !important;
  --bg-card: #2e3438 !important;
  --bg-card2: #383f44 !important;
  --bg-nav: #141719 !important;
  --text-primary: #e0e5e8 !important;
  --text-secondary: #90a4ae !important;
  --text-muted: #607d8b !important;
  --gold: #78909c !important;
  --gold-light: #b0bec5 !important;
  --gold-dim: #455a64 !important;
  --accent: #37474f !important;
  --accent-light: #455a64 !important;
  --accent-glow: rgba(120, 144, 156, 0.1) !important;
  --border: rgba(255, 255, 255, 0.05) !important;
  --border-strong: rgba(144, 164, 174, 0.3) !important;
  --prayer-active-bg: linear-gradient(135deg, #37474f, #455a64) !important;
  background-image: none !important;
}
body[data-theme-event="wafat_hassan"] #splash {
  background: #1c2022 !important;
  color: #e0e5e8 !important;
}

/* Fixed positioning for the Ashura gregorian player (uses custom-media-widget) */
#ashura-gregorian-player.custom-media-widget {
  position: fixed !important;
  bottom: 90px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 320px !important;
  right: auto !important;
}
#ashura-gregorian-player.custom-media-widget.minimized {
  left: auto !important;
  right: 20px !important;
  bottom: 90px !important;
  transform: none !important;
}
.custom-media-widget {
  position: fixed;
  bottom: 25px;
  right: 25px;
  z-index: 99999;
  width: 350px;
  padding: 16px;
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  direction: rtl;
  font-family: 'Cairo', sans-serif;
  border: 1px solid var(--border-strong);
}
.custom-media-widget.ghadir-theme {
  background: linear-gradient(135deg, #0b3321, #11422c);
  color: #f4f9f6;
}
.custom-media-widget.ashura-theme {
  background: linear-gradient(135deg, #210606, #2d0a0a);
  color: #f5e1e1;
  border-color: rgba(230, 57, 57, 0.5);
  box-shadow: 0 12px 40px rgba(230, 57, 57, 0.15);
}
.custom-media-widget.minimized {
  width: 60px;
  height: 60px;
  padding: 0;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  bottom: 25px;
  right: 25px;
  cursor: pointer;
}
.custom-media-widget.minimized .widget-content {
  display: none;
}
.custom-media-widget .widget-toggle-icon {
  display: none;
  font-size: 24px;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.custom-media-widget.minimized .widget-toggle-icon {
  display: flex;
}
.custom-media-widget .widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 6px;
}
.custom-media-widget .widget-title {
  font-size: 14px;
  font-weight: 700;
}
.custom-media-widget .widget-minimize-btn {
  background: none;
  border: none;
  color: inherit;
  font-size: 22px;
  cursor: pointer;
  padding: 0 8px;
  line-height: 1;
}
.custom-media-widget .widget-track {
  font-size: 13px;
  margin-bottom: 12px;
  opacity: 0.95;
  font-weight: 600;
}
.custom-media-widget .widget-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.custom-media-widget .widget-play-btn {
  background: var(--gold);
  color: #0d1f16;
  border: none;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.2s;
}
.custom-media-widget.ashura-theme .widget-play-btn {
  background: #b32424;
  color: #ffffff;
}
.custom-media-widget .widget-progress-bar {
  flex-grow: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
  position: relative;
  cursor: pointer;
}
.custom-media-widget .widget-progress-fill {
  height: 100%;
  background: var(--gold-light);
  width: 0%;
  border-radius: 3px;
}
.custom-media-widget.ashura-theme .widget-progress-fill {
  background: #e63939;
}

/* Ashurha Media Player — Mobile Improvements */
@media (max-width: 480px) {
  .custom-media-widget.ashura-theme {
    max-width: 95vw;
    left: 2.5vw;
    right: 2.5vw;
    bottom: 70px;
    border-radius: 16px;
  }
  .custom-media-widget.ashura-theme .widget-play-btn {
    width: 44px !important;
    height: 44px !important;
    font-size: 16px !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .custom-media-widget.ashura-theme #ashura-switch-btn,
  .custom-media-widget.ashura-theme #ashura-rew-btn,
  .custom-media-widget.ashura-theme #ashura-fwd-btn {
    font-size: 1.5rem !important;
    padding: 10px !important;
    min-width: 44px;
    min-height: 44px;
  }
  .custom-media-widget.ashura-theme #ashura-track-name {
    font-size: 1rem !important;
  }
  .custom-media-widget.ashura-theme .widget-minimize-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 1.1rem !important;
  }
}

/* Better media player controls */
.custom-media-widget.ashura-theme .widget-switch-btn {
  transition: transform 0.2s, opacity 0.2s;
}
.custom-media-widget.ashura-theme .widget-switch-btn:active {
  transform: scale(0.85);
  opacity: 0.7;
}
#ashura-track-name {
  transition: opacity 0.2s;
}
.custom-media-widget.ashura-theme .widget-play-btn {
  transition: transform 0.2s, background 0.2s;
}
.custom-media-widget.ashura-theme .widget-play-btn:active {
  transform: scale(0.9);
}

/* ==========================================================================
   NEW ADDITIONS — Qadha, Abbas Theme, Notifications, Cache, Country/City
   ========================================================================== */

/* ============ QADHA AL-SALAH ============ */
.qadha-container {
  padding: 0.5rem 1rem 1.5rem;
  max-width: 500px;
  margin: 0 auto;
}

.qadha-start-screen {
  text-align: center;
  padding: 3rem 1rem;
  animation: fadeInUp 0.6s ease;
}

.qadha-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.qadha-start-title {
  font-family: 'Amiri', serif;
  font-size: 1.8rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.qadha-start-desc {
  color: var(--text-muted);
  margin-bottom: 2rem;
  font-size: 0.9rem;
  line-height: 1.6;
}

.qadha-start-btn {
  margin: 0 auto;
  min-width: 200px;
  justify-content: center;
}

.qadha-main-screen {
  animation: fadeInUp 0.5s ease;
}

.qadha-summary-card {
  background: linear-gradient(135deg, var(--bg-card2), var(--bg-card));
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.qadha-summary-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, var(--accent-glow), transparent 70%);
  pointer-events: none;
}

.qadha-summary-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.qadha-summary-count {
  font-size: 4rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  transition: transform 0.3s ease;
}

.qadha-summary-count.pulse {
  animation: qadhaPulse 0.5s ease;
}

@keyframes qadhaPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.qadha-summary-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
}

.qadha-prayers-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 1.5rem;
}

.qadha-prayer-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.3s ease;
  animation: fadeInUp 0.4s ease forwards;
  opacity: 0;
  position: relative;
  overflow: hidden;
}

.qadha-prayer-card:nth-child(1) { animation-delay: 0.05s; }
.qadha-prayer-card:nth-child(2) { animation-delay: 0.1s; }
.qadha-prayer-card:nth-child(3) { animation-delay: 0.15s; }
.qadha-prayer-card:nth-child(4) { animation-delay: 0.2s; }
.qadha-prayer-card:nth-child(5) { animation-delay: 0.25s; }

.qadha-prayer-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--gold);
  opacity: 0.6;
  border-radius: 20px 0 0 20px;
}

.qadha-prayer-card:active {
  transform: scale(0.98);
  border-color: var(--gold-dim);
}

.qadha-prayer-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.qadha-prayer-icon {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}

.qadha-prayer-name {
  font-family: 'Amiri', serif;
  font-size: 1.25rem;
  color: var(--text-primary);
  font-weight: 600;
}

.qadha-prayer-count {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--gold);
  min-width: 50px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.qadha-prayer-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.qadha-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  line-height: 1;
}

.qadha-btn:active {
  transform: scale(0.88);
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.qadha-btn:disabled {
  opacity: 0.3;
  pointer-events: none;
}

.qadha-controls {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ============ MUHARRAM BANNER ============ */
.muharram-banner {
  background: var(--bg-card);
  border-bottom: 2px solid var(--gold-dim);
  text-align: center;
  padding: 10px 12px;
  font-family: 'Amiri', serif;
  font-size: 1.1rem;
  color: var(--text-secondary);
  animation: fadeSlideDown 0.5s ease;
  line-height: 1.6;
}

/* ============ ABBAS MEDIA PLAYER ============ */
.custom-media-widget.abbas-theme {
  background: linear-gradient(135deg, #141010, #1c1616);
  color: #d8c8c8;
  border-color: rgba(138, 64, 64, 0.5);
  box-shadow: 0 12px 40px rgba(12, 10, 10, 0.5);
}

.custom-media-widget.abbas-theme .widget-play-btn {
  background: #8a4040;
  color: #ffffff;
}

.custom-media-widget.abbas-theme .widget-progress-fill {
  background: #a05050;
}

.custom-media-widget.ali-akbar-theme {
  background: linear-gradient(135deg, #0f0f18, #141422);
  color: #c8c8d8;
  border-color: rgba(80, 80, 110, 0.5);
  box-shadow: 0 12px 40px rgba(10, 10, 20, 0.5);
}

.custom-media-widget.ali-akbar-theme .widget-play-btn {
  background: #5a5a7a;
  color: #ffffff;
}

.custom-media-widget.ali-akbar-theme .widget-progress-fill {
  background: #6a6a8a;
}

/* ============ NOTIFICATION TOGGLES IN SETTINGS ============ */
.settings-item .toggle {
  margin-left: 8px;
}

.lang-en .settings-item .toggle {
  margin-left: 0;
  margin-right: 8px;
}

/* ============ CACHE STATUS ============ */
#cacheStatusText,
#cacheStatusText2 {
  transition: color 0.3s ease;
}

/* ============ IOS NOTIFICATION NOTE ============ */
#iosNotifNote,
#iosNotifNote2 {
  background: var(--accent-glow);
  border-radius: 12px;
  padding: 8px 12px;
  margin-top: 4px;
}

/* ============ COUNTRY/CITY SELECTS ============ */
#countrySelect,
#countrySelectModal,
#qiblaCountrySelect {
  margin-bottom: 0;
}

#citySelect,
#citySelectModal,
#qiblaCitySelect {
  margin-top: 0;
}

/* ============ QIBLA PRESET ROW ============ */
.qibla-preset-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-bottom: 1rem;
}

.qibla-preset-row.hidden {
  display: none !important;
}

/* ============ COMPASS SMOOTHING (visual hint) ============ */
.compass-wrap {
  transition: transform 0.3s ease;
}

/* ============ RESPONSIVE QADHA ============ */
@media (max-width: 360px) {
  .qadha-prayer-card {
    padding: 1rem;
  }
  .qadha-prayer-icon {
    width: 40px;
    height: 40px;
    font-size: 1.3rem;
  }
  .qadha-prayer-name {
    font-size: 1.05rem;
  }
  .qadha-prayer-count {
    font-size: 1.8rem;
  }
  .qadha-btn {
    width: 38px;
    height: 38px;
    font-size: 1.2rem;
  }
}

/* ============ COMPASS PERMISSION MODAL ============ */
.compass-perm-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}

.compass-perm-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.compass-perm-sheet {
  position: relative;
  z-index: 1;
  background: var(--bg-card);
  border-radius: 24px;
  padding: 2rem 1.5rem;
  max-width: 320px;
  width: 90%;
  border: 1px solid var(--border);
  text-align: center;
  animation: scaleUp 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
  direction: rtl;
}

.lang-en .compass-perm-sheet {
  direction: ltr;
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

.compass-perm-icon {
  font-size: 3rem;
  margin-bottom: 0.8rem;
}

.compass-perm-title {
  font-family: 'Amiri', serif;
  font-size: 1.3rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.compass-perm-body {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.compass-perm-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.compass-perm-deny,
.compass-perm-allow {
  padding: 0.6rem 1.4rem;
  border-radius: 40px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  border: none;
}

.compass-perm-deny {
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.compass-perm-deny:active {
  background: var(--accent-glow);
  transform: scale(0.94);
}

.compass-perm-allow {
  background: var(--accent);
  color: #fff;
}

.compass-perm-allow:active {
  background: var(--accent-light);
  transform: scale(0.94);
}

/* ============ CACHE TOAST NOTIFICATION ============ */
.cache-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.8rem 1.2rem;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-primary);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  max-width: 90%;
  width: max-content;
}

.cache-toast.success {
  border-color: rgba(0, 210, 106, 0.4);
}

.cache-toast.error {
  border-color: rgba(230, 57, 57, 0.4);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}


/* ============ CACHE BUTTON LOADING SPINNER ============ */
.btn-sm.loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
  color: transparent !important;
}

.btn-sm.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  margin-left: -7px;
  border: 2px solid var(--text-muted);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============ NEW FEATURES CSS ============ */

/* --- Dhikr Page --- */
.dhikr-container {
  padding: 0 1rem 1.5rem;
}
.dhikr-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}
.dhikr-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dhikr-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  transition: transform 0.2s ease;
}
.dhikr-card:active {
  transform: scale(0.98);
}
.dhikr-card-text {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 0.5rem;
  word-break: break-word;
}
.dhikr-card-link {
  font-size: 0.8rem;
  color: var(--accent-light);
  text-decoration: none;
  display: block;
  margin-bottom: 0.6rem;
  word-break: break-all;
}
.dhikr-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}
.dhikr-delete-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.2s;
}
.dhikr-delete-btn:active {
  background: var(--accent-glow);
}
.dhikr-toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: 16px;
  padding: 0.8rem 1.2rem;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  color: var(--text-primary);
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  max-width: 90%;
  width: max-content;
}

/* --- Hijri Offset Controls --- */
.hijri-offset-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: center;
  padding: 4px 0;
}
.hijri-offset-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  min-width: 80px;
  text-align: center;
  font-family: monospace;
}

/* --- Tasbih Analytics --- */
.tasbih-analytics {
  width: 100%;
  margin-top: 0.5rem;
}
.tasbih-analytics-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  margin-top: 0.5rem;
  animation: fadeInUp 0.3s ease;
}
.tasbih-analytics-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1rem 0;
}
.tasbih-chart-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
}
#tasbihChartCanvas {
  width: 100%;
  max-width: 320px;
  height: auto;
}

/* --- Muharram Interactive Timeline --- */
.muharram-timeline {
  margin: 0.8rem 1.2rem;
  animation: fadeSlideDown 0.5s ease;
}
.muharram-timeline.hidden {
  display: none !important;
}

/* --- Infallible Timeline Specific Styles --- */
.muharram-timeline-title {
  font-family: 'Amiri', serif;
  font-size: 1.15rem;
  color: var(--gold);
  text-align: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  font-weight: bold;
}
.muharram-timeline-event {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.muharram-timeline-event:last-child {
  border-bottom: none;
}
.muharram-timeline-dot {
  width: 12px;
  height: 12px;
  background: var(--gold);
  border-radius: 50%;
  position: absolute;
  top: 1.4rem;
  right: 1.2rem;
  box-shadow: 0 0 10px var(--gold-dim);
}
[dir="ltr"] .muharram-timeline-dot {
  right: auto;
  left: 1.2rem;
}
.muharram-timeline-day {
  font-family: 'Amiri', serif;
  font-size: 1.05rem;
  color: var(--gold-light);
  font-weight: bold;
  padding-right: 1.5rem;
}
[dir="ltr"] .muharram-timeline-day {
  padding-right: 0;
  padding-left: 1.5rem;
}

.qibla-dist-val {
  font-size: 2.2rem;
  color: var(--text-secondary);
  font-weight: 800;
  margin-bottom: 0.8rem;
}

.muharram-timeline-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
  text-align: justify;
}
}
.muharram-timeline-card {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.muharram-timeline-bg {
  background: var(--bg-secondary);
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.muharram-timeline-inner {
  padding: 1rem 1.2rem;
}
.muharram-bg-title {
  font-family: 'Amiri', serif;
  font-size: 1.15rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 0.6rem;
  text-align: center;
}
.muharram-bg-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 0.6rem;
  text-align: justify;
}
.muharram-timeline-header {
  font-family: 'Amiri', serif;
  font-size: 1.1rem;
  color: var(--gold);
  text-align: center;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}
.muharram-timeline-days {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0.8rem 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}
.muharram-day-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-family: 'Amiri', serif;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}
.muharram-day-dot.active {
  background: var(--gold);
  color: #111;
  border-color: var(--gold);
  box-shadow: 0 0 10px var(--gold-dim);
  transform: scale(1.1);
}
.muharram-day-dot:active {
  transform: scale(0.94);
}
.muharram-timeline-story {
  padding: 1rem 1.2rem;
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.muharram-story-ar,
.muharram-story-en {
  font-size: 0.88rem;
  line-height: 1.8;
  color: var(--text-secondary);
  text-align: justify;
  margin-bottom: 0.5rem;
}

/* Muharram theme adjustments for timeline */
body[data-theme-event="muharram"] .muharram-timeline-card {
  border-color: rgba(166, 124, 82, 0.4);
}
body[data-theme-event="muharram"] .muharram-day-dot.active {
  background: var(--gold);
  color: #1a1414;
}
body[data-theme-event="ashura"] .muharram-timeline-card {
  border-color: rgba(230, 57, 57, 0.4);
}
body[data-theme-event="ashura"] .muharram-day-dot.active {
  background: var(--gold-light);
  color: #2d0a0a;
}


/* ============ SAVED DHIKR PAGE ============ */
.dhikr-container {
  padding: 0.5rem 1rem 1.5rem;
}

.dhikr-empty {
  text-align: center;
  padding: 3rem 1rem;
  animation: fadeInUp 0.6s ease;
}

.dhikr-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}

.dhikr-empty-title {
  font-family: 'Amiri', serif;
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}

.dhikr-empty-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto;
}

.dhikr-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dhikr-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  position: relative;
  transition: all 0.2s ease;
  animation: fadeInUp 0.4s ease forwards;
}

.dhikr-card:active {
  transform: scale(0.98);
  border-color: var(--gold-dim);
}

.dhikr-card-text {
  font-family: 'Amiri', serif;
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.7;
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.dhikr-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.dhikr-card-url {
  color: var(--accent-light);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 200px;
}

.dhikr-delete-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.dhikr-delete-btn:active {
  background: rgba(230, 57, 57, 0.15);
  color: #e63939;
}

/* ============ HIJRI OFFSET ROW ============ */
.hijri-offset-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ============ TASBIH ANALYTICS ============ */
.tasbih-analytics {
  margin-top: 1rem;
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.analytics-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 0.8rem;
  background: var(--bg-card);
  border-radius: 14px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.analytics-header:active {
  background: var(--bg-card2);
}

.analytics-chevron {
  transition: transform 0.3s ease;
  color: var(--text-muted);
}

.analytics-header.open .analytics-chevron {
  transform: rotate(180deg);
}

.analytics-body {
  padding: 1rem 0.5rem 0.5rem;
  animation: fadeInUp 0.3s ease;
}

.analytics-body.hidden {
  display: none;
}

.analytics-canvas-wrap {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 0.8rem;
  border: 1px solid var(--border);
  overflow-x: auto;
}

.analytics-canvas-wrap canvas {
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
}

.analytics-legend {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 0.8rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* ============ MUHARRAM TIMELINE ============ */
.muharram-timeline {
  margin: 1rem 1.2rem;
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border);
  overflow: hidden;
  animation: fadeInUp 0.5s ease;
}

.muharram-timeline.hidden {
  display: none !important;
}

.timeline-header {
  font-family: 'Amiri', serif;
  font-size: 1.15rem;
  color: var(--gold);
  text-align: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
}

.timeline-backstory {
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(166, 124, 82, 0.05);
}

.timeline-backstory-title {
  font-family: 'Amiri', serif;
  font-size: 1.05rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.timeline-backstory-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.timeline-days {
  padding: 1rem 0.8rem;
}

.timeline-day {
  display: flex;
  gap: 12px;
  padding: 0.8rem 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.timeline-day:last-child {
  border-bottom: none;
}

.timeline-day:active {
  background: var(--accent-glow);
  border-radius: 12px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.timeline-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
}

.timeline-day.active .timeline-dot {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg-primary);
  box-shadow: 0 0 10px rgba(201, 168, 76, 0.3);
}

.timeline-content {
  flex: 1;
}

.timeline-day-title {
  font-family: 'Amiri', serif;
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.timeline-day.active .timeline-day-title {
  color: var(--gold);
}

.timeline-day-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.6;
  max-height: 2.4em;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.timeline-day.expanded .timeline-day-desc {
  max-height: 400px;
}

.timeline-day-full {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  display: none;
}

.timeline-day.expanded .timeline-day-full {
  display: block;
  animation: fadeInUp 0.3s ease;
}

.timeline-expand-icon {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  transition: transform 0.2s;
}

.timeline-day.expanded .timeline-expand-icon {
  transform: rotate(180deg);
}

/* ============================ SAVED ITEMS PAGE ============================ */

.saved-items-tabs {
  display: flex;
  gap: 8px;
  padding: 0 1rem;
  margin-bottom: 0.8rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.saved-items-tabs::-webkit-scrollbar {
  display: none;
}

.saved-tab {
  flex-shrink: 0;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.saved-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.saved-tab:active {
  transform: scale(0.96);
}

.saved-items-list {
  padding: 0 1rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.saved-items-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.saved-items-empty.hidden {
  display: none !important;
}
.saved-items-empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: float 3s ease-in-out infinite;
}
.saved-items-empty-title {
  font-family: 'Amiri', serif;
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
}
.saved-items-empty-desc {
  color: var(--text-muted);
  font-size: 0.85rem;
  line-height: 1.6;
  max-width: 280px;
  margin: 0 auto;
}

/* Item Card */
.saved-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  animation: fadeInUp 0.4s ease;
}

.saved-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.saved-item-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.saved-item-source {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.saved-item-text-ar {
  font-family: 'Amiri', serif;
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  text-align: right;
  direction: rtl;
  white-space: pre-line;
}

.saved-item-text-en {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
  white-space: pre-line;
}

.saved-item-actions {
  display: flex;
  gap: 8px;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.saved-item-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.saved-item-btn:active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.saved-item-btn svg {
  width: 16px;
  height: 16px;
}

/* Floating Add Button */
.fab-add {
  position: fixed;
  bottom: 90px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 100;
  transition: transform 0.2s, box-shadow 0.2s;
}
.fab-add:active {
  transform: scale(0.92);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* Add Item Modal */
.add-item-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.add-item-modal.hidden {
  display: none !important;
}

.add-item-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.add-item-sheet {
  position: relative;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.2rem;
  animation: slideUp 0.3s ease;
}

.add-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-family: 'Amiri', serif;
  font-size: 1.2rem;
  color: var(--gold);
}

.add-item-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.add-item-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.form-row label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}
.form-row textarea,
.form-row input,
.form-row select {
  padding: 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  outline: none;
}
.form-row textarea:focus,
.form-row input:focus,
.form-row select:focus {
  border-color: var(--accent);
}

/* Share Sheet */
.share-sheet {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.share-sheet.hidden {
  display: none !important;
}

.share-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}

.share-sheet-panel {
  position: relative;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  width: 100%;
  padding: 1.2rem;
  animation: slideUp 0.3s ease;
}

.share-sheet-title {
  text-align: center;
  font-family: 'Amiri', serif;
  font-size: 1.2rem;
  color: var(--gold);
  margin-bottom: 1rem;
}

.share-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 1rem;
}

.share-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 1rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.share-option:active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.share-icon {
  font-size: 1.8rem;
}

.share-cancel {
  width: 100%;
  padding: 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  font-weight: 600;
}

/* Toast */
.saved-item-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: 16px;
  padding: 0.8rem 1.2rem;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  color: var(--text-primary);
  animation: fadeInUp 0.3s ease;
  max-width: 90%;
  width: max-content;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ============================ MUSHAF QURAN BUTTON ============================ */

.mushaf-quran-btn {
  display: flex;
  align-items: stretch;
  margin: 2.5rem 1rem 1.2rem;
  cursor: pointer;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  transition: transform 0.2s, box-shadow 0.2s;
  background: linear-gradient(135deg, #1a3a2a 0%, #0d1f16 100%);
  border: 1px solid var(--gold-dim);
  animation: fadeInUp 0.5s ease;
}

.mushaf-quran-btn:active {
  transform: scale(0.97);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.mushaf-spine {
  width: 8px;
  background: linear-gradient(180deg, var(--gold) 0%, #8a6d20 100%);
  flex-shrink: 0;
}

.mushaf-cover {
  flex: 1;
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.mushaf-title-ar {
  font-family: 'Amiri', serif;
  font-size: 1.3rem;
  color: var(--gold);
  font-weight: 700;
  text-align: center;
}

.mushaf-title-en {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
}

.mushaf-icon {
  font-size: 2.5rem;
  margin: 4px 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.mushaf-action {
  font-size: 0.8rem;
  color: var(--accent-light);
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--gold-dim);
  margin-top: 2px;
}

/* ============================ ASMA UL-HUSNA ============================ */

.asma-container {
  padding: 0 1rem 6rem;
}

.asma-header {
  text-align: center;
  padding: 2rem 1rem;
  background: linear-gradient(135deg, var(--accent) 0%, #0d1f16 100%);
  border-radius: 20px;
  margin: 0 1rem 1.5rem;
  box-shadow: var(--shadow-card);
  animation: fadeInUp 0.6s ease;
}

.asma-count {
  font-family: 'Amiri', serif;
  font-size: 4rem;
  color: var(--gold);
  font-weight: 700;
  line-height: 1;
}

.asma-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.asma-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding: 0 0.5rem;
}

.asma-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 0.6rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  animation: fadeInUp 0.4s ease;
  animation-fill-mode: both;
}

.asma-card:active {
  transform: scale(0.96);
  border-color: var(--gold);
}

.asma-card-name-ar {
  font-family: 'Amiri', serif;
  font-size: 1.25rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 4px;
}

.asma-card-name-en {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.asma-card-meaning {
  font-size: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.asma-card-number {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 6px;
  opacity: 0.6;
}

/* Asma Detail Modal */
.asma-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.asma-detail-modal.hidden {
  display: none !important;
}

.asma-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

.asma-detail-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: 24px;
  padding: 2rem;
  width: 90%;
  max-width: 360px;
  text-align: center;
  animation: fadeInUp 0.3s ease;
  box-shadow: var(--shadow-card);
}

.asma-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
}

.asma-detail-name {
  font-family: 'Amiri', serif;
  font-size: 2.2rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.asma-detail-en {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.asma-detail-meaning {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.7;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 14px;
  margin-bottom: 1rem;
}

.asma-detail-meaning-ar {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-family: 'Amiri', serif;
  line-height: 1.8;
  margin-top: 0.5rem;
}

/* ============================ REMINDER SLIDER ============================ */

.reminder-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-top: 4px;
}

.reminder-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  background: var(--bg-secondary);
  border-radius: 3px;
  outline: none;
}

.reminder-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--gold);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.reminder-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
  border: 2px solid var(--gold);
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.reminder-slider-value {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 55px;
  text-align: center;
  white-space: nowrap;
}

/* ============================ SHARE PRAYER TIMES ============================ */

.share-prayer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0.8rem 1.2rem;
  padding: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
  animation: fadeInUp 0.4s ease;
}

.share-prayer-btn:active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ============================ ZIYARAT ============================ */

.ziyarat-container {
  padding: 0 1rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ziyarat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  animation: fadeInUp 0.4s ease;
}

.ziyarat-card:active {
  border-color: var(--gold);
  transform: scale(0.98);
}

.ziyarat-card-title {
  font-family: 'Amiri', serif;
  font-size: 1.1rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.ziyarat-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}

.ziyarat-card-text {
  font-family: 'Amiri', serif;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-line;
  max-height: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  margin-bottom: 0.4rem;
}

/* ============================ VOICE COMMANDS ============================ */

.voice-container {
  padding: 2rem 1rem 6rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.voice-mic-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: 3px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: all 0.2s;
  animation: pulse-ring 2s infinite;
}

.voice-mic-btn:active {
  transform: scale(0.92);
}

.voice-mic-btn.listening {
  background: #e63939;
  animation: pulse-ring 0.5s infinite;
}

@keyframes pulse-ring {
  0% { box-shadow: 0 0 0 0 rgba(45, 140, 94, 0.4); }
  70% { box-shadow: 0 0 0 20px rgba(45, 140, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 140, 94, 0); }
}

.voice-status {
  font-size: 1rem;
  color: var(--text-secondary);
  text-align: center;
}

.voice-hints {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 320px;
}

.voice-hint {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: center;
  line-height: 1.5;
}

.voice-result {
  width: 100%;
  max-width: 320px;
  min-height: 60px;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: 14px;
  padding: 1rem;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-align: center;
  display: none;
}

.voice-result.active {
  display: block;
  animation: fadeInUp 0.3s ease;
}

/* ============================ HOME SCREEN WIDGETS ============================ */

.widget-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 2rem;
}

.widget-overlay.hidden {
  display: none !important;
}

.widget-card {
  width: 100%;
  max-width: 320px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-card);
  animation: fadeInUp 0.4s ease;
}

.widget-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
}

.widget-value {
  font-family: 'Amiri', serif;
  font-size: 2rem;
  color: var(--gold);
  font-weight: 700;
}

.widget-sub {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}

.widget-close {
  padding: 0.6rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
}

/* Ramadan alarm group hide/show */
#ramadanAlarmGroup {
  display: none;
}

body[data-ramadan="true"] #ramadanAlarmGroup {
  display: block;
}

/* ============================ ZIYARAT FULL MODAL ============================ */

.ziyarat-full-modal {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ziyarat-full-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
}

.ziyarat-full-panel {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--gold-dim);
  border-radius: 24px;
  width: 90%;
  max-width: 420px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 1.5rem;
  animation: fadeInUp 0.3s ease;
  box-shadow: var(--shadow-card);
}

.ziyarat-full-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 2;
}

.ziyarat-full-title {
  font-family: 'Amiri', serif;
  font-size: 1.4rem;
  color: var(--gold);
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.3rem;
  padding-right: 1.5rem;
}

.ziyarat-full-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1rem;
}

.ziyarat-full-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.ziyarat-full-arabic {
  font-family: 'Amiri', serif;
  font-size: 1.15rem;
  line-height: 2;
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  white-space: pre-line;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 14px;
}

.ziyarat-full-divider {
  height: 1px;
  background: var(--border);
  margin: 0.5rem 0;
}

.ziyarat-full-english {
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre-line;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: 14px;
}

/* Read More Button */
.ziyarat-read-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 0.8rem;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--gold-dim);
  background: var(--bg-secondary);
  color: var(--gold);
  font-family: 'Cairo', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.ziyarat-read-more:active {
  background: var(--gold);
  color: var(--bg-primary);
}


/* ============================ MORNING & SLEEP DHIKR ============================ */

.dhikr-scroll-list {
  padding: 1rem 1rem 6rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

.dhikr-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1rem 1.2rem;
  transition: all 0.2s;
  animation: fadeInUp 0.4s ease;
}

.dhikr-item:active {
  border-color: var(--gold);
  transform: scale(0.98);
}

.dhikr-item-text-ar {
  font-family: 'Amiri', serif;
  font-size: 1.15rem;
  line-height: 1.9;
  color: var(--gold);
  direction: rtl;
  text-align: right;
  margin-bottom: 0.6rem;
}

.dhikr-item-text-en {
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 0.6rem;
}

.dhikr-item-count {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}

/* Nav toggle support — hide disabled nav buttons */
.nav-btn[data-page="ziyarat"].nav-hidden,
.nav-btn[data-page="voice"].nav-hidden,
.nav-btn[data-page="qadha"].nav-hidden,
.nav-btn[data-page="quotes"].nav-hidden,
.nav-btn[data-page="dhikr"].nav-hidden,
.nav-btn[data-page="asma"].nav-hidden,
.nav-btn[data-page="morning-dhikr"].nav-hidden,
.nav-btn[data-page="sleep-dhikr"].nav-hidden {
  display: none !important;
}

/* ============================ MORE MENU ============================ */

.more-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.more-menu-overlay.hidden {
  display: none !important;
}

.more-menu-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.more-menu-sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 70vh;
  background: var(--bg-primary);
  border-radius: 24px 24px 0 0;
  border-top: 2px solid var(--border-strong);
  padding: 1rem 1.5rem 2rem;
  overflow-y: auto;
  animation: slideUpMenu 0.3s ease;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4);
}

@keyframes slideUpMenu {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.more-menu-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 0 auto 1rem;
}

.more-menu-header {
  font-family: 'Amiri', serif;
  font-size: 1.3rem;
  color: var(--gold);
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.2rem;
  text-shadow: 0 0 8px rgba(201, 168, 76, 0.15);
}

.more-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.8rem;
}

.more-menu-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.2rem 0.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  color: var(--text-primary);
  font-family: inherit;
  animation: fadeInUp 0.4s ease both;
}

.more-menu-item:nth-child(1) { animation-delay: 0.05s; }
.more-menu-item:nth-child(2) { animation-delay: 0.1s; }
.more-menu-item:nth-child(3) { animation-delay: 0.15s; }
.more-menu-item:nth-child(4) { animation-delay: 0.2s; }
.more-menu-item:nth-child(5) { animation-delay: 0.25s; }

.more-menu-item:active {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
  transform: scale(0.96);
}

.more-menu-icon {
  color: var(--gold);
  filter: drop-shadow(0 0 6px rgba(201, 168, 76, 0.2));
}

.more-menu-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  color: var(--text-primary);
}

/* Language display fix for dhikr items */
.lang-ar .dhikr-item-text-en,
.lang-en .dhikr-item-text-ar {
  display: none !important;
}

/* Dhikr surah text styling */
.dhikr-surah-block {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  margin: 0.4rem 0;
  font-family: 'Amiri', serif;
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--gold);
  direction: rtl;
  text-align: right;
}

.dhikr-surah-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  font-family: 'Cairo', sans-serif;
}

@media (max-width: 360px) {
  .more-menu-grid {
    grid-template-columns: 1fr;
  }
}


/* ============================ GRIEF & BLOOD ANIMATION THEMES ============================ */

/* Ali al-Akbar (9 Muharram) - Deep Charcoal & Maroon Mourning */
body[data-theme-event="ali_akbar"] {
  --bg-primary: #0c0a0a !important;
  --bg-secondary: #141010 !important;
  --bg-card: #1a1515 !important;
  --bg-card2: #221818 !important;
  --bg-nav: #0c0a0a !important;
  --text-primary: #d4c8c0 !important;
  --text-secondary: #a89a90 !important;
  --text-muted: #7a6a60 !important;
  --gold: #c8b8a8 !important;
  --gold-light: #e8d8c8 !important;
  --gold-dim: #5a4a40 !important;
  --accent: #5a2a2a !important;
  --accent-light: #8a3a3a !important;
  --accent-glow: rgba(90, 42, 42, 0.3) !important;
  --border: rgba(90, 42, 42, 0.4) !important;
  --border-strong: rgba(138, 58, 58, 0.6) !important;
  --prayer-active-bg: linear-gradient(135deg, #3a1a1a, #5a2a2a) !important;
  background-image: radial-gradient(circle at 50% 0%, rgba(90,42,42,0.12) 0%, transparent 70%) !important;
}

body[data-theme-event="ali_akbar"] .page-title,
body[data-theme-event="ali_akbar"] .next-prayer-name,
body[data-theme-event="ali_akbar"] .ziyarat-card-title,
body[data-theme-event="ali_akbar"] .asma-name {
  color: #c8b8a8 !important;
  text-shadow: 0 0 12px rgba(200, 184, 168, 0.3) !important;
}

body[data-theme-event="ali_akbar"] .bottom-nav {
  border-top: 1px solid rgba(90, 42, 42, 0.5) !important;
}

body[data-theme-event="ali_akbar"] .nav-btn.active {
  color: #e8d8c8 !important;
}

/* ===== BLOOD DRIP ANIMATION ===== */
@keyframes bloodDrip {
  0% { transform: translateY(-20px); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(100vh); opacity: 0; }
}

@keyframes bloodPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes bloodGlow {
  0%, 100% { box-shadow: 0 0 8px rgba(230, 57, 57, 0.3); }
  50% { box-shadow: 0 0 24px rgba(230, 57, 57, 0.6); }
}

@keyframes sadPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* Abbas - Blood Grief Theme */
body[data-theme-event="abbas"] .app-container::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse at 20% 0%, rgba(180, 40, 40, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 0%, rgba(180, 40, 40, 0.06) 0%, transparent 50%);
  animation: bloodPulse 4s ease-in-out infinite;
}

body[data-theme-event="abbas"] .bottom-nav {
  border-top: 2px solid rgba(180, 40, 40, 0.4) !important;
  animation: bloodGlow 3s ease-in-out infinite;
}

body[data-theme-event="abbas"] .prayer-card.active {
  animation: bloodGlow 2s ease-in-out infinite;
  border-color: rgba(200, 50, 50, 0.7) !important;
}

body[data-theme-event="abbas"] .tasbih-ring-progress {
  stroke: #8a4040 !important;
  filter: drop-shadow(0 0 6px rgba(180, 50, 50, 0.5)) !important;
}

body[data-theme-event="abbas"] .page-title,
body[data-theme-event="abbas"] .next-prayer-name {
  color: #8a4040 !important;
  text-shadow: 0 0 12px rgba(180, 50, 50, 0.3) !important;
}

/* Ashura - Deep Blood Grief Theme with Blood Drip Effects */
body[data-theme-event="ashura"] .app-container::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse at 15% 0%, rgba(255, 0, 0, 0.4) 0%, transparent 60%),
    radial-gradient(ellipse at 85% 0%, rgba(200, 0, 0, 0.35) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(180, 0, 0, 0.25) 0%, transparent 50%);
  animation: bloodPulse 2.5s ease-in-out infinite;
}

/* Blood drip elements */
body[data-theme-event="ashura"] .app-container::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 2;
  background-image:
    radial-gradient(ellipse 3px 18px at 8% 5%, rgba(200, 0, 0, 0.85) 0%, rgba(180, 0, 0, 0.4) 60%, transparent 100%),
    radial-gradient(ellipse 4px 24px at 15% 12%, rgba(220, 0, 0, 0.9) 0%, rgba(200, 0, 0, 0.5) 60%, transparent 100%),
    radial-gradient(ellipse 3px 16px at 22% 8%, rgba(190, 0, 0, 0.8) 0%, rgba(170, 0, 0, 0.4) 60%, transparent 100%),
    radial-gradient(ellipse 5px 30px at 35% 15%, rgba(230, 0, 0, 0.95) 0%, rgba(210, 0, 0, 0.6) 60%, transparent 100%),
    radial-gradient(ellipse 3px 14px at 42% 6%, rgba(180, 0, 0, 0.75) 0%, rgba(160, 0, 0, 0.35) 60%, transparent 100%),
    radial-gradient(ellipse 4px 22px at 55% 10%, rgba(210, 0, 0, 0.85) 0%, rgba(190, 0, 0, 0.45) 60%, transparent 100%),
    radial-gradient(ellipse 3px 20px at 62% 18%, rgba(200, 0, 0, 0.9) 0%, rgba(180, 0, 0, 0.5) 60%, transparent 100%),
    radial-gradient(ellipse 5px 26px at 70% 7%, rgba(220, 0, 0, 0.88) 0%, rgba(200, 0, 0, 0.5) 60%, transparent 100%),
    radial-gradient(ellipse 3px 16px at 78% 14%, rgba(190, 0, 0, 0.8) 0%, rgba(170, 0, 0, 0.4) 60%, transparent 100%),
    radial-gradient(ellipse 4px 28px at 85% 9%, rgba(210, 0, 0, 0.92) 0%, rgba(190, 0, 0, 0.55) 60%, transparent 100%),
    radial-gradient(ellipse 3px 18px at 92% 16%, rgba(200, 0, 0, 0.85) 0%, rgba(180, 0, 0, 0.45) 60%, transparent 100%),
    radial-gradient(ellipse 2px 12px at 5% 22%, rgba(170, 0, 0, 0.7) 0%, transparent 100%),
    radial-gradient(ellipse 2px 14px at 95% 25%, rgba(180, 0, 0, 0.75) 0%, transparent 100%);
  animation: bloodDrip 6s ease-in-out infinite;
}

.ashura-hussain-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 9999;
  background-image: url("Days/Ashurha/Hussain.png");
  background-size: 90% auto;
  background-position: center 30%;
  background-repeat: no-repeat;
  opacity: 0.1;
  animation: hussainBlink 4s ease-in-out infinite;
}

@keyframes hussainBlink {
  0%, 100% { opacity: 0.05; }
  50% { opacity: 0.15; }
}

@media (max-width: 480px) {
  .ashura-hussain-overlay {
    background-size: 95% auto;
    background-position: center 25%;
    animation: hussainBlink 3s ease-in-out infinite;
  }
}

body[data-theme-event="ashura"] .ashura-hussain-overlay {
  display: block;
}

body[data-theme-event="ashura"] .bottom-nav {
  border-top: 2px solid rgba(230, 57, 57, 0.5) !important;
  animation: bloodGlow 2s ease-in-out infinite;
}

body[data-theme-event="ashura"] .prayer-card.active {
  animation: bloodGlow 1.5s ease-in-out infinite;
  border-color: rgba(230, 57, 57, 0.8) !important;
}

body[data-theme-event="ashura"] .tasbih-ring-progress {
  stroke: #b32424 !important;
  filter: drop-shadow(0 0 8px rgba(230, 57, 57, 0.6)) !important;
}

body[data-theme-event="ashura"] .page-title,
body[data-theme-event="ashura"] .next-prayer-name {
  color: #e63939 !important;
  text-shadow: 0 0 16px rgba(230, 57, 57, 0.5) !important;
}

body[data-theme-event="ashura"] .nav-btn.active {
  color: #e63939 !important;
  text-shadow: 0 0 10px rgba(230, 57, 57, 0.4) !important;
}

body[data-theme-event="ashura"] .quote-source,
body[data-theme-event="ashura"] .saved-item-source,
body[data-theme-event="ashura"] .asma-name {
  color: #b32424 !important;
}

/* Ali al-Akbar - Deep Charcoal & Maroon Grief Overlay */
body[data-theme-event="ali_akbar"] .app-container::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 1;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(80, 40, 40, 0.1) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(60, 30, 30, 0.07) 0%, transparent 40%);
  animation: sadPulse 5s ease-in-out infinite;
}

body[data-theme-event="ali_akbar"] .bottom-nav {
  border-top: 1px solid rgba(80, 40, 40, 0.5) !important;
}

body[data-theme-event="ali_akbar"] .prayer-card.active {
  border-color: rgba(100, 50, 50, 0.7) !important;
  box-shadow: 0 0 16px rgba(90, 42, 42, 0.25) !important;
}

body[data-theme-event="ali_akbar"] .tasbih-ring-progress {
  stroke: #5a2a2a !important;
  filter: drop-shadow(0 0 4px rgba(90, 42, 42, 0.3)) !important;
}

body[data-theme-event="ali_akbar"] .nav-btn.active {
  color: #8a5a5a !important;
}

body[data-theme-event="ali_akbar"] .quote-source,
body[data-theme-event="ali_akbar"] .saved-item-source {
  color: #7a5a5a !important;
}

/* Ensure overlays don't block interaction */
body[data-theme-event="abbas"] .app-container,
body[data-theme-event="ashura"] .app-container,
body[data-theme-event="ali_akbar"] .app-container {
  position: relative;
}

body[data-theme-event="abbas"] .app-container::before,
body[data-theme-event="ashura"] .app-container::before,
body[data-theme-event="ashura"] .app-container::after,
body[data-theme-event="ali_akbar"] .app-container::before {
  pointer-events: none !important;
}

/* ============ SAFE AREA INSETS FOR ROUNDED PHONES ============ */
.bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .bottom-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  .pages-container {
    padding-bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
  }
}

/* ============ iOS 26 EXPERIMENTAL BOTTOM NAV ============ */
body.ios26-nav .bottom-nav {
  background: rgba(10, 10, 15, 0.65);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-top: none;
  border-radius: 28px;
  bottom: 12px;
  left: 16px;
  right: 16px;
  width: auto;
  max-width: 420px;
  margin: 0 auto;
  height: auto;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

body.ios26-nav .nav-btn {
  border-radius: 16px;
  padding: 6px 4px;
  margin: 0 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body.ios26-nav .nav-btn.active {
  background: rgba(201, 168, 76, 0.15);
  box-shadow: 0 0 12px rgba(201, 168, 76, 0.2);
}

body.ios26-nav .nav-btn.active svg {
  stroke: var(--gold);
  filter: drop-shadow(0 0 4px rgba(201, 168, 76, 0.5));
}

body.ios26-nav .pages-container {
  padding-bottom: max(100px, calc(100px + env(safe-area-inset-bottom)));
}

body.ios26-nav .app-container {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============ QIBLA ALIGNMENT HAPTIC FEEDBACK INDICATOR ============ */
.qibla-alignment-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.6) 0%, transparent 70%);
  animation: qiblaPulse 1.5s ease-in-out infinite;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.qibla-alignment-pulse.visible {
  opacity: 1;
}

@keyframes qiblaPulse {
  0% { transform: scale(0.8); opacity: 0.6; }
  50% { transform: scale(1.4); opacity: 0.2; }
  100% { transform: scale(0.8); opacity: 0.6; }
}

/* ============ QADHA HOME WIDGET ============ */
.qadha-home-widget {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, var(--bg-card), rgba(26, 58, 42, 0.6));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px;
  margin: 14px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.qadha-home-widget:hover {
  border-color: var(--gold);
  box-shadow: 0 0 20px rgba(201, 168, 76, 0.15);
}

.qadha-widget-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.qadha-widget-info {
  flex: 1;
  min-width: 0;
}

.qadha-widget-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.qadha-widget-count {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}

.qadha-widget-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.qadha-widget-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color 0.3s ease;
}

.qadha-home-widget:hover .qadha-widget-arrow {
  color: var(--gold);
}

/* ============ FLOATING QURAN BUTTON ============ */
.float-quran-btn {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) - 8px);
  right: 16px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(26, 58, 42, 0.9), rgba(13, 31, 22, 0.95));
  border: 1px solid var(--gold);
  border-radius: 24px;
  padding: 8px 14px;
  font-size: 0.75rem;
  color: var(--gold);
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3), 0 0 12px rgba(201, 168, 76, 0.1);
}

.float-quran-btn.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.float-quran-btn svg {
  stroke: var(--gold);
  flex-shrink: 0;
}

/* ============ HOME PAGE CENTERING ============ */
#page-home {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding-bottom: 100px;
}

#page-home .home-top,
#page-home #muharramTimeline,
#page-home .location-bar {
  flex-shrink: 0;
}

.home-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 0.5rem 1rem 1.5rem;
  width: 100%;
}

.home-center .next-prayer-card,
.home-center .prayer-list,
.home-center .qadha-home-widget {
  width: 100%;
  max-width: 400px;
}

#page-home .daily-quote {
  flex-shrink: 0;
}

/* ===================================================================
   HOLIDAY / EVENT THEMES  (data-theme-event on <body>)
   =================================================================== */

/* -------- ASHURA — Deep Crimson & Black mourning -------- */
[data-theme-event="ashura"] {
  --bg-primary: #150000;
  --bg-secondary: #240000;
  --bg-card: #330000;
  --bg-card2: #400000;
  --bg-nav: #150000;
  --text-primary: #ffcccc;
  --text-secondary: #e69999;
  --text-muted: #cc6666;
  --gold: #ff0000;
  --gold-light: #ff4d4d;
  --gold-dim: #990000;
  --accent: #b30000;
  --accent-light: #ff1a1a;
  --accent-glow: rgba(255, 0, 0, 0.4);
  --border: rgba(255, 0, 0, 0.5);
  --border-strong: rgba(255, 0, 0, 0.8);
  --prayer-active-bg: linear-gradient(135deg, #800000, #ff0000);
  --shadow-card: 0 4px 20px rgba(255,0,0,0.4);
}

[data-theme-event="ashura"] .app-header {
  border-bottom-color: rgba(230, 57, 57, 0.3);
}

[data-theme-event="ashura"] .splash {
  background: radial-gradient(ellipse at center, #1a0505 0%, #0a0000 100%);
}

/* Karbala dome watermark */
[data-theme-event="ashura"] .pages-container::before {
  content: "☽";
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 14rem;
  color: rgba(200, 0, 0, 0.04);
  pointer-events: none;
  z-index: 0;
  line-height: 1;
}

/* Animated blood-drip decoration */
[data-theme-event="ashura"] .app::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(90deg,
    transparent 0%, #ff0000 15%,
    #cc0000 30%, transparent 45%,
    #ff0000 60%, transparent 80%,
    #cc0000 95%);
  z-index: 1000;
  animation: drip 2.5s ease-in-out infinite;
  box-shadow: 0 0 15px #ff0000, 0 0 30px #cc0000;
}

@keyframes drip {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

[data-theme-event="ashura"] .next-prayer-card {
  background: linear-gradient(135deg, #4a0000, #8a1a1a);
  border-color: rgba(230, 57, 57, 0.4);
  box-shadow: 0 0 30px rgba(230, 57, 57, 0.2);
}

[data-theme-event="ashura"] .prayer-item.current {
  border-color: rgba(230, 57, 57, 0.6);
  box-shadow: 0 0 0 1px rgba(230, 57, 57, 0.4) inset;
}

[data-theme-event="ashura"] .prayer-item.current .prayer-dot {
  background: #e63939;
  box-shadow: 0 0 8px #e63939;
}

[data-theme-event="ashura"] .nav-btn.active {
  color: #e63939;
}

[data-theme-event="ashura"] .nav-btn.active svg {
  filter: drop-shadow(0 0 4px rgba(230, 57, 57, 0.6));
}

/* -------- MUHARRAM early days (1-6, 9) -------- */
[data-theme-event="muharram"] {
  --gold: #a67c52;
  --gold-light: #c49a6a;
  --gold-dim: #7a5a38;
  --accent-glow: rgba(166, 124, 82, 0.12);
}

/* -------- ABBAS — Dark Green mourning -------- */
[data-theme-event="abbas"] {
  --bg-primary: #030f06;
  --bg-secondary: #051208;
  --bg-card: #071a0c;
  --bg-card2: #0a2010;
  --bg-nav: #030f06;
  --text-primary: #d8e8d0;
  --text-secondary: #90b898;
  --text-muted: #507860;
  --gold: #8a4040;
  --gold-light: #b05050;
  --gold-dim: #5a2828;
  --accent: #1a4a20;
  --accent-light: #2a6a30;
  --accent-glow: rgba(138, 64, 64, 0.12);
  --border: rgba(26, 74, 32, 0.3);
  --border-strong: rgba(138, 64, 64, 0.4);
  --prayer-active-bg: linear-gradient(135deg, #0a3010, #1a4a20);
}

[data-theme-event="abbas"] .next-prayer-card {
  background: linear-gradient(135deg, #071a0c, #1a4a20);
  border-color: rgba(138, 64, 64, 0.4);
}

/* Removed duplicate Ali Akbar */

/* -------- EID AL-GHADIR — Emerald & Gold -------- */
[data-theme-event="eid_ghadir"] {
  --bg-primary: #051a0e;
  --bg-secondary: #082014;
  --bg-card: #0c2a1c;
  --bg-card2: #103520;
  --bg-nav: #051a0e;
  --text-primary: #f0f8f0;
  --text-secondary: #a8d4b0;
  --text-muted: #5a8a68;
  --gold: #ffd700;
  --gold-light: #ffe85a;
  --gold-dim: #b09020;
  --accent: #1a8a44;
  --accent-light: #22aa55;
  --accent-glow: rgba(255, 215, 0, 0.18);
  --border: rgba(26, 138, 68, 0.3);
  --border-strong: rgba(255, 215, 0, 0.5);
  --prayer-active-bg: linear-gradient(135deg, #0c5528, #ffd700);
  --shadow-card: 0 4px 20px rgba(255,215,0,0.1);
}

[data-theme-event="eid_ghadir"] .splash {
  background: radial-gradient(ellipse at center, #0c2a1c 0%, #051a0e 100%);
}

[data-theme-event="eid_ghadir"] .next-prayer-card {
  background: linear-gradient(135deg, #0c5528, #1a8a44);
  border-color: rgba(255, 215, 0, 0.5);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.15);
}

[data-theme-event="eid_ghadir"] .prayer-item.current {
  border-color: rgba(255, 215, 0, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.4) inset;
}

[data-theme-event="eid_ghadir"] .prayer-item.current .prayer-dot {
  background: #ffd700;
  box-shadow: 0 0 10px #ffd700;
}

[data-theme-event="eid_ghadir"] .nav-btn.active {
  color: #ffd700;
  text-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

[data-theme-event="eid_ghadir"] .bottom-nav {
  border-top-color: rgba(255, 215, 0, 0.3);
  box-shadow: 0 -4px 24px rgba(255, 215, 0, 0.08);
}

/* -------- BIRTH OF PROPHET / HASSAN — White Marble (NOT Ali — he has his own theme) -------- */
[data-theme-event="birth_prophet"],
[data-theme-event="prophet_birth"],
[data-theme-event="birth_ali"],
[data-theme-event="ali_birth"],
[data-theme-event="birth_hassan"] {
  --bg-primary: #f8f4ee;
  --bg-secondary: #f0ebe0;
  --bg-card: #ffffff;
  --bg-card2: #faf6ef;
  --bg-nav: #ffffff;
  --text-primary: #1a1a14;
  --text-secondary: #4a4530;
  --text-muted: #8a8070;
  --gold: #b3923b;
  --gold-light: #d4b060;
  --gold-dim: #8a7020;
  --accent: #1e5a30;
  --accent-light: #28784a;
  --accent-glow: rgba(179, 146, 59, 0.12);
  --border: rgba(30, 90, 48, 0.1);
  --border-strong: rgba(179, 146, 59, 0.35);
  --prayer-active-bg: linear-gradient(135deg, #1e5a30, #b3923b);
  --ring-bg: rgba(0, 0, 0, 0.04);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.1);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.06);
}

[data-theme-event="birth_prophet"] .splash,
[data-theme-event="prophet_birth"] .splash,
[data-theme-event="birth_ali"] .splash,
[data-theme-event="ali_birth"] .splash,
[data-theme-event="birth_hassan"] .splash {
  background: radial-gradient(ellipse at center, #f8f4ee 0%, #ede5d5 100%);
}

/* Marble texture overlay via pseudo-element on body */
[data-theme-event="birth_prophet"] .app::after,
[data-theme-event="prophet_birth"] .app::after,
[data-theme-event="birth_ali"] .app::after,
[data-theme-event="ali_birth"] .app::after,
[data-theme-event="birth_hassan"] .app::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='marble'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.015' numOctaves='4' seed='2' result='turbulence'/%3E%3CfeDisplacementMap in='SourceGraphic' in2='turbulence' scale='8' xChannelSelector='R' yChannelSelector='G'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' fill='%23f0ebe0' filter='url(%23marble)' opacity='0.3'/%3E%3C/svg%3E");
  opacity: 0.4;
  pointer-events: none;
  z-index: 0;
}

[data-theme-event="birth_prophet"] .prayer-item.current .prayer-dot,
[data-theme-event="prophet_birth"] .prayer-item.current .prayer-dot,
[data-theme-event="birth_ali"] .prayer-item.current .prayer-dot,
[data-theme-event="ali_birth"] .prayer-item.current .prayer-dot,
[data-theme-event="birth_hassan"] .prayer-item.current .prayer-dot {
  background: #b3923b;
  box-shadow: 0 0 8px rgba(179, 146, 59, 0.6);
}

/* -------- BIRTH OF HUSSAIN — Teal/Blue marble -------- */
[data-theme-event="birth_hussain"] {
  --bg-primary: #eef4f8;
  --bg-secondary: #e4eff5;
  --bg-card: #ffffff;
  --bg-card2: #f4f8fc;
  --bg-nav: #ffffff;
  --text-primary: #0a1a2a;
  --text-secondary: #304050;
  --text-muted: #708090;
  --gold: #4a8aaa;
  --gold-light: #6aaaca;
  --gold-dim: #2a5a7a;
  --accent: #1a5a8a;
  --accent-light: #2a7aaa;
  --accent-glow: rgba(74, 138, 170, 0.12);
  --border: rgba(26, 90, 138, 0.12);
  --border-strong: rgba(74, 138, 170, 0.4);
  --prayer-active-bg: linear-gradient(135deg, #1a5a8a, #4a8aaa);
  --ring-bg: rgba(0, 0, 0, 0.04);
}

[data-theme-event="birth_hussain"] .splash {
  background: radial-gradient(ellipse at center, #eef4f8 0%, #d8ecf5 100%);
}

/* -------- WAFAT ALI / WAFAT HASSAN — Slate Grey -------- */
[data-theme-event="wafat_ali"],
[data-theme-event="wafat_hassan"] {
  --bg-primary: #0c0e10;
  --bg-secondary: #121518;
  --bg-card: #181c20;
  --bg-card2: #1e2228;
  --bg-nav: #0c0e10;
  --text-primary: #d0d8e0;
  --text-secondary: #8898a8;
  --text-muted: #506070;
  --gold: #90a4ae;
  --gold-light: #b0c4ce;
  --gold-dim: #607080;
  --accent: #364a5a;
  --accent-light: #4a6070;
  --accent-glow: rgba(144, 164, 174, 0.1);
  --border: rgba(70, 90, 110, 0.25);
  --border-strong: rgba(144, 164, 174, 0.4);
  --prayer-active-bg: linear-gradient(135deg, #1e2a38, #364a5a);
}

[data-theme-event="wafat_ali"] .next-prayer-card,
[data-theme-event="wafat_hassan"] .next-prayer-card {
  background: linear-gradient(135deg, #1e2a38, #364a5a);
  border-color: rgba(144, 164, 174, 0.35);
}

/* -------- EID AL-FITR — Mint Green celebration -------- */
[data-theme-event="eid_fitr"] {
  --bg-primary: #f0faf4;
  --bg-secondary: #e5f5ec;
  --bg-card: #ffffff;
  --bg-card2: #f5fcf8;
  --bg-nav: #ffffff;
  --text-primary: #0a1f14;
  --text-secondary: #2a5a3a;
  --text-muted: #6a9a7a;
  --gold: #2e7d32;
  --gold-light: #43a047;
  --gold-dim: #1a5c1a;
  --accent: #1a7a40;
  --accent-light: #2a9a50;
  --accent-glow: rgba(46, 125, 50, 0.12);
  --border: rgba(46, 125, 50, 0.12);
  --border-strong: rgba(46, 125, 50, 0.35);
  --prayer-active-bg: linear-gradient(135deg, #1a5a28, #2e7d32);
  --ring-bg: rgba(0, 0, 0, 0.04);
}

[data-theme-event="eid_fitr"] .splash {
  background: radial-gradient(ellipse at center, #f0faf4 0%, #d8f0e0 100%);
}

[data-theme-event="eid_fitr"] .prayer-item.current .prayer-dot {
  background: #2e7d32;
  box-shadow: 0 0 8px rgba(46, 125, 50, 0.6);
}

/* -------- EID AL-ADHA — Olive Gold -------- */
[data-theme-event="eid_adha"] {
  --bg-primary: #f5f2e8;
  --bg-secondary: #ece8d8;
  --bg-card: #ffffff;
  --bg-card2: #faf8f0;
  --bg-nav: #ffffff;
  --text-primary: #1a1a08;
  --text-secondary: #4a4824;
  --text-muted: #7a7850;
  --gold: #6b6649;
  --gold-light: #8b8660;
  --gold-dim: #5a5438;
  --accent: #4a4a18;
  --accent-light: #6a6a28;
  --accent-glow: rgba(107, 102, 73, 0.12);
  --border: rgba(74, 74, 24, 0.12);
  --border-strong: rgba(107, 102, 73, 0.4);
  --prayer-active-bg: linear-gradient(135deg, #3a3a14, #6b6649);
  --ring-bg: rgba(0, 0, 0, 0.04);
}

[data-theme-event="eid_adha"] .splash {
  background: radial-gradient(ellipse at center, #f5f2e8 0%, #e5e0c8 100%);
}

/* ===================================================================
   CUSTOM MEDIA PLAYER WIDGET  (.custom-media-widget)
   Shared styles for Abbas / Ali Akbar / Hussain / Ghadir players
   =================================================================== */

.custom-media-widget {
  position: fixed;
  bottom: calc(var(--nav-height, 68px) + var(--safe-bottom, 0px) + 12px);
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 320px;
  z-index: 500;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-family: 'Cairo', sans-serif;
  transition: all 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Minimized state — collapses to small icon pill */
.custom-media-widget.minimized .widget-content {
  display: none;
}

.custom-media-widget.minimized {
  left: auto;
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.custom-media-widget.minimized .widget-toggle-icon {
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-media-widget:not(.minimized) .widget-toggle-icon {
  display: none;
}

.widget-content {
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.widget-title {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}

.widget-minimize-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: inherit;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s;
}

.widget-minimize-btn:active {
  background: rgba(255,255,255,0.2);
}

.widget-track {
  font-size: 0.78rem;
  opacity: 0.75;
  padding: 6px 10px;
  background: rgba(255,255,255,0.06);
  border-radius: 8px;
}

.widget-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.widget-play-btn {
  padding: 6px 16px;
  border-radius: 16px;
  border: none;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Cairo', sans-serif;
  align-self: center;
}

.widget-play-btn:active {
  transform: scale(0.96);
}

.widget-progress-bar {
  height: 5px;
  border-radius: 3px;
  background: rgba(255,255,255,0.15);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.widget-progress-fill {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  transition: width 0.5s linear;
}

/* --- Abbas theme colors --- */
.custom-media-widget.abbas-theme {
  background: linear-gradient(135deg, #060e07, #0a2010);
  border: 1px solid rgba(138, 64, 64, 0.5);
  color: #d8e8d0;
}
.custom-media-widget.abbas-theme .widget-play-btn {
  background: #8a4040;
  color: #fff;
}
.custom-media-widget.abbas-theme .widget-progress-fill {
  background: #8a4040;
}

/* --- Ali Akbar theme colors --- */
.custom-media-widget.ali-akbar-theme {
  background: linear-gradient(135deg, #0a0e17, #0f172a);
  border: 1px solid rgba(59, 130, 246, 0.4);
  color: #e2e8f0;
}
.custom-media-widget.ali-akbar-theme .widget-play-btn {
  background: #3b82f6;
  color: #fff;
}
.custom-media-widget.ali-akbar-theme .widget-progress-fill {
  background: #60a5fa;
}

/* --- Ashura theme colors --- */
.custom-media-widget.ashura-theme {
  background: linear-gradient(135deg, #0a0000, #200808);
  border: 1px solid rgba(230, 57, 57, 0.5);
  color: #f5e8e8;
}
.custom-media-widget.ashura-theme .widget-play-btn {
  background: #cc2222;
  color: #fff;
  box-shadow: 0 0 12px rgba(230, 57, 57, 0.3);
}
.custom-media-widget.ashura-theme .widget-progress-fill {
  background: #e63939;
}

/* --- Ghadir theme colors --- */
.custom-media-widget.ghadir-theme {
  background: linear-gradient(135deg, #051a0e, #0c3020);
  border: 1px solid rgba(255, 215, 0, 0.6);
  color: #f0f8f0;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 20px rgba(255,215,0,0.08);
}
.custom-media-widget.ghadir-theme .widget-play-btn {
  background: linear-gradient(135deg, #1a8a44, #ffd700);
  color: #051a0e;
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.3);
}
.custom-media-widget.ghadir-theme .widget-progress-fill {
  background: linear-gradient(90deg, #1a8a44, #ffd700);
}

/* Switch track button (Ashura combined player) */
.widget-switch-btn {
  padding: 6px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  transition: background 0.2s;
  align-self: center;
}
.widget-switch-btn:active {
  background: rgba(255,255,255,0.18);
}

/* Widget rwd/fwd time buttons */
.widget-time-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  color: inherit;
  padding: 5px 14px;
  border-radius: 8px;
  font-size: 0.75rem;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
  transition: background 0.2s;
}
.widget-time-btn:active {
  background: rgba(255,255,255,0.18);
}

/* ============================ UPDATES / WHAT'S NEW MODAL ============================ */

#updatesModal .modal-body {
  padding: 0 20px 24px;
}

.version-banner {
  text-align: center;
  padding: 20px 16px;
  margin: 0 -20px 16px;
  background: linear-gradient(135deg, rgba(232,199,106,0.15), rgba(232,199,106,0.05));
  border-bottom: 1px solid rgba(232,199,106,0.2);
}

.version-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  letter-spacing: 1px;
  line-height: 1.1;
}

.version-name {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-top: 6px;
  font-weight: 600;
}

.version-name .en { display: none; }
body.lang-en .version-name .en { display: block; }
body.lang-en .version-name .ar { display: none; }

.version-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.version-date .en { display: none; }
body.lang-en .version-date .en { display: block; }
body.lang-en .version-date .ar { display: none; }

.updates-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.update-section {
  background: rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.06);
}

.update-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.update-item {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 6px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
}

.update-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
  margin-top: 1px;
}

.update-tag.new {
  background: rgba(45, 140, 94, 0.25);
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.update-tag.fix {
  background: rgba(200, 160, 80, 0.2);
  color: #e8c76a;
  border: 1px solid rgba(232, 199, 106, 0.3);
}

.update-tag.prev {
  background: rgba(100, 100, 120, 0.2);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.update-item .ar { display: inline; }
.update-item .en { display: none; }
body.lang-en .update-item .en { display: inline; }
body.lang-en .update-item .ar { display: none; }

/* Page-specific language switching for Zakat, Kaffarah, Taqibat, Media */
.zakat-section .ar,
.kaffarah-container .ar,
.kaffarah-form .ar,
.kaffarah-results .ar,
.kaffarah-charity-box .ar,
.taqibat-content .ar,
.media-manager-container .ar,
.media-category .ar,
.media-item .ar { display: inline; }

.zakat-section .en,
.kaffarah-container .en,
.kaffarah-form .en,
.kaffarah-results .en,
.kaffarah-charity-box .en,
.taqibat-content .en,
.media-manager-container .en,
.media-category .en,
.media-item .en { display: none; }

body.lang-en .zakat-section .ar,
body.lang-en .kaffarah-container .ar,
body.lang-en .kaffarah-form .ar,
body.lang-en .kaffarah-results .ar,
body.lang-en .kaffarah-charity-box .ar,
body.lang-en .taqibat-content .ar,
body.lang-en .media-manager-container .ar,
body.lang-en .media-category .ar,
body.lang-en .media-item .ar { display: none; }

body.lang-en .zakat-section .en,
body.lang-en .kaffarah-container .en,
body.lang-en .kaffarah-form .en,
body.lang-en .kaffarah-results .en,
body.lang-en .kaffarah-charity-box .en,
body.lang-en .taqibat-content .en,
body.lang-en .media-manager-container .en,
body.lang-en .media-category .en,
body.lang-en .media-item .en { display: inline; }

/* For block-level ar/en elements (page titles, section titles, etc) */
.zakat-section-title .ar,
.zakat-nisab-info .ar,
.zakat-input-row label .ar,
.kaffarah-section-title .ar,
.kaffarah-intro .ar,
.kaffarah-charity-title .ar,
.kaffarah-type-btn .ar,
.kaffarah-input-row label .ar,
.kaffarah-result-option .ar,
.kaffarah-calculate-btn .ar,
.kaffarah-results-title .ar,
.media-category-header .ar,
.media-manager-intro .ar,
.media-total-usage .ar,
.media-clear-all-btn .ar,
.taqibat-prayer-title .ar,
.taqibat-item-text-ar,
.taqibat-item-count { display: block; }

.zakat-section-title .en,
.zakat-nisab-info .en,
.zakat-input-row label .en,
.kaffarah-section-title .en,
.kaffarah-intro .en,
.kaffarah-charity-title .en,
.kaffarah-type-btn .en,
.kaffarah-input-row label .en,
.kaffarah-result-option .en,
.kaffarah-calculate-btn .en,
.kaffarah-results-title .en,
.media-category-header .en,
.media-manager-intro .en,
.media-total-usage .en,
.media-clear-all-btn .en,
.taqibat-prayer-title .en,
.taqibat-item-text-en { display: none; }

body.lang-en .zakat-section-title .ar,
body.lang-en .zakat-nisab-info .ar,
body.lang-en .zakat-input-row label .ar,
body.lang-en .kaffarah-section-title .ar,
body.lang-en .kaffarah-intro .ar,
body.lang-en .kaffarah-charity-title .ar,
body.lang-en .kaffarah-type-btn .ar,
body.lang-en .kaffarah-input-row label .ar,
body.lang-en .kaffarah-result-option .ar,
body.lang-en .kaffarah-calculate-btn .ar,
body.lang-en .kaffarah-results-title .ar,
body.lang-en .media-category-header .ar,
body.lang-en .media-manager-intro .ar,
body.lang-en .media-total-usage .ar,
body.lang-en .media-clear-all-btn .ar,
body.lang-en .taqibat-prayer-title .ar,
body.lang-en .taqibat-item-text-ar,
body.lang-en .taqibat-item-count { display: none; }

body.lang-en .zakat-section-title .en,
body.lang-en .zakat-nisab-info .en,
body.lang-en .zakat-input-row label .en,
body.lang-en .kaffarah-section-title .en,
body.lang-en .kaffarah-intro .en,
body.lang-en .kaffarah-charity-title .en,
body.lang-en .kaffarah-type-btn .en,
body.lang-en .kaffarah-input-row label .en,
body.lang-en .kaffarah-result-option .en,
body.lang-en .kaffarah-calculate-btn .en,
body.lang-en .kaffarah-results-title .en,
body.lang-en .media-category-header .en,
body.lang-en .media-manager-intro .en,
body.lang-en .media-total-usage .en,
body.lang-en .media-clear-all-btn .en,
body.lang-en .taqibat-prayer-title .en,
body.lang-en .taqibat-item-text-en { display: block; }

/* ============================ ZAKAT ESTIMATOR ============================ */

.zakat-container {
  padding: 0 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.zakat-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  line-height: 1.6;
}

.zakat-section {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.zakat-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 6px;
}

.zakat-nisab-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 6px 10px;
  background: rgba(232,199,106,0.08);
  border-radius: 8px;
  border: 1px solid rgba(232,199,106,0.15);
}

.zakat-input-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zakat-input-row label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.zakat-input {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.zakat-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232,199,106,0.15);
}

.zakat-select {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}

.zakat-calculate-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px 24px;
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 18px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.zakat-calculate-btn:active {
  transform: scale(0.98);
}

.zakat-results {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  margin-top: 18px;
}

.zakat-results-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.zakat-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.zakat-result-row:last-child {
  border-bottom: none;
}

.zakat-result-label {
  color: var(--text-secondary);
}

.zakat-result-value {
  color: var(--gold);
  font-weight: 700;
}

.zakat-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0 0;
  margin-top: 18px;
  border-top: 2px solid var(--gold);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.zakat-total-amount {
  color: var(--gold);
  font-size: 1.2rem;
}

.zakat-currency-select {
  font-size: 0.8rem;
  padding: 8px 10px;
  min-width: 90px;
}

.zakat-cat-results {
  background: var(--bg-card2);
  border-radius: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  margin-top: 18px;
}

.zakat-cat-result {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.zakat-cat-result-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.zakat-cat-result-value {
  font-size: 1rem;
  color: var(--text-primary);
  font-weight: 600;
}

.zakat-cat-result-value.zakat-highlight {
  color: var(--gold);
  font-weight: 700;
  font-size: 1.1rem;
}

.zakat-cat-result.zakat-below {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 8px 0;
}

/* ============================ KAFFARAH CALCULATOR ============================ */

.kaffarah-container {
  padding: 0 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.kaffarah-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  line-height: 1.6;
}

.kaffarah-type-selector {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}

.kaffarah-type-btn {
  flex: 1;
  min-width: 100px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.kaffarah-type-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  border-color: transparent;
}

.kaffarah-form {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.kaffarah-input-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kaffarah-input-row label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.kaffarah-input {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text-primary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.kaffarah-input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(232,199,106,0.15);
}

.kaffarah-calculate-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px 24px;
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.kaffarah-calculate-btn:active {
  transform: scale(0.98);
}

.kaffarah-results {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
}

.kaffarah-results-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.kaffarah-result-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.kaffarah-result-row:last-child {
  border-bottom: none;
}

.kaffarah-result-option {
  font-size: 0.85rem;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kaffarah-result-option .option-label {
  color: var(--text-primary);
  font-weight: 600;
}

.kaffarah-result-option .option-value {
  color: var(--gold);
  font-weight: 700;
}

.kaffarah-charity-box {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  margin-top: 18px;
}

.kaffarah-charity-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
  text-align: center;
}

.kaffarah-charity-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kaffarah-charity-link {
  display: block;
  padding: 10px 14px;
  background: var(--bg-card2);
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  transition: background 0.2s, border-color 0.2s;
}

.kaffarah-charity-link:active {
  background: rgba(232,199,106,0.1);
  border-color: var(--gold);
}

/* ============================ TAQIBAT AL-SALAT ============================ */

.taqibat-prayer-tabs {
  display: flex;
  gap: 6px;
  padding: 0 16px 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.taqibat-tab {
  flex: 1;
  min-width: 60px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 10px;
  color: var(--text-secondary);
  font-family: 'Cairo', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.taqibat-tab.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff;
  border-color: transparent;
}

.taqibat-content {
  padding: 0 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.taqibat-prayer-section {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: taqibatSlideIn 0.35s ease-out;
}

@keyframes taqibatSlideIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.taqibat-prayer-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}



.taqibat-item:nth-child(1) { animation-delay: 0s; }
.taqibat-item:nth-child(2) { animation-delay: 0.05s; }
.taqibat-item:nth-child(3) { animation-delay: 0.1s; }
.taqibat-item:nth-child(4) { animation-delay: 0.15s; }
.taqibat-item:nth-child(5) { animation-delay: 0.2s; }
.taqibat-item:nth-child(6) { animation-delay: 0.25s; }

.taqibat-item:last-child {
  border-bottom: none;
}

.taqibat-item-text-ar {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.8;
  text-align: right;
  direction: rtl;
  margin-bottom: 6px;
}

.taqibat-item-text-en {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.6;
  text-align: left;
  direction: ltr;
}

.taqibat-item-count {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 10px;
  background: rgba(232,199,106,0.15);
  border-radius: 8px;
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 700;
}

.taqibat-item-source {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 4px;
  font-style: italic;
}

/* ============================ MEDIA MANAGER ============================ */

.media-manager-container {
  padding: 0 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.media-manager-intro {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
  padding: 12px 8px;
  background: rgba(255,255,255,0.03);
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.06);
  line-height: 1.6;
}

.media-total-usage {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.media-usage-size {
  color: var(--gold);
  font-weight: 700;
  font-size: 1.1rem;
}

.media-category {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.media-category-header {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.media-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.media-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-card2);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.media-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  overflow: hidden;
}

.media-item-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.media-item-size {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.media-item-status {
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 6px;
  font-weight: 700;
  text-transform: uppercase;
  flex-shrink: 0;
}

.media-item-status.cached {
  background: rgba(45, 140, 94, 0.2);
  color: #4ade80;
}

.media-item-status.not-cached {
  background: rgba(100, 100, 100, 0.2);
  color: var(--text-muted);
}

.media-item-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
  margin-left: 8px;
}

.media-item-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform 0.15s;
}

.media-item-btn:active {
  transform: scale(0.95);
}

.media-item-btn.download {
  background: linear-gradient(135deg, #2d8c5e, #3daa70);
  color: #fff;
}

.media-item-btn.delete {
  background: rgba(200, 60, 60, 0.25);
  color: #ff9999;
}

.media-clear-all-btn {
  background: rgba(200, 60, 60, 0.2);
  color: #ff9999;
  border: 1px solid rgba(200, 60, 60, 0.4);
  border-radius: 14px;
  padding: 14px 24px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 18px;
}

.media-clear-all-btn:active {
  background: rgba(200, 60, 60, 0.35);
}

.media-item .ar { display: inline; }
.media-item .en { display: none; }
body.lang-en .media-item .en { display: inline; }
body.lang-en .media-item .ar { display: none; }

/* ============================================
   AI FLOATING BUTTON
   ============================================ */

.float-ai-btn {
  position: fixed;
  bottom: calc(var(--nav-height, 68px) + var(--safe-bottom, 0px) + 14px);
  left: 16px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, #1a5c3a, #0d3020);
  border: 1px solid var(--gold);
  border-radius: 24px;
  padding: 9px 15px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35), 0 0 14px rgba(201, 168, 76, 0.15);
  font-family: 'Cairo', sans-serif;
}

.float-ai-btn:hover,
.float-ai-btn:active {
  background: linear-gradient(135deg, #257a4e, #163d28);
  box-shadow: 0 6px 28px rgba(0,0,0,0.5), 0 0 20px rgba(201, 168, 76, 0.3);
  transform: translateY(-2px) scale(1.04);
}

.float-ai-btn svg { flex-shrink: 0; }
.float-ai-label { letter-spacing: 0.02em; }

/* Hide AI float on the AI page itself */
body[data-active-page="ai"] .float-ai-btn { opacity: 0; pointer-events: none; }

/* iOS 26 mode: move the AI button up slightly */
body.ios26-nav .float-ai-btn {
  bottom: calc(90px + var(--safe-bottom, 0px) + 14px);
}

/* ============================================
   KAABAH ALIGNED OVERLAY (Qibla)
   ============================================ */

.compass-wrap {
  position: relative;
}

.kaabah-aligned-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(13, 31, 22, 0.92) 60%, transparent 100%);
  border-radius: 50%;
  z-index: 5;
  animation: kaabahFadeIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  pointer-events: none;
}

.kaabah-aligned-overlay.hidden {
  display: none;
}

@keyframes kaabahFadeIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}

.kaabah-overlay-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  animation: kaabahPulse 2s ease-in-out infinite;
  filter: drop-shadow(0 0 20px rgba(201, 168, 76, 0.6));
}

@keyframes kaabahPulse {
  0%, 100% { filter: drop-shadow(0 0 16px rgba(201, 168, 76, 0.5)); }
  50%       { filter: drop-shadow(0 0 30px rgba(201, 168, 76, 0.9)); }
}

.kaabah-aligned-text {
  margin-top: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #00d26a;
  text-shadow: 0 0 12px rgba(0, 210, 106, 0.5);
  text-align: center;
}

/* ============================================
   ISLAMIC TOOLS MODAL
   ============================================ */

.islamic-tools-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.islamic-tools-modal.hidden {
  display: none;
}

.islamic-tools-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.islamic-tools-sheet {
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, rgba(26,58,42,0.98), rgba(13,31,22,0.98));
  border-radius: 28px 28px 0 0;
  padding: 12px 20px 40px;
  width: 100%;
  max-width: 480px;
  border: 1px solid rgba(201,168,76,0.2);
  border-bottom: none;
  box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
  animation: toolsSheetIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes toolsSheetIn {
  from { transform: translateY(100%); opacity: 0.6; }
  to   { transform: translateY(0);    opacity: 1; }
}

.islamic-tools-handle {
  width: 44px;
  height: 5px;
  background: rgba(201,168,76,0.35);
  border-radius: 4px;
  margin: 0 auto 16px;
}

.islamic-tools-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  margin-bottom: 20px;
}

.islamic-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.islamic-tool-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(201,168,76,0.15);
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: toolItemIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.islamic-tool-item:nth-child(1) { animation-delay: 0.05s; }
.islamic-tool-item:nth-child(2) { animation-delay: 0.12s; }
.islamic-tool-item:nth-child(3) { animation-delay: 0.19s; }

@keyframes toolItemIn {
  from { opacity: 0; transform: translateY(30px) scale(0.8); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.islamic-tool-item:active {
  background: rgba(201,168,76,0.15);
  transform: scale(0.93);
}

.islamic-tool-icon {
  font-size: 2rem;
  line-height: 1;
}

.islamic-tool-name {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: center;
  line-height: 1.3;
}

/* ============================================
   ISLAMIC TOOLS PAGE (side-by-side buttons)
   ============================================ */



[data-theme="light"] .islamic-tools-page-btn {
  background: var(--bg-card);
  border-color: var(--border);
}

[data-theme="light"] .islamic-tools-page-btn:active {
  background: var(--bg-card2);
  border-color: var(--gold);
}

/* ============================================
   SLEEP & MORNING DHIKR TABS
   ============================================ */

.dhikr-times-tabs {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.dhikr-time-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 8px;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: 'Cairo', sans-serif;
}

.dhikr-time-tab.active {
  color: var(--gold);
  background: rgba(201,168,76,0.12);
  border-color: rgba(201,168,76,0.3);
  box-shadow: 0 0 16px rgba(201,168,76,0.1);
}

.dhikr-time-content {
  padding: 0 4px;
  display: block;
}

.dhikr-time-content.hidden {
  display: none !important;
}

/* ============================================
   TASBIH BEAD MODE
   ============================================ */

.tasbih-bead-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  gap: 12px;
  width: 100%;
}

.tasbih-string {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
  max-height: 380px;
  overflow: hidden;
}

.tasbih-bead {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e8c76a, #b8860b);
  border: 2px solid rgba(255,215,0,0.8);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4), inset 0 1px 3px rgba(255,255,255,0.4);
  position: relative;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
  flex-shrink: 0;
}

.tasbih-bead::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transform: translate(-50%, -50%);
}

.tasbih-bead.used {
  background: radial-gradient(circle at 35% 35%, #5a4a20, #3a2a10);
  border-color: rgba(150,120,60,0.5);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  opacity: 0.5;
}

.tasbih-bead.pulling {
  animation: beadPull 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: radial-gradient(circle at 35% 35%, #ffd700, #daa520);
  border-color: #ffd700;
  box-shadow: 0 0 15px rgba(255,215,0,0.5), inset 0 1px 3px rgba(255,255,255,0.5);
}

@keyframes beadPull {
  0%   { transform: scale(1) translateY(0); }
  30%  { transform: scale(1.25) translateY(-8px); }
  60%  { transform: scale(0.9) translateY(4px); }
  100% { transform: scale(1) translateY(0); }
}

.tasbih-string-line {
  width: 3px;
  height: 10px;
  background: linear-gradient(to bottom, rgba(201,168,76,0.5), rgba(201,168,76,0.2));
  flex-shrink: 0;
}

.tasbih-bead-count-display {
  font-size: 2.4rem;
  font-weight: 800;
  color: var(--gold);
  font-family: 'Amiri', serif;
  text-align: center;
  text-shadow: 0 0 20px rgba(201,168,76,0.4);
}

.tasbih-bead-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.tasbih-bead-phase-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 4px;
}

.tasbih-bead-tap-area {
  width: 100%;
  min-height: 160px;
  border-radius: 24px;
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(201,168,76,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.tasbih-bead-tap-area:active {
  background: rgba(201,168,76,0.06);
  transform: scale(0.97);
}

/* Main Tasbih counter click flash */
.tasbih-click-flash {
  animation: tasbihFlash 0.3s ease !important;
}

@keyframes tasbihFlash {
  0% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.6); transform: scale(1); }
  50% { box-shadow: 0 0 30px 10px rgba(201, 168, 76, 0.3); transform: scale(0.97); }
  100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0); transform: scale(1); }
}

/* ============================================
   ENHANCED iOS 26 NAVIGATION ANIMATIONS
   ============================================ */

/* Override the page transitions when iOS26 mode active */
body.ios26-nav .page {
  transition:
    opacity 0.42s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.42s cubic-bezier(0.4, 0, 0.2, 1),
    filter 0.42s ease;
}

body.ios26-nav .page.active {
  transition:
    opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.42s ease;
  transition-delay: 0.03s;
}

/* Enhanced tab indicator — glowing underline on active iOS26 tab */
body.ios26-nav .nav-btn {
  position: relative;
  overflow: hidden;
}

body.ios26-nav .nav-btn::before {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--gold);
  border-radius: 2px;
  transform: translateX(-50%);
  transition: width 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
  opacity: 0;
  box-shadow: 0 0 8px var(--gold);
}

body.ios26-nav .nav-btn.active::before {
  width: 24px;
  opacity: 1;
}

/* Ripple on tap */
body.ios26-nav .nav-btn.tapped {
  animation: navTapRipple 0.4s ease forwards;
}

@keyframes navTapRipple {
  0%   { background: rgba(201,168,76,0.0); }
  30%  { background: rgba(201,168,76,0.18); }
  100% { background: rgba(201,168,76,0.0); }
}

/* Spring-physics tab switch: exiting page slides away with scale */
body.ios26-nav .page:not(.active) {
  transform: translateX(50px) scale(0.93) translateZ(-30px);
  filter: blur(3px) brightness(0.7);
}

body.lang-en.ios26-nav .page:not(.active) {
  transform: translateX(-50px) scale(0.93) translateZ(-30px);
}

/* ============================================
   QUOTE ANIMATION ENHANCEMENTS
   ============================================ */











/* ============================================
   DHIKR-TIMES NAV LANG VISIBILITY
   ============================================ */
.dhikr-time-tab .ar { display: inline; }
.dhikr-time-tab .en { display: none; }
body.lang-en .dhikr-time-tab .en { display: inline; }
body.lang-en .dhikr-time-tab .ar { display: none; }

.islamic-tool-name .ar { display: inline; }
.islamic-tool-name .en { display: none; }
body.lang-en .islamic-tool-name .en { display: inline; }
body.lang-en .islamic-tool-name .ar { display: none; }

.float-ai-label { display: none; }
.float-ai-label.ar { display: inline; }
body.lang-en .float-ai-label.ar { display: none; }
body.lang-en .float-ai-label.en { display: inline; }

.kaabah-aligned-text .ar { display: inline; }
.kaabah-aligned-text .en { display: none; }
body.lang-en .kaabah-aligned-text .en { display: inline; }
body.lang-en .kaabah-aligned-text .ar { display: none; }


/* ============================================
   AI VOICE PANEL
   ============================================ */

.ai-voice-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.ai-voice-modal.hidden {
  display: none;
}

.ai-voice-backdrop {
  position: absolute;
  top: -100vh;
  left: -100vw;
  right: -100vw;
  bottom: -100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  animation: aiVoiceFadeIn 0.25s ease;
}

@keyframes aiVoiceFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ai-voice-sheet {
  position: relative;
  width: 100%;
  max-width: 500px;
  max-height: 85dvh;
  background: var(--bg-primary);
  border-radius: 24px 24px 0 0;
  border-top: 2px solid var(--border-strong);
  display: flex;
  flex-direction: column;
  animation: aiVoiceSlideUp 0.35s cubic-bezier(0.2, 0.9, 0.4, 1);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
}

.ai-voice-sheet.closing {
  transform: translateY(100%);
}

.ai-voice-sheet.closing .ai-voice-backdrop {
  opacity: 0;
  transition: opacity 0.25s ease;
}

@keyframes aiVoiceSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.ai-voice-handle {
  width: 40px;
  height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  margin: 10px auto 0;
  cursor: grab;
  flex-shrink: 0;
}

.ai-voice-handle:active {
  cursor: grabbing;
}

.ai-voice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ai-voice-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.ai-voice-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent-gold-dim) 0%, var(--accent-gold) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.ai-voice-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ai-voice-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.2;
}

.ai-voice-status-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.2;
  min-height: 1.2rem;
}

.ai-voice-offline-notice {
  font-size: 0.8rem;
  color: var(--gold);
  text-align: center;
  padding: 8px 12px;
  background: rgba(201, 168, 76, 0.1);
  border: 1px solid rgba(201, 168, 76, 0.25);
  border-radius: 12px;
  margin: 8px auto;
  max-width: 80%;
}

.ai-voice-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}

.ai-voice-close:active {
  color: var(--text-primary);
  background: var(--ring-bg);
}

.ai-voice-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.ai-voice-body::-webkit-scrollbar {
  width: 4px;
}

.ai-voice-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.ai-voice-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.ai-voice-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.ai-voice-msg.user {
  flex-direction: row-reverse;
}

.ai-voice-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}

.ai-voice-msg-avatar.bot {
  background: linear-gradient(135deg, var(--accent-gold-dim) 0%, var(--accent-gold) 100%);
  color: var(--bg-primary);
}

.ai-voice-msg-avatar.user {
  background: var(--bg-card2);
  color: var(--text-secondary);
}

.ai-voice-msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-break: break-word;
}

.ai-voice-msg-bubble.bot {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.ai-voice-msg-bubble.user {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
  color: white;
  border-bottom-right-radius: 4px;
}

.ai-voice-msg-bubble.loading {
  opacity: 0.7;
}

.ai-voice-visualizer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 60px;
  flex-shrink: 0;
}

.ai-voice-visualizer.hidden {
  display: none;
}

.ai-voice-bar {
  width: 6px;
  height: 20px;
  background: var(--accent-gold);
  border-radius: 3px;
  transition: transform 0.1s ease;
  opacity: 0.3;
}

.ai-voice-modal.listening .ai-voice-bar {
  opacity: 1;
  animation: aiVoiceBarBounce 0.6s ease-in-out infinite;
}

.ai-voice-bar:nth-child(1) { animation-delay: 0s; }
.ai-voice-bar:nth-child(2) { animation-delay: 0.08s; }
.ai-voice-bar:nth-child(3) { animation-delay: 0.16s; }
.ai-voice-bar:nth-child(4) { animation-delay: 0.24s; }
.ai-voice-bar:nth-child(5) { animation-delay: 0.32s; }

@keyframes aiVoiceBarBounce {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1.8); }
}

.ai-voice-error {
  color: #ff6b6b;
  font-size: 0.85rem;
  text-align: center;
  min-height: 1.2rem;
  padding: 0 8px;
}

.ai-voice-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  gap: 16px;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
}

.ai-voice-mic-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold) 0%, var(--accent-gold-dim) 100%);
  border: 2px solid var(--border-strong);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.ai-voice-mic-btn:active {
  transform: scale(0.92);
}

.ai-voice-mic-btn.listening {
  animation: aiVoicePulse 1.5s ease-in-out infinite;
}

@keyframes aiVoicePulse {
  0% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0.4); }
  70% { box-shadow: 0 0 0 20px rgba(201, 168, 76, 0); }
  100% { box-shadow: 0 0 0 0 rgba(201, 168, 76, 0); }
}

.ai-voice-action-btn {
  width: 48px;

  height: 48px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  flex-shrink: 0;
}

.ai-voice-action-btn:active {
  transform: scale(0.92);
  background: var(--bg-card2);
}

.ai-voice-action-btn.hidden,
.ai-voice-send-btn.hidden {
  display: none;
}

.ai-voice-send-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, opacity 0.2s;
  flex-shrink: 0;
  animation: aiVoiceFadeIn 0.2s ease;
}

.ai-voice-send-btn:active {
  transform: scale(0.92);
}

/* Processing spinner */
.ai-voice-processing {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 0;
}

.ai-voice-processing.hidden {
  display: none;
}

.ai-voice-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: aiVoiceSpin 0.8s linear infinite;
}

@keyframes aiVoiceSpin {
  to { transform: rotate(360deg); }
}

/* Typing dots for loading state */
.ai-voice-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 0;
}

.ai-voice-typing.hidden {
  display: none;
}

.ai-voice-typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-gold);
  animation: aiVoiceTypingDot 1.2s ease-in-out infinite;
}

.ai-voice-typing-dot:nth-child(1) { animation-delay: 0s; }
.ai-voice-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.ai-voice-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes aiVoiceTypingDot {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Dark mode adjustments for error */
.ai-voice-error a {
  color: var(--accent-gold);
  text-decoration: underline;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .ai-voice-sheet,
  .ai-voice-mic-btn.listening,
  .ai-voice-bar,
  .ai-voice-typing-dot,
  .ai-voice-spinner {
    animation: none;
    transition: none;
  }
  .ai-voice-backdrop {
    animation: none;
  }
}

/* ============================================
   AI CHAT LANGUAGE TOGGLE BUTTON
   ============================================ */

.ai-chat-lang-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-gold);
  cursor: pointer;
  transition: transform 0.15s, background 0.15s, border-color 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  line-height: 1;
}

.ai-chat-lang-btn:active {
  transform: scale(0.92);
  background: var(--bg-card2);
  border-color: var(--accent-gold);
}

.ai-chat-lang-btn .ar-label,
.ai-chat-lang-btn .en-label {
  display: none;
}

body.lang-ar .ai-chat-lang-btn .ar-label { display: inline; }
body.lang-en .ai-chat-lang-btn .en-label { display: inline; }

/* ============================================
   DUAS PAGE FIX
   ============================================ */

.duas-page-grid, .islamic-tools-page-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 1rem;
  align-items: stretch;
}

.duas-page-btn, .islamic-tools-page-btn {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  padding: 1.5rem 1.2rem;
  background: rgba(18, 26, 21, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  cursor: pointer;
  text-align: right;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  width: 100%;
  margin-bottom: 12px;
}

.duas-page-btn::before, .islamic-tools-page-btn::before {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l2.5 25L55 30l-22.5 2.5L30 60l-2.5-27.5L5 30l22.5-2.5z' fill='%23C9A84C' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-size: 80px 80px;
  opacity: 0.6;
  z-index: 0;
  transition: opacity 0.3s;
  -webkit-mask-image: linear-gradient(to left, black 20%, transparent 90%);
  mask-image: linear-gradient(to left, black 20%, transparent 90%);
}

[dir="ltr"] .duas-page-btn::before, [dir="ltr"] .islamic-tools-page-btn::before {
  -webkit-mask-image: linear-gradient(to right, black 20%, transparent 90%);
  mask-image: linear-gradient(to right, black 20%, transparent 90%);
}

.duas-page-btn > *, .islamic-tools-page-btn > * {
  position: relative;
  z-index: 1;
}
.duas-page-btn:hover, .islamic-tools-page-btn:hover {
  transform: translateY(-2px);
  background: rgba(28, 40, 32, 0.8);
  border-color: rgba(201, 168, 76, 0.3);
  box-shadow: 0 8px 24px rgba(201, 168, 76, 0.15);
}

/* Duas Tabs */
.duas-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 24px;
  background: rgba(18, 26, 21, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.duas-tab {
  flex: 1;
  padding: 16px 20px;
  background: transparent;
  border: none;
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  text-align: center;
}

.duas-tab.active {
  background: rgba(201, 168, 76, 0.2);
  color: var(--gold);
  box-shadow: 0 2px 8px rgba(201, 168, 76, 0.2);
  border: 1px solid rgba(201, 168, 76, 0.3);
}

.duas-tab:hover:not(.active) {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

/* Duas Content Sections */
.duas-content {
  display: none;
  animation: duasFadeIn 0.4s ease;
}

.duas-content.active {
  display: block;
}

/* Make duas tab scrollable with visible scrollbar */
#duasContentDuas {
  overflow-y: auto;
  overflow-x: hidden;
  max-height: calc(100vh - 180px);
}

@keyframes duasFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
} box-shadow: 0 8px 24px rgba(201, 168, 76, 0.15);
}

.duas-page-btn:hover::before, .islamic-tools-page-btn:hover::before {
  opacity: 1;
}

.duas-page-btn:active, .islamic-tools-page-btn:active {
  transform: translateY(2px) scale(0.98);
  box-shadow: 0 4px 12px rgba(201, 168, 76, 0.1);
}

[data-theme="light"] .duas-page-btn, .islamic-tools-page-btn {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .duas-page-btn::before, .islamic-tools-page-btn::before {
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0l2.5 25L55 30l-22.5 2.5L30 60l-2.5-27.5L5 30l22.5-2.5z' fill='%23C9A84C' fill-opacity='0.06' fill-rule='evenodd'/%3E%3C/svg%3E");
}

[data-theme="light"] .duas-page-btn:hover, .islamic-tools-page-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(201, 168, 76, 0.4);
  box-shadow: 0 8px 24px rgba(201, 168, 76, 0.2);
}

.duas-page-btn .islamic-tools-page-icon, .islamic-tools-page-btn .islamic-tools-page-icon {
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--gold), #f3e5ab);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 8px rgba(201,168,76,0.3));
  flex-shrink: 0;
}

.duas-page-text-wrap, .islamic-tools-page-text-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
  text-align: right;
  flex: 1;
}

[dir="ltr"] .duas-page-text-wrap, .islamic-tools-page-text-wrap {
  align-items: flex-start;
  text-align: left;
}

.duas-page-btn .islamic-tools-page-name, .islamic-tools-page-btn .islamic-tools-page-name {
  font-family: 'Amiri', serif;
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 0;
}

.duas-page-btn .islamic-tools-page-desc, .islamic-tools-page-btn .islamic-tools-page-desc {
  font-size: 0.95rem;
  color: var(--text-primary);
  opacity: 0.75;
}

#page-duas {
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Scrollbar for Duas tab only (not Ziyarat) */
#duasContentDuas::-webkit-scrollbar {
  width: 10px;
}

#duasContentDuas::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

#duasContentDuas::-webkit-scrollbar-thumb {
  background: var(--gold);
  border-radius: 10px;
  border: 2px solid var(--bg-primary);
}

#duasContentDuas::-webkit-scrollbar-thumb:hover {
  background: var(--gold-light);
}

#page-duas::before, #page-islamic-tools::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: 
    radial-gradient(circle at 15% 20%, rgba(201, 168, 76, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(45, 140, 94, 0.06) 0%, transparent 40%),
    url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 0l2.5 17.5L40 20l-17.5 2.5L20 40l-2.5-17.5L0 20l17.5-2.5z' fill='%23C9A84C' fill-opacity='0.02' fill-rule='evenodd'/%3E%3C/svg%3E");
  background-size: 100% 100%, 100% 100%, 80px 80px;
  animation: duasSpiritualBreathe 15s ease-in-out infinite alternate;
  pointer-events: none;
  z-index: -1;
}

[data-theme="light"] #page-duas, [data-theme="light"] #page-islamic-tools {
  background: linear-gradient(135deg, #ffffff 0%, #f4f7f5 100%) !important;
}

[data-theme="light"] #page-duas::before, [data-theme="light"] #page-islamic-tools::before {
  background: 
    radial-gradient(circle at 20% 30%, rgba(201, 168, 76, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(45, 140, 94, 0.12) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 0l2.5 17.5L40 20l-17.5 2.5L20 40l-2.5-17.5L0 20l17.5-2.5z' fill='%23C9A84C' fill-opacity='0.04' fill-rule='evenodd'/%3E%3C/svg%3E");
}

@keyframes duasSpiritualBreathe {
  0% { transform: scale(1) translate(0, 0) rotate(0deg); opacity: 0.6; }
  50% { transform: scale(1.1) translate(-2%, 2%) rotate(2deg); opacity: 0.8; }
  100% { transform: scale(1) translate(2%, -2%) rotate(-1deg); opacity: 1; }
}

/* ====== FATIMA BIRTH THEME ====== */
body[data-theme-event="fatima_birth"] {
  --bg-primary: #1a0a0f !important;
  --bg-secondary: #261118 !important;
  --bg-card: #2e141c !important;
  --bg-card2: #381a24 !important;
  --bg-nav: #0f0508 !important;
  --text-primary: #f5ebef !important;
  --text-secondary: #c9a3b0 !important;
  --text-muted: #94717e !important;
  --gold: #b36b85 !important;
  --gold-light: #e68cb0 !important;
  --gold-dim: #663d4c !important;
  --accent: #995c73 !important;
  --accent-light: #cc7a99 !important;
  --accent-glow: rgba(153, 92, 115, 0.15) !important;
}
body[data-theme-event="fatima_birth"] .app-container::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 1;
  background: 
    radial-gradient(ellipse at 20% 0%, rgba(230, 140, 176, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 0%, rgba(200, 100, 140, 0.06) 0%, transparent 50%);
  animation: sadPulse 4s ease-in-out infinite;
}
body[data-theme-event="fatima_birth"] .nav-btn.active {
  color: #e68cb0 !important;
  text-shadow: 0 0 10px rgba(230, 140, 176, 0.4) !important;
}
body[data-theme-event="fatima_birth"] .bottom-nav {
  border-top: 1px solid rgba(153, 92, 115, 0.3) !important;
}

/* ====== MARTYRDOM THEME ====== */
body[data-theme-event="martyrdom"] {
  --bg-primary: #050508 !important;
  --bg-secondary: #0a0a12 !important;
  --bg-card: #0f0f18 !important;
  --bg-card2: #141420 !important;
  --bg-nav: #020205 !important;
  --text-primary: #e0e0e5 !important;
  --text-secondary: #8c8c99 !important;
  --text-muted: #666673 !important;
  --gold: #6b6b80 !important;
  --gold-light: #8c8ca6 !important;
  --gold-dim: #3d3d4c !important;
  --accent: #4a4a5c !important;
  --accent-light: #606078 !important;
  --accent-glow: rgba(74, 74, 92, 0.15) !important;
}
body[data-theme-event="martyrdom"] .app-container::before {
  content: "";
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 1;
  background: 
    radial-gradient(ellipse at 50% 0%, rgba(40, 40, 50, 0.2) 0%, transparent 60%),
    radial-gradient(ellipse at 50% 100%, rgba(30, 30, 40, 0.15) 0%, transparent 50%);
  animation: sadPulse 6s ease-in-out infinite;
}
body[data-theme-event="martyrdom"] .bottom-nav {
  border-top: 1px solid rgba(74, 74, 92, 0.3) !important;
}
body[data-theme-event="martyrdom"] .nav-btn.active {
  color: #8c8ca6 !important;
}

/* Update 3.1: Premium Qibla GPS Buttons */
.qibla-location-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  width: 100%;
}
.qibla-location-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 600;
}
.qibla-location-btns {
  display: flex;
  gap: 10px;
  width: 100%;
}
.qibla-loc-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.qibla-loc-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
.qibla-loc-btn.active {
  background: linear-gradient(135deg, var(--gold) 0%, #d4b868 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 15px rgba(201, 168, 76, 0.3);
}
[data-theme="light"] .qibla-loc-btn {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0, 0, 0, 0.08);
  color: #555;
}
[data-theme="light"] .qibla-loc-btn:hover {
  background: rgba(0, 0, 0, 0.06);
}
[data-theme="light"] .qibla-loc-btn.active {
  background: linear-gradient(135deg, #1f6443 0%, #2d8c5e 100%);
  color: #ffffff;
  box-shadow: 0 4px 15px rgba(31, 100, 67, 0.4);
}

/* 
   THE 14 INFALLIBLES THEME ENGINE (v3.1) - HAND CRAFTED EDITION
   ═══════════════════════════════════════════════════════════════ */

/* 2. Imam Ali (Martyrdom) - Dark Gold & Black */
body[data-theme-event="wafat_ali"],
body[data-theme-event="ali_death"] {
  --bg-primary: #0f0f0f !important;
  --bg-secondary: #141414 !important;
  --bg-card: #1c1a17 !important;
  --bg-card2: #26231e !important;
  --bg-nav: #080808 !important;
  --text-primary: #f7f2e8 !important;
  --text-secondary: #d4c8ae !important;
  --text-muted: #9e9177 !important;
  --gold: #d4af37 !important;
  --gold-light: #f7dd86 !important;
  --gold-dim: #8a711c !important;
  --accent: #b01515 !important;
  --accent-light: #e63939 !important;
  --accent-glow: rgba(176, 21, 21, 0.25) !important;
  --border: rgba(212, 175, 55, 0.3) !important;
  --border-strong: rgba(212, 175, 55, 0.6) !important;
  --prayer-active-bg: linear-gradient(135deg, #1c1a17, #d4af37) !important;
  background: 
    linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(0, 0, 0, 0) 60%),
    repeating-linear-gradient(45deg, rgba(0,0,0,0.2) 0px, rgba(0,0,0,0.2) 2px, transparent 2px, transparent 4px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 1px, transparent 1px, transparent 3px),
    linear-gradient(to bottom, #111111, #050505) !important;
}
/* 3. Lady Fatima (Birth) - Rose Gold & Soft Pink */
body[data-theme-event="fatima_birth"] {
  --bg-primary: #260c18 !important;
  --bg-secondary: #361324 !important;
  --bg-card: #451b2f !important;
  --bg-card2: #5c2741 !important;
  --bg-nav: #1c0812 !important;
  --text-primary: #fff0f7 !important;
  --text-secondary: #e8b3cb !important;
  --text-muted: #b87a98 !important;
  --gold: #e6a8c4 !important;
  --gold-light: #ffc9e2 !important;
  --gold-dim: #8f5871 !important;
  --accent: #d9488b !important;
  --accent-light: #ff6eb0 !important;
  --accent-glow: rgba(217, 72, 139, 0.25) !important;
  --border: rgba(217, 72, 139, 0.3) !important;
  --border-strong: rgba(230, 168, 196, 0.5) !important;
  --prayer-active-bg: linear-gradient(135deg, #992e60, #d9488b) !important;
  background: linear-gradient(135deg, #1c0812, #361324) !important;
}

/* 3. Lady Fatima (Martyrdom) - Dark Brown & Ash (The Door) */
body[data-theme-event="fatima_death"] {
  --bg-primary: #171210 !important;
  --bg-secondary: #29201d !important;
  --bg-card: #3d2e29 !important;
  --bg-card2: #523d37 !important;
  --bg-nav: #0d0a09 !important;
  --text-primary: #f7eee8 !important;
  --text-secondary: #ccaba3 !important;
  --text-muted: #99736c !important;
  --gold: #8c5e58 !important;
  --gold-light: #b3827b !important;
  --gold-dim: #523430 !important;
  --accent: #a66961 !important;
  --accent-light: #d9948c !important;
  --accent-glow: #a6696166 !important;
  --border: #a669614d !important;
  --border-strong: #a6696199 !important;
  --prayer-active-bg: linear-gradient(135deg, #3d2e29 0%, #523d37 100%) !important;
  background: linear-gradient(135deg, #171210 0%, #29201d 100%) !important;
}

/* 4. Imam Hassan (Birth) - Vibrant Spring Green */
body[data-theme-event="hassan_birth"] {
  --bg-primary: #0a1f0a !important;
  --bg-secondary: #0f2e0f !important;
  --bg-card: #154015 !important;
  --bg-card2: #1e591e !important;
  --bg-nav: #051405 !important;
  --text-primary: #ecffec !important;
  --text-secondary: #a3e6a3 !important;
  --text-muted: #6bbf6b !important;
  --gold: #5ce65c !important;
  --gold-light: #8cff8c !important;
  --gold-dim: #2a802a !important;
  --accent: #33cc33 !important;
  --accent-light: #5cd65c !important;
  --accent-glow: rgba(51, 204, 51, 0.25) !important;
  --border: rgba(51, 204, 51, 0.3) !important;
  --border-strong: rgba(92, 230, 92, 0.5) !important;
  --prayer-active-bg: linear-gradient(135deg, #1f8c1f, #33cc33) !important;
  background: linear-gradient(135deg, #051405, #0f2e0f) !important;
}

/* 4. Imam Hassan (Martyrdom) - Toxic Moss Green & Black */
body[data-theme-event="hassan_death"] {
  --bg-primary: #0b140d !important;
  --bg-secondary: #132417 !important;
  --bg-card: #1d3623 !important;
  --bg-card2: #28472e !important;
  --bg-nav: #060a06 !important;
  --text-primary: #eaf5ed !important;
  --text-secondary: #97c7a5 !important;
  --text-muted: #5a8c69 !important;
  --gold: #4b7556 !important;
  --gold-light: #6d9c79 !important;
  --gold-dim: #2b4733 !important;
  --accent: #386644 !important;
  --accent-light: #5c996d !important;
  --accent-glow: #38664466 !important;
  --border: #3866444d !important;
  --border-strong: #38664499 !important;
  --prayer-active-bg: linear-gradient(135deg, #1d3623 0%, #28472e 100%) !important;
  background: linear-gradient(135deg, #0b140d 0%, #132417 100%) !important;
}

/* 5. Imam Hussain (Birth) - Glorious Royal Azure */
body[data-theme-event="hussain_birth"] {
  --bg-primary: #04092b !important;
  --bg-secondary: #071140 !important;
  --bg-card: #0a1957 !important;
  --bg-card2: #0f257a !important;
  --bg-nav: #02051a !important;
  --text-primary: #ebf0ff !important;
  --text-secondary: #a3baff !important;
  --text-muted: #6688e6 !important;
  --gold: #d4a73f !important;
  --gold-light: #fce495 !important;
  --gold-dim: #8a691f !important;
  --accent: #3b5ced !important;
  --accent-light: #6a85ff !important;
  --accent-glow: rgba(59, 92, 237, 0.3) !important;
  --border: rgba(59, 92, 237, 0.3) !important;
  --border-strong: rgba(212, 167, 63, 0.5) !important;
  --prayer-active-bg: linear-gradient(135deg, #223a9e, #3b5ced) !important;
  background: linear-gradient(135deg, #02051a, #071140) !important;
}

/* 5. Imam Hussain (Ashura) - Deep Blood Red */
body[data-theme-event="ashura"] {
  --bg-primary: #150000 !important;
  --bg-secondary: #2b0000 !important;
  --bg-card: #3d0000 !important;
  --bg-card2: #520000 !important;
  --bg-nav: #0a0000 !important;
  --text-primary: #ffcccc !important;
  --text-secondary: #ff9999 !important;
  --text-muted: #cc6666 !important;
  --gold: #ff0000 !important;
  --gold-light: #ff3333 !important;
  --gold-dim: #800000 !important;
  --accent: #b30000 !important;
  --accent-light: #ff1a1a !important;
  --accent-glow: rgba(255, 0, 0, 0.4) !important;
  --border: rgba(255, 0, 0, 0.3) !important;
  --border-strong: rgba(255, 0, 0, 0.6) !important;
  --prayer-active-bg: linear-gradient(135deg, #3d0000 0%, #520000 100%) !important;
  background: linear-gradient(135deg, #0a0000 0%, #150000 100%) !important;
}ht: #ea1e1e !important;
  --accent-glow: rgba(204, 0, 0, 0.2) !important;
  --border: rgba(204, 0, 0, 0.25) !important;
  --border-strong: rgba(204, 0, 0, 0.4) !important;
  --prayer-active-bg: linear-gradient(135deg, #ae0000, #cc0000) !important;
  background-image: none !important;
}

/* 6. Imam Sajjad (Birth) - Teal & Gold Gradient */
body[data-theme-event="sajjad_birth"] {
  --bg-primary: #041414 !important;
  --bg-secondary: #082424 !important;
  --bg-card: #0c3333 !important;
  --bg-card2: #104242 !important;
  --bg-nav: #020a0a !important;
  --text-primary: #e6f7f7 !important;
  --text-secondary: #b3e0e0 !important;
  --text-muted: #7aa3a3 !important;
  --gold: #d4b83f !important;
  --gold-light: #fce47c !important;
  --gold-dim: #8a741f !important;
  --accent: #27b3b3 !important;
  --accent-light: #45e6e6 !important;
  --accent-glow: rgba(39, 179, 179, 0.25) !important;
  --border: rgba(39, 179, 179, 0.3) !important;
  --border-strong: rgba(212, 184, 63, 0.5) !important;
  --prayer-active-bg: linear-gradient(135deg, #187373, #27b3b3) !important;
  background: linear-gradient(135deg, #020a0a, #082424) !important;
}

/* 6. Imam Sajjad (Martyrdom) - Dark Slate & Silver */
body[data-theme-event="sajjad_death"] {
  --bg-primary: #0b1214 !important;
  --bg-secondary: #132024 !important;
  --bg-card: #1c2f36 !important;
  --bg-card2: #263e47 !important;
  --bg-nav: #060a0b !important;
  --text-primary: #e7f3f5 !important;
  --text-secondary: #93b5bd !important;
  --text-muted: #5e828a !important;
  --gold: #497682 !important;
  --gold-light: #69a0b0 !important;
  --gold-dim: #274752 !important;
  --accent: #3b6975 !important;
  --accent-light: #599db0 !important;
  --accent-glow: #3b697566 !important;
  --border: #3b69754d !important;
  --border-strong: #3b697599 !important;
  --prayer-active-bg: linear-gradient(135deg, #1c2f36 0%, #263e47 100%) !important;
  background: linear-gradient(135deg, #0b1214 0%, #132024 100%) !important;
}

/* 7. Imam Baqir (Birth) - Deep Indigo & Bright Yellow */
body[data-theme-event="baqir_birth"] {
  --bg-primary: #0e051c !important;
  --bg-secondary: #17092e !important;
  --bg-card: #200d40 !important;
  --bg-card2: #2c1257 !important;
  --bg-nav: #07030f !important;
  --text-primary: #f4ebff !important;
  --text-secondary: #d6b3ff !important;
  --text-muted: #a170d9 !important;
  --gold: #ebd636 !important;
  --gold-light: #fff282 !important;
  --gold-dim: #9c8b1a !important;
  --accent: #9042f5 !important;
  --accent-light: #b070ff !important;
  --accent-glow: rgba(144, 66, 245, 0.3) !important;
  --border: rgba(144, 66, 245, 0.3) !important;
  --border-strong: rgba(235, 214, 54, 0.5) !important;
  --prayer-active-bg: linear-gradient(135deg, #591eab, #9042f5) !important;
  background: linear-gradient(135deg, #07030f, #17092e) !important;
}

/* 7. Imam Baqir (Martyrdom) - Dark Indigo & Gray */
body[data-theme-event="baqir_death"] {
  --bg-primary: #0e0b17 !important;
  --bg-secondary: #181329 !important;
  --bg-card: #261c3d !important;
  --bg-card2: #352752 !important;
  --bg-nav: #07050d !important;
  --text-primary: #eeeaf5 !important;
  --text-secondary: #a497c4 !important;
  --text-muted: #6a5e8c !important;
  --gold: #6b5894 !important;
  --gold-light: #937bc4 !important;
  --gold-dim: #40335e !important;
  --accent: #5e4b85 !important;
  --accent-light: #8972bf !important;
  --accent-glow: #5e4b8566 !important;
  --border: #5e4b854d !important;
  --border-strong: #5e4b8599 !important;
  --prayer-active-bg: linear-gradient(135deg, #261c3d 0%, #352752 100%) !important;
  background: linear-gradient(135deg, #0e0b17 0%, #181329 100%) !important;
}

/* 8. Imam Sadiq (Birth) - Mint Green & Copper */
body[data-theme-event="sadiq_birth"] {
  --bg-primary: #051a11 !important;
  --bg-secondary: #092b1d !important;
  --bg-card: #0e3d29 !important;
  --bg-card2: #145237 !important;
  --bg-nav: #030f0a !important;
  --text-primary: #e8fff4 !important;
  --text-secondary: #a3ffce !important;
  --text-muted: #62c993 !important;
  --gold: #d68745 !important;
  --gold-light: #fcae6d !important;
  --gold-dim: #874f21 !important;
  --accent: #2bc77e !important;
  --accent-light: #5de3a0 !important;
  --accent-glow: rgba(43, 199, 126, 0.25) !important;
  --border: rgba(43, 199, 126, 0.3) !important;
  --border-strong: rgba(214, 135, 69, 0.5) !important;
  --prayer-active-bg: linear-gradient(135deg, #188a54, #2bc77e) !important;
  background: linear-gradient(135deg, #030f0a, #092b1d) !important;
}

/* 8. Imam Sadiq (Martyrdom) - Olive Drab & Black */
body[data-theme-event="sadiq_death"] {
  --bg-primary: #12140b !important;
  --bg-secondary: #1f2413 !important;
  --bg-card: #30381d !important;
  --bg-card2: #414d28 !important;
  --bg-nav: #090a06 !important;
  --text-primary: #f0f5ea !important;
  --text-secondary: #a5b58a !important;
  --text-muted: #6f8252 !important;
  --gold: #748256 !important;
  --gold-light: #9cad77 !important;
  --gold-dim: #475232 !important;
  --accent: #647347 !important;
  --accent-light: #90a667 !important;
  --accent-glow: #64734766 !important;
  --border: #6473474d !important;
  --border-strong: #64734799 !important;
  --prayer-active-bg: linear-gradient(135deg, #30381d 0%, #414d28 100%) !important;
  background: linear-gradient(135deg, #12140b 0%, #1f2413 100%) !important;
}

/* 9. Imam Kadhim (Birth) - Deep Purple & Rich Gold */
body[data-theme-event="kadhim_birth"] {
  --bg-primary: #160324 !important;
  --bg-secondary: #25063d !important;
  --bg-card: #350857 !important;
  --bg-card2: #480c75 !important;
  --bg-nav: #0b0112 !important;
  --text-primary: #f8e8ff !important;
  --text-secondary: #e2a8ff !important;
  --text-muted: #af66d4 !important;
  --gold: #e6a72e !important;
  --gold-light: #ffc966 !important;
  --gold-dim: #946513 !important;
  --accent: #ab2bf2 !important;
  --accent-light: #c769f5 !important;
  --accent-glow: rgba(171, 43, 242, 0.3) !important;
  --border: rgba(171, 43, 242, 0.3) !important;
  --border-strong: rgba(230, 167, 46, 0.5) !important;
  --prayer-active-bg: linear-gradient(135deg, #69119c, #ab2bf2) !important;
  background: linear-gradient(135deg, #0b0112, #25063d) !important;
}

/* 9. Imam Kadhim (Martyrdom) - Dark Purple & Ash */
body[data-theme-event="kadhim_death"] {
  --bg-primary: #140814 !important;
  --bg-secondary: #261026 !important;
  --bg-card: #3b183b !important;
  --bg-card2: #522252 !important;
  --bg-nav: #0a040a !important;
  --text-primary: #f5e6f5 !important;
  --text-secondary: #c991c9 !important;
  --text-muted: #8c598c !important;
  --gold: #8c488c !important;
  --gold-light: #b86ab8 !important;
  --gold-dim: #572b57 !important;
  --accent: #853185 !important;
  --accent-light: #bf50bf !important;
  --accent-glow: #85318566 !important;
  --border: #8531854d !important;
  --border-strong: #85318599 !important;
  --prayer-active-bg: linear-gradient(135deg, #3b183b 0%, #522252 100%) !important;
  background: linear-gradient(135deg, #140814 0%, #261026 100%) !important;
}

/* 10. Imam Rida (Birth) - Turquoise & Silver */
body[data-theme-event="rida_birth"] {
  --bg-primary: #041a1c !important;
  --bg-secondary: #072a2e !important;
  --bg-card: #0a3d42 !important;
  --bg-card2: #0f5157 !important;
  --bg-nav: #020d0e !important;
  --text-primary: #e6f9fa !important;
  --text-secondary: #9cedf2 !important;
  --text-muted: #5eacb3 !important;
  --gold: #dbe35d !important;
  --gold-light: #f7ff7a !important;
  --gold-dim: #8b9131 !important;
  --accent: #23c7d6 !important;
  --accent-light: #5ee5f0 !important;
  --accent-glow: rgba(35, 199, 214, 0.25) !important;
  --border: rgba(35, 199, 214, 0.3) !important;
  --border-strong: rgba(219, 227, 93, 0.5) !important;
  --prayer-active-bg: linear-gradient(135deg, #127982, #23c7d6) !important;
  background: linear-gradient(135deg, #020d0e, #072a2e) !important;
}

/* 10. Imam Rida (Martyrdom) - Dark Teal & Gray */
body[data-theme-event="rida_death"] {
  --bg-primary: #091414 !important;
  --bg-secondary: #102626 !important;
  --bg-card: #1a3d3d !important;
  --bg-card2: #245454 !important;
  --bg-nav: #040a0a !important;
  --text-primary: #e8f7f7 !important;
  --text-secondary: #86c2c2 !important;
  --text-muted: #528f8f !important;
  --gold: #468585 !important;
  --gold-light: #67b3b3 !important;
  --gold-dim: #265252 !important;
  --accent: #327373 !important;
  --accent-light: #51abab !important;
  --accent-glow: #32737366 !important;
  --border: #3273734d !important;
  --border-strong: #32737399 !important;
  --prayer-active-bg: linear-gradient(135deg, #1a3d3d 0%, #245454 100%) !important;
  background: linear-gradient(135deg, #091414 0%, #102626 100%) !important;
}

/* 11. Imam Jawad (Birth) - Deep Azure & Radiant Gold */
body[data-theme-event="jawad_birth"] {
  --bg-primary: #030b14 !important;
  --bg-secondary: #051426 !important;
  --bg-card: #081e3b !important;
  --bg-card2: #0b2a52 !important;
  --bg-nav: #01060a !important;
  --text-primary: #e6f1fa !important;
  --text-secondary: #94cbf7 !important;
  --text-muted: #5e95bd !important;
  --gold: #e6b835 !important;
  --gold-light: #ffe57a !important;
  --gold-dim: #947116 !important;
  --accent: #2385e3 !important;
  --accent-light: #5caeff !important;
  --accent-glow: rgba(35, 133, 227, 0.25) !important;
  --border: rgba(35, 133, 227, 0.3) !important;
  --border-strong: rgba(230, 184, 53, 0.5) !important;
  --prayer-active-bg: linear-gradient(135deg, #105599, #2385e3) !important;
  background: linear-gradient(135deg, #01060a, #051426) !important;
}

/* 11. Imam Jawad (Martyrdom) - Dark Blue-Gray */
body[data-theme-event="jawad_death"] {
  --bg-primary: #0b1017 !important;
  --bg-secondary: #121c29 !important;
  --bg-card: #1b2a3d !important;
  --bg-card2: #263b52 !important;
  --bg-nav: #05080d !important;
  --text-primary: #ebf1f7 !important;
  --text-secondary: #8faecc !important;
  --text-muted: #5c7b99 !important;
  --gold: #537599 !important;
  --gold-light: #77a2cc !important;
  --gold-dim: #2b4259 !important;
  --accent: #3d6185 !important;
  --accent-light: #6293c4 !important;
  --accent-glow: #3d618566 !important;
  --border: #3d61854d !important;
  --border-strong: #3d618599 !important;
  --prayer-active-bg: linear-gradient(135deg, #1b2a3d 0%, #263b52 100%) !important;
  background: linear-gradient(135deg, #0b1017 0%, #121c29 100%) !important;
}

/* 12. Imam Hadi (Birth) - Light Coral & Bright White */
body[data-theme-event="hadi_birth"] {
  --bg-primary: #1f0c08 !important;
  --bg-secondary: #33120b !important;
  --bg-card: #4a190f !important;
  --bg-card2: #612113 !important;
  --bg-nav: #0f0604 !important;
  --text-primary: #faece8 !important;
  --text-secondary: #ffb8a6 !important;
  --text-muted: #b87463 !important;
  --gold: #e3d93b !important;
  --gold-light: #fffa85 !important;
  --gold-dim: #8f8719 !important;
  --accent: #ed5f45 !important;
  --accent-light: #ff8c78 !important;
  --accent-glow: rgba(237, 95, 69, 0.25) !important;
  --border: rgba(237, 95, 69, 0.3) !important;
  --border-strong: rgba(227, 217, 59, 0.5) !important;
  --prayer-active-bg: linear-gradient(135deg, #99311f, #ed5f45) !important;
  background: linear-gradient(135deg, #0f0604, #33120b) !important;
}

/* 12. Imam Hadi (Martyrdom) - Dark Rust & Black */
body[data-theme-event="hadi_death"] {
  --bg-primary: #170c08 !important;
  --bg-secondary: #29140d !important;
  --bg-card: #3d1d13 !important;
  --bg-card2: #52271a !important;
  --bg-nav: #0d0604 !important;
  --text-primary: #f7eae6 !important;
  --text-secondary: #cc9787 !important;
  --text-muted: #996252 !important;
  --gold: #8c4b37 !important;
  --gold-light: #b3664d !important;
  --gold-dim: #52281c !important;
  --accent: #993f26 !important;
  --accent-light: #d96443 !important;
  --accent-glow: #993f2666 !important;
  --border: #993f264d !important;
  --border-strong: #993f2699 !important;
  --prayer-active-bg: linear-gradient(135deg, #3d1d13 0%, #52271a 100%) !important;
  background: linear-gradient(135deg, #170c08 0%, #29140d 100%) !important;
}

/* 13. Imam Askari (Birth) - Amber & Warm Bronze */
body[data-theme-event="askari_birth"] {
  --bg-primary: #1f1405 !important;
  --bg-secondary: #332008 !important;
  --bg-card: #472d0a !important;
  --bg-card2: #5c3a0b !important;
  --bg-nav: #0f0a02 !important;
  --text-primary: #fcf6eb !important;
  --text-secondary: #ffcd80 !important;
  --text-muted: #b88e4b !important;
  --gold: #e34c14 !important;
  --gold-light: #ff7847 !important;
  --gold-dim: #8f2905 !important;
  --accent: #f09e13 !important;
  --accent-light: #ffbc4a !important;
  --accent-glow: rgba(240, 158, 19, 0.25) !important;
  --border: rgba(240, 158, 19, 0.3) !important;
  --border-strong: rgba(227, 76, 20, 0.5) !important;
  --prayer-active-bg: linear-gradient(135deg, #996000, #f09e13) !important;
  background: linear-gradient(135deg, #0f0a02, #332008) !important;
}

/* 13. Imam Askari (Martyrdom) - Burnt Orange & Charcoal */
body[data-theme-event="askari_death"] {
  --bg-primary: #171008 !important;
  --bg-secondary: #291b0c !important;
  --bg-card: #3d2813 !important;
  --bg-card2: #543618 !important;
  --bg-nav: #0d0905 !important;
  --text-primary: #f7efe6 !important;
  --text-secondary: #cfa984 !important;
  --text-muted: #9e754d !important;
  --gold: #8f6236 !important;
  --gold-light: #ba8551 !important;
  --gold-dim: #52351a !important;
  --accent: #9c5a20 !important;
  --accent-light: #d6853a !important;
  --accent-glow: #9c5a2066 !important;
  --border: #9c5a204d !important;
  --border-strong: #9c5a2099 !important;
  --prayer-active-bg: linear-gradient(135deg, #3d2813 0%, #543618 100%) !important;
  background: linear-gradient(135deg, #171008 0%, #291b0c 100%) !important;
}

/* 14. Imam Mahdi (Birth) - Pure Radiant Gold & White */
body[data-theme-event="mahdi_birth"] {
  --bg-primary: #141412 !important;
  --bg-secondary: #21211d !important;
  --bg-card: #2e2e28 !important;
  --bg-card2: #3d3d34 !important;
  --bg-nav: #0a0a09 !important;
  --text-primary: #ffffff !important;
  --text-secondary: #e6e6cc !important;
  --text-muted: #a3a38b !important;
  --gold: #ffd700 !important;
  --gold-light: #ffea75 !important;
  --gold-dim: #998100 !important;
  --accent: #ffe333 !important;
  --accent-light: #fff28f !important;
  --accent-glow: rgba(255, 227, 51, 0.35) !important;
  --border: rgba(255, 227, 51, 0.4) !important;
  --border-strong: rgba(255, 215, 0, 0.6) !important;
  --prayer-active-bg: linear-gradient(135deg, #a3901a, #ffe333) !important;
  background: linear-gradient(135deg, #0a0a09, #21211d) !important;
}

/* Update 3.2: Universal Liquid Glass Engine */
body[data-theme-effect="liquid-glass"] .app-header,
body[data-theme-effect="liquid-glass"] .bottom-nav,
body[data-theme-effect="liquid-glass"] .modal-sheet,
body[data-theme-effect="liquid-glass"] .prayer-card,
body[data-theme-effect="liquid-glass"] .next-prayer-card,
body[data-theme-effect="liquid-glass"] .widget-card,
body[data-theme-effect="liquid-glass"] .qibla-loc-btn:not(.active),
body[data-theme-effect="liquid-glass"] .settings-card,
body[data-theme-effect="liquid-glass"] .settings-select,
body[data-theme-effect="liquid-glass"] .duas-page-btn,
body[data-theme-effect="liquid-glass"] .tasbih-taqibat-btn,
body[data-theme-effect="liquid-glass"] .tasbih-circle,
body[data-theme-effect="liquid-glass"] .compass-container,
body[data-theme-effect="liquid-glass"] .page-title,
body[data-theme-effect="liquid-glass"] .custom-media-widget {
  backdrop-filter: blur(50px) saturate(200%) !important;
  -webkit-backdrop-filter: blur(50px) saturate(200%) !important;
  box-shadow: 
    inset 0 1px 1px rgba(255, 255, 255, 0.15),
    inset 0 -1px 1px rgba(0, 0, 0, 0.2),
    0 8px 30px rgba(0, 0, 0, 0.3) !important;
}

/* Shimmering reflection pseudo-element */
body[data-theme-effect="liquid-glass"] .prayer-card::before,
body[data-theme-effect="liquid-glass"] .next-prayer-card::before,
body[data-theme-effect="liquid-glass"] .widget-card::before,
body[data-theme-effect="liquid-glass"] .settings-card::before,
body[data-theme-effect="liquid-glass"] .duas-page-btn::before,
body[data-theme-effect="liquid-glass"] .tasbih-taqibat-btn::before,
body[data-theme-effect="liquid-glass"] .tasbih-circle::before,
body[data-theme-effect="liquid-glass"] .custom-media-widget::before {
  content: "";
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.15), transparent);
  transform: skewX(-20deg);
  animation: liquidShine 6s infinite;
  pointer-events: none;
}

@keyframes liquidShine {
  0% { left: -100%; }
  20% { left: 200%; }
  100% { left: 200%; }
}

body[data-theme-effect="liquid-glass"] .app-header {
  background: linear-gradient(135deg, rgba(26, 58, 42, 0.4), rgba(15, 35, 25, 0.5)) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15) !important;
}
body[data-theme-effect="liquid-glass"] .bottom-nav {
  background: linear-gradient(135deg, rgba(15, 35, 25, 0.4), rgba(26, 58, 42, 0.6)) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
}
body[data-theme-effect="liquid-glass"] .modal-sheet {
  background: linear-gradient(145deg, rgba(30, 65, 48, 0.35), rgba(18, 42, 30, 0.65)) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 28px 28px 0 0 !important;
}
body[data-theme-effect="liquid-glass"] .prayer-card,
body[data-theme-effect="liquid-glass"] .next-prayer-card,
body[data-theme-effect="liquid-glass"] .widget-card,
body[data-theme-effect="liquid-glass"] .settings-card,
body[data-theme-effect="liquid-glass"] .duas-page-btn,
body[data-theme-effect="liquid-glass"] .tasbih-taqibat-btn,
body[data-theme-effect="liquid-glass"] .settings-select,
body[data-theme-effect="liquid-glass"] .custom-media-widget {
  overflow: hidden !important; 
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
}
body[data-theme-effect="liquid-glass"] .tasbih-circle {
  overflow: hidden !important;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  box-shadow: 0 0 40px rgba(230, 197, 99, 0.2), inset 0 0 20px rgba(255, 255, 255, 0.1) !important;
}

/* Light mode overrides for liquid glass */
body[data-theme="light"][data-theme-effect="liquid-glass"] .app-header,
body[data-theme="light"][data-theme-effect="liquid-glass"] .bottom-nav,
body[data-theme="light"][data-theme-effect="liquid-glass"] .modal-sheet,
body[data-theme="light"][data-theme-effect="liquid-glass"] .prayer-card,
body[data-theme="light"][data-theme-effect="liquid-glass"] .next-prayer-card,
body[data-theme="light"][data-theme-effect="liquid-glass"] .widget-card,
body[data-theme="light"][data-theme-effect="liquid-glass"] .settings-card,
body[data-theme="light"][data-theme-effect="liquid-glass"] .duas-page-btn,
body[data-theme="light"][data-theme-effect="liquid-glass"] .tasbih-taqibat-btn,
body[data-theme="light"][data-theme-effect="liquid-glass"] .settings-select,
body[data-theme="light"][data-theme-effect="liquid-glass"] .tasbih-circle,
body[data-theme="light"][data-theme-effect="liquid-glass"] .custom-media-widget {
  box-shadow: 
    inset 0 1px 2px rgba(255, 255, 255, 0.8),
    inset 0 -1px 2px rgba(0, 0, 0, 0.05),
    0 8px 30px rgba(0, 0, 0, 0.1) !important;
}

body[data-theme="light"][data-theme-effect="liquid-glass"] .app-header {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(245, 247, 250, 0.7)) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.4) !important;
}
body[data-theme="light"][data-theme-effect="liquid-glass"] .bottom-nav {
  background: linear-gradient(135deg, rgba(245, 247, 250, 0.6), rgba(255, 255, 255, 0.8)) !important;
  border-top: 1px solid rgba(255, 255, 255, 0.5) !important;
}
body[data-theme="light"][data-theme-effect="liquid-glass"] .modal-sheet {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.6), rgba(240, 242, 245, 0.85)) !important;
  border: 1px solid rgba(255, 255, 255, 0.6) !important;
}
body[data-theme="light"][data-theme-effect="liquid-glass"] .prayer-card,
body[data-theme="light"][data-theme-effect="liquid-glass"] .next-prayer-card,
body[data-theme="light"][data-theme-effect="liquid-glass"] .widget-card,
body[data-theme="light"][data-theme-effect="liquid-glass"] .settings-card,
body[data-theme="light"][data-theme-effect="liquid-glass"] .duas-page-btn,
body[data-theme="light"][data-theme-effect="liquid-glass"] .tasbih-taqibat-btn,
body[data-theme="light"][data-theme-effect="liquid-glass"] .settings-select,
body[data-theme="light"][data-theme-effect="liquid-glass"] .tasbih-circle,
body[data-theme="light"][data-theme-effect="liquid-glass"] .custom-media-widget {
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.4)) !important;
  border: 1px solid rgba(255, 255, 255, 0.8) !important;
}

ze: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.martyrdom-banner .cause {
  font-size: 1.1rem;
  color: var(--gold);
  font-weight: bold;
  line-height: 1.4;
}


/* ========================================================= */
/* 🍏 APPLE-STYLE LIQUID GLASS ENGINE FOR CUSTOM THEMES 🍏   */
/* ========================================================= */

/* 1. Global Glassmorphism for UI Elements in Custom Themes */
body[data-theme-event] .prayer-card,
body[data-theme-event] .next-prayer-card,
body[data-theme-event] .ziyarat-card,
body[data-theme-event] .saved-item-card,
body[data-theme-event] .bottom-nav {
  background: var(--bg-card) !important; /* Will use the theme's custom card color */
  backdrop-filter: blur(25px) saturate(180%);
  -webkit-backdrop-filter: blur(25px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

body[data-theme-event] .prayer-card.active {
  background: var(--prayer-active-bg) !important;
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px 0 var(--accent-glow);
}

body[data-theme-event] .nav-btn.active {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

/* 2. Floating Liquid Orbs Animation */
@keyframes liquidFloat1 {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  33%  { transform: translate(5vw, 5vh) scale(1.1) rotate(5deg); }
  66%  { transform: translate(-3vw, 8vh) scale(0.9) rotate(-3deg); }
  100% { transform: translate(0, 0) scale(1) rotate(0deg); }
}
@keyframes liquidFloat2 {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  33%  { transform: translate(-6vw, -4vh) scale(1.15) rotate(-5deg); }
  66%  { transform: translate(4vw, -7vh) scale(0.85) rotate(4deg); }
  100% { transform: translate(0, 0) scale(1) rotate(0deg); }
}
@keyframes slowPulse {
  0%   { opacity: 0.6; transform: scale(1); }
  50%  { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0.6; transform: scale(1); }
}

/* 3. BIRTH THEMES (Radiant, Joyful, Divine Light) */
body[data-theme-event$="_birth"] .app::before {
  will-change: transform, opacity;
  transform: translateZ(0);
  content: "";
  position: absolute;
  top: -20%; left: -20%; width: 70%; height: 70%;
  background: radial-gradient(circle, var(--gold-light) 0%, transparent 60%);
  filter: blur(80px);
  opacity: 0.4;
  animation: liquidFloat1 15s infinite ease-in-out;
  z-index: -1;
  pointer-events: none;
}
body[data-theme-event$="_birth"] .app::after {
  will-change: transform, opacity;
  transform: translateZ(0);
  content: "";
  position: absolute;
  bottom: -20%; right: -20%; width: 80%; height: 80%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  filter: blur(100px);
  opacity: 0.3;
  animation: liquidFloat2 18s infinite ease-in-out reverse;
  z-index: -1;
  pointer-events: none;
}

/* 4. MARTYRDOM THEMES (Somber, Deep, Dramatic Ash/Blood) */
body[data-theme-event$="_death"] .app::before {
  will-change: transform, opacity;
  transform: translateZ(0);
  content: "";
  position: absolute;
  top: -10%; right: -10%; width: 100%; height: 100%;
  background: radial-gradient(ellipse at top right, var(--bg-card2) 0%, transparent 70%);
  filter: blur(60px);
  opacity: 0.6;
  animation: slowPulse 8s infinite ease-in-out;
  z-index: -1;
  pointer-events: none;
}
body[data-theme-event$="_death"] .app::after {
  will-change: transform, opacity;
  transform: translateZ(0);
  content: "";
  position: absolute;
  bottom: 0; left: 0; width: 100%; height: 50%;
  background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
  z-index: -1;
  pointer-events: none;
}

/* 5. RAMADAN THEME (Emerald & Gold Crescents) */
body[data-theme-event="ramadan"] .app::before {
  will-change: transform, opacity;
  transform: translateZ(0);
  content: "";
  position: absolute;
  top: 5%; right: 5%; width: 200px; height: 200px;
  background: radial-gradient(circle, var(--gold-light) 0%, transparent 60%);
  border-radius: 50%;
  box-shadow: inset -20px -20px 0 0 rgba(255, 255, 255, 0.8); /* Crescent moon effect */
  filter: blur(2px) drop-shadow(0 0 20px var(--gold));
  opacity: 0.7;
  animation: slowPulse 10s infinite ease-in-out;
  z-index: -1;
  pointer-events: none;
}
body[data-theme-event="ramadan"] .app::after {
  will-change: transform, opacity;
  transform: translateZ(0);
  content: "";
  position: absolute;
  bottom: -10%; left: -10%; width: 80%; height: 80%;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  filter: blur(90px);
  opacity: 0.2;
  animation: liquidFloat1 20s infinite ease-in-out;
  z-index: -1;
  pointer-events: none;
}

/* 6. MUHARRAM THEME (Dusty Desert Twilight) */
body[data-theme-event="muharram"] .app::before {
  will-change: transform, opacity;
  transform: translateZ(0);
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.7) 100%);
  z-index: -1;
  pointer-events: none;
}
body[data-theme-event="muharram"] .app::after {
  will-change: transform, opacity;
  transform: translateZ(0);
  content: "";
  position: absolute;
  bottom: -20%; right: -20%; width: 90%; height: 90%;
  background: radial-gradient(circle, var(--gold-dim) 0%, transparent 60%);
  filter: blur(100px);
  opacity: 0.4;
  animation: slowPulse 12s infinite ease-in-out;
  z-index: -1;
  pointer-events: none;
}


/* Fix text color in next-prayer-card for White Marble Theme */
[data-theme-event="birth_prophet"] .next-label,
[data-theme-event="prophet_birth"] .next-label,
[data-theme-event="birth_ali"] .next-label,
[data-theme-event="ali_birth"] .next-label,
[data-theme-event="birth_hassan"] .next-label,
[data-theme-event="birth_prophet"] .next-countdown,
[data-theme-event="prophet_birth"] .next-countdown,
[data-theme-event="birth_ali"] .next-countdown,
[data-theme-event="ali_birth"] .next-countdown,
[data-theme-event="birth_hassan"] .next-countdown {
  color: var(--text-secondary) !important;
}

[data-theme-event="birth_prophet"] .next-prayer-name,
[data-theme-event="prophet_birth"] .next-prayer-name,
[data-theme-event="birth_ali"] .next-prayer-name,
[data-theme-event="ali_birth"] .next-prayer-name,
[data-theme-event="birth_hassan"] .next-prayer-name {
  color: var(--text-primary) !important;
}

[data-theme-event="birth_prophet"] .next-prayer-time,
[data-theme-event="prophet_birth"] .next-prayer-time,
[data-theme-event="birth_ali"] .next-prayer-time,
[data-theme-event="ali_birth"] .next-prayer-time,
[data-theme-event="birth_hassan"] .next-prayer-time {
  color: var(--gold) !important;
}

/* Specific size increase for iPhone and Safari users on bottom-nav */
body.is-iphone-safari .bottom-nav {
  padding-top: 15px !important;
}
body.is-iphone-safari .bottom-nav .nav-btn svg {
  width: 26px !important;
  height: 26px !important;
}
body.is-iphone-safari .bottom-nav .nav-btn span {
  font-size: 0.85rem !important;
}

/* ============ TAQIBAT AUDIO PLAYER ============ */
.taqibat-audio-container {
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  padding: 12px 16px;
  border-radius: 16px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.taqibat-audio-btn {
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.taqibat-audio-btn:active {
  transform: scale(0.95);
}

.taqibat-audio-progress-wrap {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.taqibat-audio-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  background: rgba(200, 200, 200, 0.3);
  border-radius: 2px;
  outline: none;
}
.taqibat-audio-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
}

.taqibat-audio-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* Sync Highlighting */



/* TAQIBAT BOX STYLING */
.taqibat-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
  animation: taqibatSlideIn 0.3s ease-out;
  animation-fill-mode: both;
}

.taqibat-item.active-highlight {
  background: rgba(201, 168, 76, 0.08); /* slight gold tint */
  border: 1px solid var(--gold);
  box-shadow: 0 4px 16px rgba(201, 168, 76, 0.15);
  transform: translateY(-2px);
}

body.lang-ar .ai-msg-bubble.bot .chat-text {
  direction: ltr;
  text-align: left;
}

.ai-chat-mic {
  position: absolute;
  top: 16px;
  right: 65px; /* Next to send button */
  width: 40px;
  height: 40px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-chat-mic:hover {
  background: var(--bg-hover);
  color: var(--accent-gold);
}

body.lang-ar .ai-chat-mic {
  right: auto;
  left: 65px;
}

.ai-msg-actions {
  display: flex;
  gap: 8px;
  margin-top: 18px;
  justify-content: flex-end;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 8px;
}

.ai-msg-action-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ai-msg-action-btn:hover {
  color: var(--accent-gold);
  background: var(--bg-hover);
}

.header-title {
  position: absolute !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  pointer-events: none;
}

.ai-header-btn svg {
  stroke: var(--text-secondary);
  fill: none;
  filter: none;
  transition: all 0.3s ease;
}
.ai-header-btn.active svg {
  stroke: var(--accent-gold) !important;
  fill: var(--accent-gold) !important;
  filter: drop-shadow(0 0 5px rgba(212,175,55,0.6));
  animation: pulse-glow 2s infinite;
}
@keyframes pulse-glow {
  0% { filter: drop-shadow(0 0 5px rgba(212,175,55,0.4)); }
  50% { filter: drop-shadow(0 0 10px rgba(212,175,55,0.8)); }
  100% { filter: drop-shadow(0 0 5px rgba(212,175,55,0.4)); }
}

/* Interactive Tasbih Engine */
.tasbih-interactive-area {
  position: relative;
  width: 100%;
  height: 250px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  margin: 20px 0;
  overflow: hidden;
  touch-action: pan-y; /* allow custom touch handling */
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 10px 20px rgba(0,0,0,0.3);
  cursor: pointer;
}

.tasbih-string-line {
  position: absolute;
  top: 0;
  bottom: 0;
  height: 100%;
  left: 50%;
  width: 4px;
  transform: translateX(-50%);
  background: linear-gradient(to right, #8a6a32, #cfaf72, #8a6a32);
  z-index: 1;
}

#beads-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none; /* let container handle events */
}

.tasbih-bead {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 70px;
  height: 55px;
  border-radius: 50%;
  /* Photorealistic 3D Agate/Wood Texture */
  background: radial-gradient(circle at 30% 20%, #ffdf91 0%, #b8860b 30%, #523a00 80%, #291d00 100%);
  box-shadow: 
    inset -10px -10px 20px rgba(0,0,0,0.8), 
    inset 5px 5px 15px rgba(255, 255, 255, 0.4),
    0 15px 20px rgba(0,0,0,0.6);
  transition: transform 0.1s linear; /* fallback, JS handles most of the animation */
  z-index: 2;
}

/* Give the top/bottom hole of the bead a darker spot */
.tasbih-bead::before, .tasbih-bead::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 8px;
  background: #111;
  border-radius: 50%;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.9);
}
.tasbih-bead::before { top: -2px; }
.tasbih-bead::after { bottom: -2px; }

.tasbih-hint {
  position: absolute;
  bottom: 10px;
  width: 100%;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  z-index: 3;
  pointer-events: none;
  opacity: 0.7;
}

/* Remove old tasbih button styles */
.tasbih-btn { display: none !important; }
.tasbih-ring-wrap { display: none !important; }

/* Circular Tasbih Engine Styling */
.tasbih-interactive-area {
  position: relative;
  width: 100%;
  height: 280px; /* Perfectly sized for mobile screens */
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  margin: 20px 0;
  overflow: hidden;
  touch-action: none; /* absolute control over touch */
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 10px 20px rgba(0,0,0,0.3);
  cursor: pointer;
}

#beads-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.tasbih-bead-wood {
  position: absolute;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  /* Dark wooden texture with bright shiny highlight */
  background: radial-gradient(circle at 30% 25%, #8b5a2b 0%, #3e2004 40%, #1a0b00 80%, #000000 100%);
  box-shadow: 
    inset -3px -3px 8px rgba(0,0,0,0.9), 
    inset 2px 2px 6px rgba(255,255,255,0.4),
    0 5px 8px rgba(0,0,0,0.7);
  z-index: 2;
  transform-origin: center center;
}

/* The bead holes */
.tasbih-bead-wood::before, .tasbih-bead-wood::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 4px;
  background: #000;
  border-radius: 50%;
}
.tasbih-bead-wood::before { top: -1px; }
.tasbih-bead-wood::after { bottom: -1px; }

/* The Imam/Tassel bead */
.tasbih-bead-imam {
  position: absolute;
  width: 20px;
  height: 60px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(to right, #2a1100, #5c2f06, #2a1100);
  box-shadow: 
    inset 2px 0 5px rgba(255,255,255,0.2),
    0 5px 10px rgba(0,0,0,0.7);
  z-index: 3;
  transform-origin: center center;
}

/* The tassel strings */
.tassel-tail {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 40px;
  background: repeating-linear-gradient(90deg, #111, #111 1px, #3e2004 2px, #3e2004 3px);
  border-radius: 0 0 10px 10px;
  clip-path: polygon(20% 0, 80% 0, 100% 100%, 0% 100%);
  opacity: 0.9;
}

/* Hide the old single string line */
.tasbih-string-line {
  display: none !important;
}

/* Video Tasbih Styling */
.video-mode {
  padding: 0;
  background: #000;
}

#tasbih-sound-toggle {
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: white;
  cursor: pointer;
  z-index: 10;
  backdrop-filter: blur(5px);
  transition: background 0.3s ease;
}

#tasbih-sound-toggle:hover {
  background: rgba(0, 0, 0, 0.8);
}

#tasbih-sound-toggle svg {
  width: 20px;
  height: 20px;
}

















/* Dynamic Nav Scale Variables */
:root {
  --nav-scale: 1.0;
}

.bottom-nav {
  height: calc((var(--nav-height) * var(--nav-scale)) + var(--safe-bottom)) !important;
}

.nav-btn {
  font-size: calc(0.65rem * var(--nav-scale)) !important;
  gap: calc(4px * var(--nav-scale)) !important;
}

.nav-btn svg {
  width: calc(24px * var(--nav-scale)) !important;
  height: calc(24px * var(--nav-scale)) !important;
}

.quote-card.fading-next {
  transform: translateX(-120%) scale(0.9) !important;
}

.quote-card.fading-prev {
  transform: translateX(120%) scale(0.9) !important;
}

.quote-card.entering-next {
  transform: translateX(120%) scale(0.9) !important;
  transition: none !important;
}

.quote-card.entering-prev {
  transform: translateX(-120%) scale(0.9) !important;
  transition: none !important;
}

/* =========================================
   RAKAH & SUJUD COUNTER STYLES
   ========================================= */

.rakah-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 20px;
  height: 100%;
}

.rakah-status-banner {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--gold);
  padding: 15px 20px;
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.rakah-display-area {
  display: flex;
  gap: 20px;
  width: 100%;
  max-width: 400px;
  justify-content: center;
}

.rakah-box {
  flex: 1;
  background: var(--bg-card);
  border: 2px solid var(--gold);
  border-radius: 20px;
  padding: 30px 10px;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.rakah-label {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.rakah-value {
  font-size: 5rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  text-shadow: 0 4px 10px rgba(255, 215, 0, 0.2);
}

.rakah-value.bump {
  animation: rakahBump 0.2s ease;
}

@keyframes rakahBump {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); color: var(--gold); }
  100% { transform: scale(1); }
}

.rakah-manual-btn {
  background: rgba(255, 215, 0, 0.1);
  border: 2px dashed var(--gold);
  color: var(--gold);
  padding: 25px;
  border-radius: 15px;
  font-size: 1.2rem;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
  max-width: 400px;
  transition: all 0.2s ease;
}

.rakah-manual-btn:active {
  background: rgba(255, 215, 0, 0.3);
  transform: scale(0.98);
}

.rakah-reset-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 15px;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
  max-width: 400px;
  margin-top: 20px;
}

.rakah-reset-btn:active {
  background: var(--bg-primary);
}



.setup-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  backdrop-filter: blur(10px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.setup-modal-content {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  width: 100%;
  max-width: 400px;
  padding: 30px 20px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.5);
  max-height: 90vh;
  overflow-y: auto;
}

.setup-group {
  margin-bottom: 25px;
}

.setup-group label {
  display: block;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

.setup-select {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-primary);
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 1rem;
  appearance: none;
  outline: none;
}

.setup-select:focus {
  border-color: var(--gold);
}

.setup-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.setup-search-icon {
  position: absolute;
  left: 15px;
  color: var(--text-muted);
}

.setup-search-input {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-primary);
  padding: 10px 15px 10px 40px;
  border-radius: 12px;
  font-size: 0.9rem;
  outline: none;
}

.setup-search-input:focus {
  border-color: var(--gold);
}


/* =========================================================
   APPLE SETUP WIZARD
========================================================= */
#appleSetupContainer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(rgba(13, 31, 22, 0.85), rgba(13, 31, 22, 0.95)), url('Kaabah/kaabah.png') center/cover no-repeat;
  z-index: 999999;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.apple-setup-slider {
  display: flex;
  width: 300vw;
  height: 100%;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.apple-setup-step {
  width: 100vw;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 40px 20px;
  box-sizing: border-box;
}

.apple-setup-header {
  text-align: center;
  margin-bottom: 40px;
}

.apple-setup-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 10px 0;
  letter-spacing: -1px;
}

.apple-setup-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin: 0;
}

.apple-setup-content {
  width: 100%;
  max-width: 400px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: auto 0;
}

.apple-list-group {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
}

.apple-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  font-size: 1.05rem;
  color: var(--text-primary);
}
.apple-list-item:last-child {
  border-bottom: none;
}

.apple-select {
  background: transparent;
  border: none;
  color: var(--gold);
  font-size: 1.05rem;
  text-align: right;
  outline: none;
  appearance: none;
  cursor: pointer;
}

.apple-search-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  color: var(--text-muted);
}
.apple-search-wrapper i {
  margin-right: 10px;
}
.apple-search-wrapper input {
  background: transparent;
  border: none;
  color: var(--text-primary);
  width: 100%;
  font-size: 1rem;
  outline: none;
}

.apple-setup-card {
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.apple-setup-card h4 {
  margin: 0 0 10px 0;
  font-size: 1.1rem;
}
.apple-setup-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.apple-setup-footer {
  width: 100%;
  max-width: 400px;
  padding-bottom: 40px;
}

.apple-btn {
  width: 100%;
  background: var(--gold);
  color: #000;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.apple-btn:active { opacity: 0.7; }
.apple-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.apple-btn-secondary {
  width: 100%;
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.apple-btn-secondary:active { opacity: 0.7; }

/* Switch Toggle Apple Style */
.apple-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
}
.apple-switch input { opacity: 0; width: 0; height: 0; }
.apple-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255,255,255,0.2);
  transition: .4s;
  border-radius: 34px;
}
.apple-slider:before {
  position: absolute;
  content: "";
  height: 24px;
  width: 24px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}
.apple-switch input:checked + .apple-slider {
  background-color: #34C759;
}
.apple-switch input:checked + .apple-slider:before {
  transform: translateX(22px);
}


.apple-segmented-control {
  position: relative;
  display: flex;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 4px;
  width: 100%;
}
.apple-segment-pill {
  position: absolute;
  top: 4px; bottom: 4px;
  width: calc(50% - 4px);
  background: var(--bg-card);
  border-radius: 8px;
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 1;
}
.apple-segment {
  flex: 1;
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 12px 0;
  color: var(--text-muted);
  font-weight: 600;
  cursor: pointer;
  transition: color 0.3s ease;
}
.apple-segment.active {
  color: var(--gold);
}


/* =========================================================
   SETUP WIZARD REDESIGN UX
========================================================= */
.apple-search-select-group {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
}

.apple-search-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.apple-search-header i {
  color: var(--gold);
  margin-right: 12px;
  margin-left: 12px;
}

.apple-search-header input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
}

.apple-listbox-container {
  max-height: 140px;
  overflow-y: auto;
}

.apple-listbox {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 8px;
  font-size: 1rem;
  outline: none;
}

.apple-listbox option {
  padding: 12px 16px;
  background: #11261b;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.apple-listbox option:hover, .apple-listbox option:focus, .apple-listbox option:checked {
  background: var(--gold) !important;
  color: #000 !important;
}

/* Range Slider */
.apple-range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.2);
  outline: none;
  margin: 10px 0;
}

.apple-range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.apple-range-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* Nav Bar Pop-up Preview during Step 3 */
body.setup-step-3-active .bottom-nav {
  z-index: 9999999 !important; /* Force it above setup container */
  pointer-events: none; /* Preview only, no clicks */
  transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), height 0.3s ease;
}

/* iOS 27 Crazy Squish Animation */
.apple-segment-pill.squish {
  transform-style: preserve-3d;
  animation: squishEffect 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes squishEffect {
  0% { transform: scaleX(1) scaleY(1); }
  40% { transform: scaleX(1.15) scaleY(0.85); }
  100% { transform: scaleX(1) scaleY(1); }
}

#appleLangSegment {
  direction: rtl !important; /* Lock direction so it doesn't flip when language changes */
}
.apple-segment-pill {
  right: 4px; /* Anchor it to the right */
  left: auto;
}

/* Custom Apple Setup Location Picker */
.apple-custom-listbox {
  max-height: 140px;
  overflow-y: auto;
  border-radius: 0 0 12px 12px;
  background: rgba(0,0,0,0.2);
  border-top: 1px solid rgba(255,255,255,0.05);
}

.apple-custom-listbox::-webkit-scrollbar {
  width: 4px;
}
.apple-custom-listbox::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
}

.apple-custom-item {
  padding: 12px 16px;
  color: var(--text-primary);
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.apple-custom-item:last-child {
  border-bottom: none;
}

.apple-custom-item:hover, .apple-custom-item:active {
  background: rgba(255,255,255,0.05);
}

.apple-custom-item.selected {
  background: var(--gold) !important;
  color: #000 !important;
  font-weight: bold;
}


/* iOS Keyboard Fixes */
body.keyboard-open .bottom-nav {
    display: none !important;
}
body.keyboard-open .ai-chat-page-container {
    padding-bottom: 0 !important;
}
