/* ==========================================================================
   NurAl-Amal (نور العمل) — 30 Days of Quranic Good Deeds & Habit Curriculum
   Modern, Colorful, Accessible & Responsive Stylesheet
   ========================================================================== */

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

:root {
  /* Emerald Oasis (Default Theme) */
  --primary: #059669;
  --primary-light: #10b981;
  --primary-glow: rgba(16, 185, 129, 0.35);
  --primary-gradient: linear-gradient(135deg, #059669 0%, #10b981 50%, #34d399 100%);
  
  --secondary: #d97706;
  --secondary-light: #f59e0b;
  --secondary-glow: rgba(245, 158, 11, 0.3);

  --accent-cyan: #0891b2;
  --accent-purple: #7c3aed;
  --accent-rose: #e11d48;
  --accent-gold: #fbbf24;

  /* Neutral tones */
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: rgba(255, 255, 255, 0.85);
  --bg-subtle: #f1f5f9;
  --border-subtle: #e2e8f0;
  --border-highlight: rgba(16, 185, 129, 0.4);

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --text-inverse: #ffffff;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 16px 36px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 24px var(--primary-glow);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  --transition-quick: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-arabic: 'Amiri', 'Scheherazade New', 'Traditional Arabic', 'Geeza Pro', serif;
}

/* Theme 2: Royal Sapphire */
[data-theme="sapphire"] {
  --primary: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-glow: rgba(59, 130, 246, 0.35);
  --primary-gradient: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #60a5fa 100%);
  --secondary: #d97706;
  --secondary-light: #f59e0b;
}

/* Theme 3: Velvet Amethyst */
[data-theme="amethyst"] {
  --primary: #6d28d9;
  --primary-light: #8b5cf6;
  --primary-glow: rgba(139, 92, 246, 0.35);
  --primary-gradient: linear-gradient(135deg, #5b21b6 0%, #8b5cf6 50%, #c084fc 100%);
  --secondary: #db2777;
  --secondary-light: #f472b6;
}

/* Theme 4: Desert Sunset */
[data-theme="sunset"] {
  --primary: #ea580c;
  --primary-light: #f97316;
  --primary-glow: rgba(249, 115, 22, 0.35);
  --primary-gradient: linear-gradient(135deg, #c2410c 0%, #ea580c 50%, #fb923c 100%);
  --secondary: #ca8a04;
  --secondary-light: #eab308;
}

/* Dark Mode Overrides */
[data-mode="dark"] {
  --bg-main: #090d16;
  --bg-surface: #111827;
  --bg-surface-elevated: rgba(17, 24, 39, 0.85);
  --bg-subtle: #1e293b;
  --border-subtle: #2d3748;
  --border-highlight: rgba(52, 211, 153, 0.4);

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --text-inverse: #090d16;

  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 45px rgba(0, 0, 0, 0.7);
}

/* Base Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color var(--transition-normal), color var(--transition-normal);
  background-image: 
    radial-gradient(circle at 10% 15%, var(--primary-glow) 0%, transparent 40%),
    radial-gradient(circle at 90% 85%, var(--secondary-glow) 0%, transparent 45%);
  background-attachment: fixed;
}

/* Canvas for Confetti Fireworks */
#confettiCanvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

/* Typography & Links */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-quick);
}

a:hover {
  text-decoration: underline;
}

/* Container */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ==========================================================================
   Header & App Bar
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface-elevated);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  text-decoration: none;
}

.brand-logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.4rem;
  box-shadow: 0 4px 12px var(--primary-glow);
  transform: rotate(-3deg);
  transition: transform var(--transition-bounce);
}

.brand-wrapper:hover .brand-logo-icon {
  transform: rotate(4deg) scale(1.08);
}

.brand-text h1 {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.brand-text .arabic-subtitle {
  font-family: var(--font-arabic);
  font-size: 1.15rem;
  color: var(--secondary-light);
  font-weight: 700;
}

.brand-text p {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Header Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-quick);
  font-size: 1.1rem;
}

.btn-icon:hover {
  background: var(--bg-subtle);
  border-color: var(--primary-light);
  color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.theme-dropdown {
  position: relative;
}

.select-clean {
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-quick);
  outline: none;
}

.select-clean:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ==========================================================================
   Hero & Quick Stats Ribbon
   ========================================================================== */
.hero-ribbon {
  padding: 1.75rem 0 1rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
}

@media (max-width: 860px) {
  .hero-grid {
    grid-template-columns: 1fr;
  }
}

.hero-title-area h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.hero-title-area h2 span {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-title-area p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 620px;
}

.stats-card-group {
  display: flex;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.stat-chip {
  background: var(--bg-surface-elevated);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0.75rem 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-quick), box-shadow var(--transition-quick);
}

.stat-chip:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
}

.stat-icon.streak {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
}

.stat-icon.progress {
  background: rgba(16, 185, 129, 0.15);
  color: #059669;
}

.stat-icon.count {
  background: rgba(124, 58, 237, 0.15);
  color: #7c3aed;
}

.stat-meta .stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-main);
}

.stat-meta .stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Overall Progress Bar */
.progress-bar-container {
  margin-top: 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  box-shadow: var(--shadow-sm);
}

.progress-track {
  flex: 1;
  height: 10px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 10px var(--primary-glow);
}

.progress-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  min-width: 90px;
  text-align: right;
}

/* ==========================================================================
   Navigation Tabs (Monthly, Weekly, Daily, Yearly)
   ========================================================================== */
.views-nav-wrapper {
  margin: 1.5rem 0 1.25rem;
}

.views-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  border-bottom: 2px solid var(--border-subtle);
  padding-bottom: 0.5rem;
  flex-wrap: wrap;
}

.tab-pills {
  display: flex;
  background: var(--bg-subtle);
  padding: 0.35rem;
  border-radius: var(--radius-full);
  gap: 0.25rem;
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 1.15rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  transition: all var(--transition-quick);
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.action-buttons-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.btn-primary {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 12px var(--primary-glow);
  transition: all var(--transition-quick);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px var(--primary-glow);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all var(--transition-quick);
}

.btn-secondary:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

/* ==========================================================================
   Filter & Search Toolbar
   ========================================================================== */
.filter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 0.95rem;
}

.search-input {
  width: 100%;
  padding: 0.55rem 2.2rem 0.55rem 2.3rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
  transition: all var(--transition-quick);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-clear-search {
  position: absolute;
  right: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-full);
  display: none;
}

.btn-clear-search:hover {
  color: var(--accent-rose);
  background: var(--bg-subtle);
}

.search-results-counter {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-left: 0.5rem;
  white-space: nowrap;
}

.category-filter-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: center;
}

.filter-chip {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-quick);
}

.filter-chip:hover {
  border-color: var(--primary-light);
  color: var(--text-main);
}

.filter-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.filter-chip-count {
  background: rgba(0, 0, 0, 0.08);
  padding: 0.05rem 0.4rem;
  border-radius: var(--radius-full);
  font-size: 0.68rem;
  font-weight: 700;
}

.filter-chip.active .filter-chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}

/* ==========================================================================
   VIEW 1: Monthly Plan (30-Day Grid)
   ========================================================================== */
.view-panel {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.view-panel.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.monthly-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 640px) {
  .monthly-grid {
    grid-template-columns: 1fr;
  }
}

/* Individual Deed Card */
.deed-card {
  background: var(--bg-surface-elevated);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
  overflow: hidden;
}

.deed-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
  opacity: 0.7;
  transition: opacity var(--transition-quick);
}

.deed-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-highlight);
}

.deed-card:hover::before {
  opacity: 1;
}

.deed-card.completed {
  border-color: rgba(16, 185, 129, 0.4);
  background: linear-gradient(180deg, rgba(16, 185, 129, 0.04) 0%, var(--bg-surface) 100%);
}

.deed-card.completed::before {
  background: #10b981;
  opacity: 1;
}

.card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.day-badge {
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--bg-subtle);
  color: var(--primary);
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.03em;
}

.category-tag {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: var(--radius-full);
}

.category-tag.emerald { background: rgba(16, 185, 129, 0.12); color: #059669; }
.category-tag.amber   { background: rgba(245, 158, 11, 0.12); color: #d97706; }
.category-tag.cyan    { background: rgba(6, 182, 212, 0.12); color: #0891b2; }
.category-tag.purple  { background: rgba(139, 92, 246, 0.12); color: #7c3aed; }
.category-tag.rose    { background: rgba(244, 63, 94, 0.12); color: #e11d48; }
.category-tag.teal    { background: rgba(20, 184, 166, 0.12); color: #0d9488; }

.card-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--text-main);
  line-height: 1.35;
}

/* Arabic Ayah snippet */
.arabic-snippet {
  font-family: var(--font-arabic);
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--secondary);
  direction: rtl;
  text-align: right;
  margin: 0.4rem 0 0.5rem;
  padding: 0.35rem 0.65rem;
  background: rgba(245, 158, 11, 0.05);
  border-radius: var(--radius-sm);
  border-right: 3px solid var(--secondary-light);
}

[data-mode="dark"] .arabic-snippet {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.07);
}

.ayah-ref {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.4rem;
}

.deed-translation {
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.action-preview {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
  flex: 1;
}

.action-preview strong {
  color: var(--text-main);
}

/* Card Bottom Footer */
.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  gap: 0.5rem;
}

.completion-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.custom-checkbox {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-subtle);
  background: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  transition: all var(--transition-quick);
  font-size: 0.8rem;
}

.deed-card.completed .custom-checkbox {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: scale(1.05);
}

.completion-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.deed-card.completed .completion-label {
  color: var(--primary);
}

.card-actions-mini {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-mini {
  padding: 0.3rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-quick);
}

.btn-mini:hover {
  background: var(--bg-subtle);
  color: var(--primary);
  border-color: var(--primary-light);
}

/* ==========================================================================
   VIEW 2: Weekly Plan
   ========================================================================== */
.weekly-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.week-selector-bar {
  display: flex;
  gap: 0.65rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.week-tab-btn {
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-quick);
}

.week-tab-btn:hover {
  border-color: var(--primary-light);
  color: var(--text-main);
}

.week-tab-btn.active {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 14px var(--primary-glow);
}

.week-hero-card {
  background: var(--bg-surface-elevated);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.5rem;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 768px) {
  .week-hero-card {
    grid-template-columns: 1fr;
  }
}

.week-hero-info h3 {
  font-size: 1.45rem;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.week-hero-info p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.week-stats-box {
  background: var(--bg-subtle);
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  text-align: center;
}

.week-stats-box .circle-number {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.week-days-table {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.week-day-row {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: 90px 1fr auto;
  align-items: center;
  gap: 1rem;
  transition: transform var(--transition-quick), border-color var(--transition-quick);
}

.week-day-row:hover {
  transform: translateX(4px);
  border-color: var(--primary-light);
}

.week-day-row.completed {
  background: rgba(16, 185, 129, 0.03);
  border-color: rgba(16, 185, 129, 0.4);
}

.week-day-label {
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--primary);
}

.week-day-content h4 {
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.week-day-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ==========================================================================
   VIEW 3: Daily Focus Mode (Immersive View)
   ========================================================================== */
.daily-focus-container {
  max-width: 860px;
  margin: 0 auto 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.daily-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  padding: 0.65rem 1.15rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-sm);
}

.daily-nav-bar .day-title-pill {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
}

/* Focus Hero Card */
.daily-focus-card {
  background: var(--bg-surface-elevated);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.daily-focus-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: var(--primary-gradient);
}

.daily-header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.daily-focus-title {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: var(--text-main);
}

/* Arabic Ornate Frame */
.arabic-ornate-frame {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.08) 0%, rgba(245, 158, 11, 0.02) 100%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
  position: relative;
}

.arabic-large {
  font-family: var(--font-arabic);
  font-size: 2.2rem;
  line-height: 1.9;
  color: var(--secondary);
  direction: rtl;
  margin-bottom: 0.5rem;
}

[data-mode="dark"] .arabic-large {
  color: #fbbf24;
}

.ayah-citation-large {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.translation-large {
  font-size: 1.1rem;
  font-style: italic;
  color: var(--text-main);
  margin-bottom: 1.75rem;
  border-left: 4px solid var(--primary);
  padding-left: 1rem;
  line-height: 1.6;
}

.wisdom-box {
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  margin-bottom: 1.75rem;
}

.wisdom-box h4 {
  font-size: 0.88rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.wisdom-box p {
  font-size: 0.92rem;
  color: var(--text-main);
}

/* Checklist of 3 Micro-tasks */
.micro-tasks-section h4 {
  font-size: 1rem;
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}

.task-item {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-quick);
}

.task-item:hover {
  background: var(--bg-subtle);
  border-color: var(--primary-light);
}

.task-item.done {
  text-decoration: line-through;
  color: var(--text-muted);
  background: rgba(16, 185, 129, 0.03);
  border-color: rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   Memorization & Recitation Assistant Box (Easy to Remember)
   ========================================================================== */
.memorize-assistant-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}

.memorize-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.memorize-header h4 {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--primary);
}

.memorize-actions {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.memorize-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-quick);
}

.memorize-btn:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.memorize-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.memorize-transliteration {
  font-size: 0.92rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  transition: filter 0.25s ease;
}

.memorize-transliteration.hidden-blur,
.arabic-ornate-frame.hidden-blur .arabic-large,
.translation-large.hidden-blur {
  filter: blur(8px);
  user-select: none;
  cursor: pointer;
}

/* Digital Tasbih / Dhikr Widget */
.tasbih-widget {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(6, 182, 212, 0.08) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2rem;
  position: relative;
}

.tasbih-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tasbih-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}

.tasbih-phrase-select {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid rgba(16, 185, 129, 0.4);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.tasbih-round-badge {
  font-size: 0.75rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.15);
  color: var(--primary);
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
}

.tasbih-counter-display {
  font-size: 4rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--primary);
  line-height: 1;
  margin: 0.5rem 0;
  cursor: pointer;
  user-select: none;
  transition: transform 0.1s ease;
}

.tasbih-counter-display:active {
  transform: scale(0.92);
}

.tasbih-progress-bar {
  width: 100%;
  max-width: 280px;
  height: 6px;
  background: rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-bottom: 1rem;
}

.tasbih-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--primary-gradient);
  border-radius: var(--radius-full);
  transition: width 0.2s ease;
}

.tasbih-controls {
  display: flex;
  gap: 0.65rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-tasbih-count {
  background: var(--primary-gradient);
  color: white;
  border: none;
  padding: 0.75rem 2.2rem;
  border-radius: var(--radius-full);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px var(--primary-glow);
  transition: all var(--transition-quick);
}

.btn-tasbih-count:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-tasbih-count:active {
  transform: scale(0.96);
}

/* Share Buttons Group */
.share-actions-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border-subtle);
}

.btn-share {
  font-size: 0.78rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all var(--transition-quick);
}

.btn-share:hover {
  background: var(--bg-subtle);
  color: var(--primary);
  border-color: var(--primary-light);
}

.btn-share.whatsapp:hover {
  background: #25d366;
  color: white;
  border-color: #25d366;
}

.btn-share.telegram:hover {
  background: #0088cc;
  color: white;
  border-color: #0088cc;
}

/* In-App Live Alarm Banner */
.alarm-banner {
  position: fixed;
  top: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: 10000;
  background: var(--bg-surface);
  border: 2px solid var(--secondary);
  border-radius: var(--radius-xl);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 90vw;
}

.alarm-banner.active {
  transform: translateX(-50%) translateY(0);
}

.alarm-icon {
  font-size: 2rem;
  animation: bellShake 1s infinite ease-in-out;
}

@keyframes bellShake {
  0%, 100% { transform: rotate(0); }
  20%, 60% { transform: rotate(15deg); }
  40%, 80% { transform: rotate(-15deg); }
}

.alarm-content h5 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.alarm-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Micro Actions List Editor inside Edit Modal */
.action-item-edit-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.action-item-edit-input {
  flex: 1;
  padding: 0.45rem 0.75rem;
  font-size: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  outline: none;
}

.action-item-edit-input:focus {
  border-color: var(--primary);
}

.btn-remove-action {
  background: transparent;
  border: none;
  color: var(--accent-rose);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-full);
}

.btn-remove-action:hover {
  background: rgba(225, 29, 72, 0.1);
}

/* Journal / Reflection Note Area */
.journal-section h4 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.journal-textarea {
  width: 100%;
  min-height: 110px;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
  transition: border-color var(--transition-quick);
}

.journal-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ==========================================================================
   VIEW 4: Yearly Virtues & 365-Day Activity Heatmap
   ========================================================================== */
.yearly-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-bottom: 3rem;
}

.yearly-heatmap-card {
  background: var(--bg-surface-elevated);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.yearly-heatmap-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.heatmap-scroll-wrapper {
  overflow-x: auto;
  padding: 0.5rem 0 1rem;
}

.heatmap-grid {
  display: grid;
  grid-template-rows: repeat(7, 13px);
  grid-auto-flow: column;
  grid-auto-columns: 13px;
  gap: 4px;
  min-width: 820px;
}

.heatmap-cell {
  width: 13px;
  height: 13px;
  border-radius: 2px;
  background: var(--bg-subtle);
  border: 1px solid rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: transform 0.1s ease;
}

.heatmap-cell:hover {
  transform: scale(1.3);
  z-index: 10;
}

.heatmap-cell[data-level="1"] { background: #6ee7b7; }
.heatmap-cell[data-level="2"] { background: #34d399; }
.heatmap-cell[data-level="3"] { background: #10b981; }
.heatmap-cell[data-level="4"] { background: #047857; }

.heatmap-legend {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.85rem;
}

/* 12-Month Virtues Grid */
.twelve-months-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.month-theme-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  transition: transform var(--transition-quick), border-color var(--transition-quick);
  box-shadow: var(--shadow-sm);
}

.month-theme-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
}

.month-num-badge {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--secondary);
  letter-spacing: 0.06em;
}

.month-theme-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0.25rem 0 0.5rem;
}

.month-ayah-quote {
  font-family: var(--font-arabic);
  font-size: 1.15rem;
  color: var(--primary);
  direction: rtl;
  margin-bottom: 0.4rem;
}

.month-focus-text {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Modals & Dialogs (Compliant with Modern Web Guidance)
   Native <dialog closedby="any"> styling with scroll containment
   ========================================================================== */
dialog {
  border: none;
  border-radius: var(--radius-xl);
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: var(--shadow-lg);
  width: 92%;
  max-width: 620px;
  padding: 0;
  margin: auto;
  outline: none;
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow: hidden;
  overscroll-behavior: contain;
}

.dialog-inner {
  padding: 1.75rem;
  max-height: 85vh;
  overflow-y: auto;
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.dialog-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
}

.dialog-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dialog-close-btn:hover {
  color: var(--text-main);
  background: var(--bg-subtle);
}

/* Form inputs inside modals */
.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-main);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  outline: none;
  transition: border-color var(--transition-quick);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.5rem;
}

/* Reminders List in Modal */
.reminders-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.reminder-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.reminder-meta h5 {
  font-size: 0.9rem;
}

.reminder-meta p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border-subtle);
  transition: .3s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--primary);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

/* ==========================================================================
   Toasts & Alerts
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  background: var(--text-main);
  color: var(--text-inverse);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slideInToast 0.3s ease-out;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

@keyframes slideInToast {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   Footer & Versioning (Mandatory Rule)
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 2.25rem 0 1.75rem;
  transition: all var(--transition-normal);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-brand h4 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
}

.footer-brand p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-center {
  text-align: center;
}

.footer-version {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.3rem 0.85rem;
  background: var(--bg-subtle);
  color: var(--primary);
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
  letter-spacing: 0.02em;
}

.footer-actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* ==========================================================================
   Print Stylesheet (@media print)
   ========================================================================== */
@media print {
  .site-header, .views-nav-wrapper, .filter-toolbar, .action-buttons-group, .site-footer, .tasbih-widget, .toast-container, #confettiCanvas {
    display: none !important;
  }

  body {
    background: white !important;
    color: black !important;
  }

  .monthly-grid {
    display: block;
  }

  .deed-card {
    page-break-inside: avoid;
    border: 1px solid #ccc !important;
    margin-bottom: 1.5rem;
    box-shadow: none !important;
  }
}
