/* Aurad Hasaniyyah - Design System & Stylesheet */

@font-face {
  font-family: "KFGQPC Hafs";
  src: url("https://cdn.jsdelivr.net/gh/thetruetruth/quran-data-kfgqpc@main/hafs-smart/font/hafssmart.8.woff2") format("woff2"),
       url("https://cdn.jsdelivr.net/gh/thetruetruth/quran-data-kfgqpc@main/hafs-smart/font/hafssmart.8.ttf") format("truetype");
  font-display: swap;
}

/* Design Tokens & Root Styling */
:root {
  /* Default Typography */
  --arabic-font-family: 'KFGQPC Hafs', 'Amiri', serif;

  /* Common Brand Colors */
  --emerald-primary: #047857;      /* Emerald 700 */
  --emerald-light: #064e3b;        /* Emerald 900 */
  --emerald-accent: #34d399;       /* Emerald 400 */
  --gold-accent: #d97706;          /* Amber 600 */
  --gold-glow: rgba(217, 119, 6, 0.2);

  /* Light Theme Variables */
  --bg-primary: #fcfbf7;           /* Warm Sand/Cream */
  --bg-secondary: #f3f0e6;         /* Deeper warm sand */
  --bg-card: #ffffff;
  --bg-card-hover: #fcfcfb;
  --bg-card-completed: rgba(4, 120, 87, 0.06);
  --border-color: #e5e0d3;
  --border-completed: #047857;
  --text-primary: #1e293b;         /* Slate 800 */
  --text-secondary: #475569;       /* Slate 600 */
  --text-arabic: #0f172a;
  --sidebar-bg: #112a21;           /* Deep Forest Green */
  --sidebar-text-primary: #f0fdf4;
  --sidebar-text-secondary: #a7f3d0;
  --sidebar-active-bg: rgba(255, 255, 255, 0.12);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
  --glass-bg: rgba(255, 255, 255, 0.75);
  --glass-border: rgba(229, 224, 211, 0.5);
}

/* Dark Theme Variables Override */
.dark-mode {
  --bg-primary: #0b0f19;           /* Very Dark Blue-Slate */
  --bg-secondary: #121824;         /* Dark Slate */
  --bg-card: #1a2333;              /* Rich Slate Card */
  --bg-card-hover: #212c40;
  --bg-card-completed: rgba(52, 211, 153, 0.06);
  --border-color: #26334d;
  --border-completed: #34d399;
  --text-primary: #f1f5f9;         /* Slate 100 */
  --text-secondary: #94a3b8;       /* Slate 400 */
  --text-arabic: #f8fafc;
  --sidebar-bg: #070d14;           /* Solid Dark Slate/Black */
  --sidebar-text-primary: #f1f5f9;
  --sidebar-text-secondary: #64748b;
  --sidebar-active-bg: rgba(52, 211, 153, 0.15);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --glass-bg: rgba(26, 35, 51, 0.8);
  --glass-border: rgba(38, 51, 77, 0.5);
}

/* System-aware color scheme compatibility */
@media (prefers-color-scheme: dark) {
  body:not(.light-mode) {
    /* If the user's system prefers dark and they haven't explicitly set light-mode, use dark mode */
    --bg-primary: #0b0f19;
    --bg-secondary: #121824;
    --bg-card: #1a2333;
    --bg-card-hover: #212c40;
    --bg-card-completed: rgba(52, 211, 153, 0.06);
    --border-color: #26334d;
    --border-completed: #34d399;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-arabic: #f8fafc;
    --sidebar-bg: #070d14;
    --sidebar-text-primary: #f1f5f9;
    --sidebar-text-secondary: #64748b;
    --sidebar-active-bg: rgba(52, 211, 153, 0.15);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
    --glass-bg: rgba(26, 35, 51, 0.8);
    --glass-border: rgba(38, 51, 77, 0.5);
  }
}

/* Base Resets & Layout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Scrollbar Customization */
body, .reading-window, .sidebar-nav {
  scrollbar-color: var(--border-color) transparent;
}

@supports not (scrollbar-color: auto) {
  body::-webkit-scrollbar, .reading-window::-webkit-scrollbar, .sidebar-nav::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  body::-webkit-scrollbar-thumb, .reading-window::-webkit-scrollbar-thumb, .sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
  }
  body::-webkit-scrollbar-track, .reading-window::-webkit-scrollbar-track, .sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
  }
}

/* CSS Grid App Container */
.app-container {
  display: grid;
  grid-template-columns: 300px 1fr;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.app-sidebar {
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text-primary);
  display: flex;
  flex-direction: column;
  height: 100%;
  border-right: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 100;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-logo {
  color: var(--emerald-accent);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo-subtitle {
  font-family: 'Amiri', serif;
  font-size: 0.95rem;
  color: var(--sidebar-text-secondary);
  margin-top: -2px;
}

.close-sidebar-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  padding: 0 8px;
}

/* Navigation List */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.nav-group-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sidebar-text-secondary);
  padding: 8px 12px;
  opacity: 0.7;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  color: var(--sidebar-text-primary);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  transition: background-color 0.2s, color 0.2s;
  opacity: 0.85;
  margin-bottom: 2px;
}

.nav-link:hover {
  background-color: rgba(255, 255, 255, 0.06);
  opacity: 1;
}

.nav-link.active {
  background-color: var(--sidebar-active-bg);
  color: #ffffff;
  font-weight: 600;
  opacity: 1;
  border-left: 3px solid var(--emerald-accent);
}

.nav-icon {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

/* Sidebar Footer / Controls */
.sidebar-footer {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--sidebar-text-primary);
  font-size: 0.85rem;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background-color 0.2s;
}

.footer-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Main Pane */
.main-pane {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-secondary);
}

/* Main Header */
.main-header {
  height: 70px;
  padding: 16px 24px;
  background-color: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.menu-toggle-btn {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 16px;
  background: none;
  border: none;
  cursor: pointer;
}

.menu-toggle-btn span {
  width: 100%;
  height: 2px;
  background-color: var(--text-primary);
  border-radius: 1px;
}

.header-titles {
  display: flex;
  flex-direction: column;
}

.active-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.active-section-subtitle {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.header-right {
  position: relative;
}

/* View Controls Panel */
.control-panel-trigger {
  padding: 8px 14px;
  border-radius: 30px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: background-color 0.2s, transform 0.1s;
}

.control-panel-trigger:hover {
  background-color: var(--bg-secondary);
}

.control-panel-trigger:active {
  transform: scale(0.97);
}

.controls-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  gap: 16px;
  z-index: 60;
}

.controls-dropdown.show {
  display: flex;
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.control-item label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}

.slider-container {
  display: flex;
  align-items: center;
  gap: 10px;
}

.size-indicator {
  font-weight: bold;
}

.size-indicator.small {
  font-size: 0.8rem;
}

.size-indicator.large {
  font-size: 1.3rem;
}

#fontSizeSlider {
  flex: 1;
  accent-color: var(--emerald-primary);
  cursor: pointer;
}

#fontFamilySelect {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.88rem;
  cursor: pointer;
}

.theme-item-mobile {
  display: none;
  flex-direction: row;
  gap: 8px;
}

.dropdown-btn {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
}

/* Reading Window */
.reading-window {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.section-container {
  width: 100%;
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-bottom: 80px; /* space for mobile nav or page bottom */
}

/* Litany Progress Bar styling */
.progress-bar-container {
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 10px 24px;
  z-index: 40;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.progress-track {
  width: 100%;
  height: 6px;
  background-color: var(--bg-secondary);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background-color: var(--emerald-primary);
  border-radius: 3px;
  transition: width 0.1s ease-out;
}

/* General Card Styles */
.info-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  line-height: 1.6;
}

.info-card p {
  margin-bottom: 12px;
  text-wrap: pretty;
}

.info-card p:last-child {
  margin-bottom: 0;
}

.section-title-tag {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--emerald-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

/* Arabic Text Typography */
.arabic-text {
  font-family: var(--arabic-font-family, 'Amiri', serif);
  font-weight: 400;
  text-align: center;
  direction: rtl;
  line-height: 2.2; /* Increased for Rasm Uthmani readability */
  margin-bottom: 12px;
  color: var(--text-arabic);
  text-wrap: pretty;
  transition: font-size 0.2s ease, font-family 0.2s ease;
}

/* Translation Text Typography */
.translation-text {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 0.9rem;
  line-height: 1.55;
  text-align: center;
  color: var(--text-secondary);
  margin-top: 6px;
  margin-bottom: 6px;
  direction: ltr;
  text-wrap: pretty;
  font-style: italic;
  max-width: 100%;
}

/* Adab Points Style */
.adab-category {
  margin-bottom: 24px;
}

.adab-category:last-child {
  margin-bottom: 0;
}

.adab-category-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--emerald-primary);
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 6px;
}

.adab-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.adab-item {
  position: relative;
  padding-left: 24px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.adab-item::before {
  content: "✦";
  position: absolute;
  left: 4px;
  color: var(--gold-accent);
}

/* Signatories for Pledge */
.signatories-container {
  display: flex;
  justify-content: space-around;
  margin-top: 30px;
  gap: 20px;
}

.signatory-box {
  flex: 1;
  text-align: center;
  padding: 16px;
  border: 1px dashed var(--border-color);
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.signatory-box strong {
  display: block;
  margin-bottom: 40px;
  color: var(--text-primary);
}

/* Interactive Zikr Cards */
.zikr-card {
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: 20px;
  padding: 30px 24px 20px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
  user-select: none;
  touch-action: manipulation; /* Block double-tap zoom for instant mobile clicks */
}

.zikr-card:hover {
  border-color: rgba(4, 120, 87, 0.4);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.zikr-card:active {
  transform: scale(0.99) translateY(0);
}

/* Zikr Card Completed State */
.zikr-card.completed {
  background-color: var(--bg-card-completed);
  border-color: var(--border-completed);
  box-shadow: 0 0 15px rgba(4, 120, 87, 0.1);
}

.zikr-card.completed::after {
  content: "✓";
  position: absolute;
  top: 16px;
  right: 16px;
  background-color: var(--emerald-primary);
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes popIn {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* Intent/Niat card header style */
.niat-card {
  background: linear-gradient(135deg, rgba(4, 120, 87, 0.05) 0%, rgba(217, 119, 6, 0.05) 100%);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
}

.niat-title {
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--emerald-primary);
  margin-bottom: 12px;
  letter-spacing: 0.05em;
}

/* Zikr Controls inside cards */
.zikr-card-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 20px;
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
  gap: 16px;
}

.counter-trigger-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.count-badge {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 30px;
  letter-spacing: 0.02em;
}

/* Circular Increment Dial */
.counter-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.zikr-card:hover .counter-btn {
  background-color: var(--emerald-primary);
  color: white;
  border-color: var(--emerald-primary);
}

.zikr-card.completed .counter-btn {
  background-color: var(--emerald-primary);
  color: white;
  border-color: var(--emerald-primary);
}

/* Reset button for individual card */
.reset-card-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  opacity: 0.6;
  transition: opacity 0.2s, background-color 0.2s;
}

.reset-card-btn:hover {
  opacity: 1;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

/* Dedications/Hadrah style */
.dedication-card {
  border-left: 4px solid var(--gold-accent);
  background-color: var(--bg-card);
  padding: 16px 20px;
  border-radius: 0 12px 12px 0;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}

.dedication-number {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-accent);
  margin-bottom: 6px;
}

/* Section footer controls */
.section-footer-actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  margin-bottom: 40px;
}

.action-btn-large {
  padding: 12px 24px;
  border-radius: 30px;
  background-color: var(--bg-card);
  border: 2px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 8px;
}

.action-btn-large:hover {
  border-color: var(--emerald-primary);
  color: var(--emerald-primary);
  transform: translateY(-1px);
}

/* Weekly Schedule Grid */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.schedule-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.schedule-card.today {
  border: 2px solid var(--gold-accent);
  background-color: rgba(217, 119, 6, 0.04);
}

.schedule-card.today::after {
  content: "Hari Ini";
  position: absolute;
  top: 12px;
  right: 12px;
  background-color: var(--gold-accent);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}

.schedule-day {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.schedule-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--emerald-primary);
}

.schedule-page {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: auto;
}

/* Rules / Guidelines List */
.rules-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  list-style: none;
}

.rule-item {
  position: relative;
  padding-left: 28px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.rule-item::before {
  content: "•";
  position: absolute;
  left: 10px;
  color: var(--emerald-primary);
  font-size: 1.5rem;
  line-height: 0.8;
}

/* Group Majlis Protocol Steps */
.protocol-step {
  display: flex;
  gap: 16px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  color: var(--emerald-primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-text {
  font-size: 0.92rem;
  line-height: 1.5;
}

/* Full Quran Surah Toggle */
.quran-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.full-surah-btn {
  padding: 8px 16px;
  border-radius: 20px;
  background-color: var(--emerald-primary);
  border: none;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s;
}

.full-surah-btn:hover {
  opacity: 0.9;
}

.full-surah-btn:active {
  transform: scale(0.97);
}

.quran-verse-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.quran-verse-item {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.verse-meta {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Loader style */
.loader {
  border: 3px solid var(--border-color);
  border-top: 3px solid var(--emerald-primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  display: inline-block;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mobile Layout Adaptations */
.mobile-bottom-nav {
  display: none;
  height: 60px;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  grid-template-columns: repeat(4, 1fr);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.05);
}

.mobile-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.7rem;
  gap: 4px;
  font-weight: 500;
}

.mobile-nav-link.active {
  color: var(--emerald-primary);
  font-weight: 600;
}

.mobile-nav-icon {
  font-size: 1.15rem;
}

/* Dynamic Quran Menu in Mobile bottom nav */
.quran-menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  width: 100%;
}

.quran-menu-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

.quran-menu-card:hover {
  border-color: var(--emerald-primary);
  transform: translateY(-2px);
}

.quran-menu-card .icon {
  font-size: 1.5rem;
  margin-bottom: 8px;
  display: block;
}

.quran-menu-card .title {
  font-size: 0.85rem;
  font-weight: 600;
}

/* Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 90;
}

/* Responsive adjustments */
@media (max-width: 820px) {
  .app-container {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 280px;
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .app-sidebar.show {
    transform: translateX(0);
  }

  .close-sidebar-btn {
    display: block;
    width: 48px;
    height: 48px;
    line-height: 44px;
  }

  .menu-toggle-btn {
    display: flex;
    padding: 10px; /* larger tap target */
  }

  .mobile-bottom-nav {
    display: grid;
  }

  /* Mobile reading spacing optimizations */
  .reading-window {
    padding: 14px 10px;
  }

  .section-container {
    padding-bottom: 90px; /* space for bottom nav */
    gap: 16px;
  }

  .zikr-card {
    padding: 22px 16px 16px 16px;
    border-radius: 16px;
  }

  .arabic-text {
    line-height: 2.1;
    margin-bottom: 10px;
  }

  .translation-text {
    font-size: 0.82rem;
    margin-top: 6px;
  }

  .quran-verse-item {
    padding: 16px 12px;
    border-radius: 8px;
  }

  .info-card {
    padding: 18px 14px;
    border-radius: 12px;
  }

  .theme-item-mobile {
    display: flex;
  }

  .sidebar-footer {
    display: none; /* hidden since settings are moved to header dropdown on mobile */
  }
}

/* Hide translation helper */
body.hide-translations .translation-text {
  display: none !important;
}

/* Hide counter helper */
body.hide-counters .counter-trigger-wrapper,
body.hide-counters .section-footer-actions {
  display: none !important;
}

/* Weekly card links visual pointer */
.schedule-card {
  cursor: pointer;
  transition: all 0.2s ease;
}

.schedule-card:hover {
  border-color: var(--emerald-primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* Homepage Dashboard Styling */
.home-dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.welcome-card {
  background: linear-gradient(135deg, var(--sidebar-bg) 0%, #064e3b 100%);
  color: white;
  padding: 36px 24px;
  border-radius: 20px;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.welcome-card::before {
  content: "";
  position: absolute;
  top: -50px;
  left: -50px;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.welcome-logo {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--emerald-accent);
  margin: 0 auto 16px auto;
  object-fit: cover;
  box-shadow: 0 0 15px rgba(52, 211, 153, 0.3);
  display: block;
}

.welcome-card h2 {
  font-family: 'Amiri', serif;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--sidebar-text-primary);
}

.welcome-card p {
  font-size: 0.95rem;
  color: var(--sidebar-text-secondary);
  line-height: 1.6;
  max-width: 540px;
  margin: 0 auto;
}

.dashboard-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  border-left: 3px solid var(--emerald-primary);
  padding-left: 8px;
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.shortcut-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.shortcut-card .icon {
  font-size: 1.8rem;
  margin-bottom: 4px;
}

.shortcut-card h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.shortcut-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.shortcut-card .progress-indicator {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--emerald-primary);
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
}

/* Quranic Tabs styles */
.quranic-tabs .tab-btn {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.quranic-tabs .tab-btn:hover {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.quranic-tabs .tab-btn.active {
  background-color: var(--emerald-primary);
  border-color: var(--emerald-primary);
  color: white !important;
}

body.dark-mode .quranic-tabs .tab-btn.active {
  background-color: var(--emerald-accent);
  border-color: var(--emerald-accent);
  color: var(--bg-primary) !important;
}

