/* ========================================
   DASHBOARD
======================================== */

/* === Layout Principal === */
.dashboard-main-content {
  margin-left: 0; /* Pas de margin ici, géré par .page-no-welcome */
  padding: var(--spacing-lg) var(--spacing-md);
  min-height: 100vh;
  background-color: var(--background-color);
  position: relative;
  font-family: var(--main-font);
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Header Dashboard === */
.dashboard-header {
  text-align: center;
  margin-bottom: 30px;
  padding: 20px 0;
}

.dashboard-header h1 {
  margin: 0 !important;
  font-size: 28px !important;
  font-weight: 700 !important;
  color: var(--primary-color) !important;
  text-align: center !important;
  font-family: var(--main-font) !important;
}

/* === Style standard pour tous les titres h1 des pages === */

.page h1 {
  text-align: center !important;
  font-size: 28px !important;
  font-family: var(--main-font) !important;
  color: var(--primary-color) !important;
  margin-bottom: var(--spacing-md);
  font-weight: 700 !important;
}

/* Exclusion du dashboard qui a son propre header moderne */
.dashboard-main-content h1:not(.dashboard-header h1) {
  text-align: center !important;
  font-size: 28px !important;
  font-family: var(--main-font) !important;
  color: var(--primary-color) !important;
  margin-bottom: var(--spacing-md);
  font-weight: 700 !important;
}

/* === Page Back Button (Return to Dashboard) === */
.page-header-wrapper {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: 20px;
  padding: 20px 0;
}

.page-back-btn {
  position: absolute;
  left: 15%;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: #3d6a8a;
  border: none;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0.9rem 0.4rem 0.65rem;
  border-radius: 999px;
  transition: background-color 0.15s ease;
  font-family: inherit;
}

.page-back-btn:hover {
  background: var(--primary-color);
}

.page-back-btn svg {
  width: 16px;
  height: 16px;
  stroke: white;
  stroke-width: 1.5;
}

/* For pages with centered headers, the content stays centered */
.page-header-content {
  text-align: center;
  flex: 1;
  max-width: 800px;
}

.page-header-content h1 {
  margin: 0 !important;
}

.page-header-content p {
  margin: 0.5rem 0 0 0;
  color: var(--gray-color);
  font-size: 0.95rem;
}

/* Header icons within page-header-content */
.page-header-content .apprentissage-header-icon,
.page-header-content .surahmemorization-header-icon,
.page-header-content .mosquetime-header-icon,
.page-header-content .surahselector-header-icon,
.page-header-content .dua-header-icon,
.page-header-content .tikrar-header-icon,
.page-header-content .add-mosque-header-icon,
.page-header-content .contact-page-header-icon {
  margin: 0 auto 0.75rem auto;
}

/* Mobile responsiveness for back button */
@media (max-width: 768px) {
  .page-back-btn {
    padding: 0.35rem;
  }

  .page-back-btn span {
    display: none;
  }

  .page-back-btn svg {
    width: 18px;
    height: 18px;
  }

  .page-back-btn svg {
    width: 16px;
    height: 16px;
  }
}

/* === Boutons TopNav intégrés dans le Dashboard === */
.dashboard-topnav-buttons {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
  z-index: 10;
}

/* === Messaging Button intégré === */
.dashboard-messaging-link {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  text-decoration: none;
  position: relative;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 6px rgba(39, 76, 119, 0.06);
  color: var(--text-color);
  font-family: var(--main-font);
  font-weight: 600;
}

.dashboard-messaging-link:hover {
  background: linear-gradient(90deg, rgba(96, 150, 186, 0.12) 0%, rgba(163, 206, 241, 0.08) 100%);
  border-color: var(--secondary-color);
  box-shadow: 0 2px 8px rgba(39, 76, 119, 0.1);
  color: var(--primary-color);
  transform: translateX(4px);
}

.dashboard-messaging-link:hover .dashboard-messaging-icon {
  color: var(--primary-color);
}

.dashboard-messaging-icon {
  width: 20px;
  height: 20px;
  cursor: pointer;
  color: var(--text-color);
  transition: all 0.3s ease;
}

/* === Message Counter intégré === */
.dashboard-messaging-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background-color: var(--error-color);
  color: white;
  font-size: 0.65rem;
  font-weight: bold;
  border-radius: 50%;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: cc-pulse 2s ease-in-out infinite;
  box-shadow: 0 0 0 2px var(--card-background), var(--shadow-sm);
  pointer-events: none;
}

@keyframes cc-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

/* === Profile Section intégrée === */
.dashboard-profile-section {
  position: relative;
}

.dashboard-profile-button {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  padding: var(--spacing-sm) var(--spacing-md);
  cursor: pointer;
  border-radius: var(--border-radius-md);
  color: var(--text-color);
  font-family: var(--main-font);
  font-size: var(--text-size);
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(39, 76, 119, 0.05);
  position: relative;
  overflow: hidden;
}

.dashboard-profile-settings-icon {
  width: 20px;
  height: 20px;
  color: var(--text-color);
  transition: all 0.3s ease;
}

.dashboard-profile-button:hover {
  background: linear-gradient(90deg, rgba(96, 150, 186, 0.12) 0%, rgba(163, 206, 241, 0.08) 100%);
  color: var(--primary-color);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(39, 76, 119, 0.1);
  border-color: var(--secondary-color);
}

.dashboard-profile-button:hover .dashboard-profile-settings-icon {
  color: var(--primary-color);
  transform: rotate(90deg);
}

.dashboard-profile-icon {
  width: 16px;
  height: 16px;
  transition: transform 0.3s ease, color 0.3s ease;
  color: var(--text-color);
}

.dashboard-profile-button.active .dashboard-profile-icon {
  transform: rotate(180deg);
  color: var(--primary-color);
}

/* === Profile Dropdown intégré === */
.dashboard-profile-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: 0 8px 24px rgba(39, 76, 119, 0.12);
  min-width: 240px;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
  overflow: hidden;
  padding: var(--spacing-xs) 0;
}

.dashboard-profile-dropdown::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.dashboard-profile-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* === Styles pour les éléments du dropdown === */
.dropdown-item {
  padding: var(--spacing-sm) var(--spacing-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  font-family: var(--main-font);
  font-weight: 600;
  position: relative;
  margin: 2px var(--spacing-sm);
  border-radius: var(--border-radius-md);
  font-size: 0.95rem;
  letter-spacing: -0.01em;
}

.dropdown-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  transform: scaleY(0);
  transition: transform 0.3s ease;
  border-radius: 0 3px 3px 0;
}

.dropdown-item:hover {
  background: linear-gradient(90deg, rgba(96, 150, 186, 0.12) 0%, rgba(163, 206, 241, 0.08) 100%);
  color: var(--primary-color);
  transform: translateX(4px);
  padding-left: calc(var(--spacing-md) + 4px);
}

.dropdown-item:hover::before {
  transform: scaleY(1);
}

.dropdown-divider {
  border-top: 1px solid var(--border-color);
  margin: var(--spacing-sm) var(--spacing-md);
  opacity: 0.5;
}

/* === Sélecteur de langue dans le dropdown === */
.dropdown-item .language-selector {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
}

.dropdown-item .language-selector .lang-btn {
  font-size: 1.8rem;
  background: none;
  border: 1px solid var(--border-color);
  cursor: pointer;
  padding: 0.5rem;
  min-width: 48px;
  min-height: 40px;
  border-radius: var(--border-radius-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.dropdown-item .language-selector .lang-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(96, 150, 186, 0.15) 0%, rgba(163, 206, 241, 0.1) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.dropdown-item .language-selector .lang-btn:hover {
  border-color: var(--secondary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(39, 76, 119, 0.1);
}

.dropdown-item .language-selector .lang-btn:hover::before {
  opacity: 1;
}

.dropdown-item .language-selector .lang-btn.active {
  background: var(--gradient-primary-var);
  border-color: var(--secondary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(39, 76, 119, 0.2);
}

/* === Contrôles Menu (pour mobile) === */
.dashboard-menu-btn {
  display: none;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: var(--spacing-sm);
  border-radius: var(--border-radius-md);
  cursor: pointer;
  margin-bottom: var(--spacing-md);
}

/* === Grille des Cartes === */
.dashboard-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--spacing-lg);
  margin: 0;
  max-width: 100%;
}

/* === Cartes Dashboard === */
.dashboard-card {
  background-color: var(--card-background);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-lg);
  text-align: center;
  box-shadow: 0 2px 8px rgba(39, 76, 119, 0.08);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
  position: relative;
  overflow: hidden;
}

.dashboard-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(96, 150, 186, 0.2);
  border-color: rgba(96, 150, 186, 0.4);
}

.dashboard-card img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 0;
  transition: transform 0.3s ease, filter 0.3s ease;
  position: relative;
  z-index: 1;
}

.dashboard-card:hover img {
  transform: scale(1.05);
}

.dashboard-card h2 {
  font-family: var(--main-font);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: var(--title-line-height);
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.dashboard-card:hover h2 {
  transform: scale(1.1);
}

/* === Tikrar Card (Quran Memorization) === */
.dashboard-card.tikrar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.dashboard-card.tikrar-card .tikrar-calligraphy-title {
  font-family: 'Scheherazade New', 'Amiri', serif;
  font-size: 2.5rem;
  color: var(--primary-color);
  direction: rtl;
  margin: 0;
  padding: 0.5rem;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.dashboard-card.tikrar-card:hover .tikrar-calligraphy-title {
  transform: scale(1.1);
}

.dashboard-card.tikrar-card .tikrar-card-subtitle {
  font-family: var(--main-font);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: var(--title-line-height);
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.dashboard-card.tikrar-card:hover .tikrar-card-subtitle {
  transform: scale(1.1);
}

/* === Hadith Card (40 Hadiths An-Nawawi) === */
.dashboard-card.hadith-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.dashboard-card.hadith-card img {
  width: 81px;
  height: 81px;
}

/* === Arabic Learning Card === */
.dashboard-card.arabic-learning-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.dashboard-card.arabic-learning-card .arabic-calligraphy-title {
  font-family: 'Scheherazade New', 'Amiri', serif;
  font-size: 2.5rem;
  color: var(--primary-color);
  direction: rtl;
  margin: 0;
  padding: 0.5rem;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.dashboard-card.arabic-learning-card:hover .arabic-calligraphy-title {
  transform: scale(1.1);
}

.dashboard-card.arabic-learning-card .arabic-card-subtitle {
  font-family: var(--main-font);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: var(--title-line-height);
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.dashboard-card.arabic-learning-card:hover .arabic-card-subtitle {
  transform: scale(1.1);
}

/* === Supervision Card === */
.dashboard-card.supervision-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

.dashboard-card.supervision-card .supervision-calligraphy-title {
  font-family: 'Scheherazade New', 'Amiri', serif;
  font-size: 2.5rem;
  color: var(--primary-color);
  direction: rtl;
  margin: 0;
  padding: 0.5rem;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.dashboard-card.supervision-card:hover .supervision-calligraphy-title {
  transform: scale(1.1);
}

.dashboard-card.supervision-card .supervision-card-subtitle {
  font-family: var(--main-font);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: var(--title-line-height);
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.dashboard-card.supervision-card:hover .supervision-card-subtitle {
  transform: scale(1.1);
}

/* Salat card */
.dashboard-card.salat-card .salat-calligraphy-title {
  font-family: 'Scheherazade New', 'Amiri', serif;
  font-size: 2.5rem;
  color: var(--primary-color);
  direction: rtl;
  margin: 0;
  padding: 0.5rem;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.dashboard-card.salat-card:hover .salat-calligraphy-title {
  transform: scale(1.1);
}

.dashboard-card.salat-card .salat-card-subtitle {
  font-family: var(--main-font);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.01em;
  margin: 0;
  line-height: var(--title-line-height);
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.dashboard-card.salat-card:hover .salat-card-subtitle {
  transform: scale(1.1);
}

/* === Coming Soon Cards === */
.dashboard-card.coming-soon,
.collection-card.coming-soon {
  position: relative;
  opacity: 0.85;
  filter: grayscale(15%);
  cursor: default;
  pointer-events: auto;
}

.dashboard-card.coming-soon:hover,
.collection-card.coming-soon:hover {
  transform: none;
  box-shadow: var(--card-shadow);
}

.dashboard-card.coming-soon.sponsored {
  opacity: 1;
  filter: none;
  cursor: pointer;
}

.dashboard-card.coming-soon.sponsored:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

.coming-soon-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(255, 152, 0, 0.3);
}

.sponsor-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
  color: white;
  font-size: 0.6rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 0.75rem;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(76, 175, 80, 0.3);
  max-width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sponsor-btn {
  position: absolute;
  bottom: 0.5rem;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  border: none;
  padding: 0.4rem 1rem;
  border-radius: var(--border-radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.sponsor-btn:hover {
  transform: translateX(-50%) scale(1.05);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.dashboard-card.coming-soon.sponsored .sponsor-btn,
.dashboard-card.coming-soon.sponsored .coming-soon-badge {
  display: none;
}

/* Coming Soon for collection cards (landing pages) */
.arabic-book-card .book-info {
  margin-bottom: 0.4rem;
}

.arabic-book-card .book-count {
  margin-top: 0.5rem;
}

.arabic-book-card.coming-soon {
  position: relative;
  opacity: 0.9;
  cursor: default;
}

.arabic-book-card.coming-soon:hover {
  transform: none;
}

.arabic-book-card .coming-soon-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.arabic-book-card .pending-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: linear-gradient(135deg, #607d8b 0%, #455a64 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.25rem 0.6rem;
  border-radius: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.arabic-book-card .sponsor-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.arabic-book-card .collection-sponsor-btn {
  align-self: center;
  margin-top: 0.1rem;
  padding: 0.6rem 1.8rem;
  font-size: 0.9rem;
  font-weight: 600;
  background: linear-gradient(135deg, #c16060 0%, #d66b6b 100%);
  color: white;
  border: none;
  border-radius: 2rem;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(193, 96, 96, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
  position: relative;
}

/* Shimmer effect - uses transform for GPU acceleration */
.arabic-book-card .collection-sponsor-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 25%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    transparent 100%
  );
  transform: translateX(-200%);
  will-change: transform;
  animation: sponsor-shimmer 3s ease-in-out infinite;
}

@keyframes sponsor-shimmer {
  0% {
    transform: translateX(-200%);
  }
  100% {
    transform: translateX(200%);
  }
}

.arabic-book-card .collection-sponsor-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #d66b6b 0%, #e07878 100%);
  box-shadow: 0 6px 20px rgba(214, 107, 107, 0.5);
}

.arabic-book-card .collection-sponsor-btn:hover::before {
  animation-play-state: paused;
}

.arabic-book-card .sponsor-desc {
  display: none;
}

/* === Bundle Card (Tome de Médine Parties 1-5) === */
.arabic-book-card.bundle-card {
  background: #ffffff;
  color: #2c3e50;
  border: 1px solid rgba(39, 76, 119, 0.12);
  box-shadow: 0 2px 12px rgba(39, 76, 119, 0.08);
}

.arabic-book-card.bundle-card:hover {
  box-shadow: 0 2px 12px rgba(39, 76, 119, 0.08);
}

.arabic-book-card.bundle-card .bundle-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1rem;
  background: var(--arabic-blue-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.arabic-book-card.bundle-card .bundle-icon svg {
  width: 28px;
  height: 28px;
  stroke: white;
}

.arabic-book-card.bundle-card .arabic-book-number {
  color: #2c3e50;
}

.arabic-book-card.bundle-card .arabic-book-title {
  color: #5a6a7a;
}

/* === Dua Theme Cards (Per-Theme Sponsorship) === */
.dua-theme-card {
  position: relative;
  min-height: 200px;
  padding-bottom: 4.5rem;
}

.dua-theme-card .book-info {
  margin-bottom: 1.25rem;
}

.dua-theme-card.coming-soon-card {
  opacity: 0.85;
  cursor: default;
}

.dua-theme-card.coming-soon-card:hover {
  transform: none;
  box-shadow: var(--card-shadow);
}

.dua-theme-card[data-status="sponsored"] {
  cursor: pointer;
  opacity: 1;
}

.dua-theme-card[data-status="sponsored"]:hover {
  transform: translateY(-4px);
  box-shadow: var(--card-shadow-hover);
}

/* Sponsor badge variations for dua themes */
.dua-theme-card .sponsor-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.3rem 0.6rem;
  border-radius: 1rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  z-index: 2;
}

.dua-theme-card .sponsor-badge.sponsored {
  background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.4);
}

.dua-theme-card .sponsor-badge.soon {
  background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.4);
}

.dua-theme-card .sponsor-badge.pending {
  background: linear-gradient(135deg, #9e9e9e 0%, #757575 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(158, 158, 158, 0.4);
}

/* Theme sponsor button */
.dua-theme-card .theme-sponsor-btn {
  position: absolute;
  bottom: 0.6rem;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: fit-content;
  padding: 0.45rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  background: linear-gradient(135deg, #c16060 0%, #d66b6b 100%);
  color: white;
  border: none;
  border-radius: 1.5rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(193, 96, 96, 0.35);
  transition: box-shadow 0.2s ease, background 0.2s ease, transform 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
}

.dua-theme-card .theme-sponsor-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.2) 25%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    transparent 100%
  );
  transform: translateX(-200%);
  animation: sponsor-shimmer 2.5s infinite;
}

.dua-theme-card .theme-sponsor-btn:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #d66b6b 0%, #e07878 100%);
  box-shadow: 0 4px 12px rgba(214, 107, 107, 0.5);
}

.dua-theme-card .theme-sponsor-btn:hover::before {
  animation-play-state: paused;
}

/* Responsive adjustments for dua theme grid */
@media (max-width: 768px) {
  .dua-theme-card {
    min-height: 180px;
    padding-bottom: 4rem;
  }

  .dua-theme-card .theme-sponsor-btn {
    padding: 0.4rem 0.85rem;
    font-size: 0.7rem;
  }

  .dua-theme-card .sponsor-badge {
    font-size: 0.65rem;
    padding: 0.25rem 0.5rem;
  }
}

/* Coming Soon Collection Card (full page) */
.coming-soon-collection {
  display: flex;
  justify-content: center;
  padding: 2rem;
}

.coming-soon-card {
  position: relative;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem 2rem;
  text-align: center;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--card-shadow);
}

.coming-soon-card .coming-soon-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
}

.coming-soon-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, rgba(96, 150, 186, 0.1) 0%, rgba(39, 76, 119, 0.05) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-color);
}

.coming-soon-icon svg {
  width: 32px;
  height: 32px;
}

.coming-soon-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 0.5rem 0;
}

.coming-soon-subtitle {
  font-size: 1rem;
  color: var(--primary-color);
  margin: 0 0 1rem 0;
  font-weight: 500;
}

.coming-soon-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 1.5rem 0;
}

.coming-soon-card .sponsor-btn {
  position: relative;
  transform: none;
  left: auto;
  bottom: auto;
  padding: 0.75rem 2rem;
  font-size: 1rem;
}

/* === Sponsor Modal === */
.sponsor-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none; /* shown via inline style in sponsorModalService.open() */
  align-items: center;
  justify-content: center;
}

.sponsor-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(59, 89, 122, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9998;
}

.sponsor-modal-content {
  position: relative;
  background: var(--card-background, #ffffff);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem 2rem 2rem 2rem;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
  z-index: 10000;
  isolation: isolate;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sponsor-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--text-secondary);
  transition: color 0.2s;
}

.sponsor-modal-close:hover {
  color: var(--text-primary);
}

.sponsor-modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0 0 0.75rem 0;
  padding-right: 2rem;
}

.sponsor-modal-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0 0 0.5rem 0;
  line-height: 1.5;
}

.sponsor-modal-benefits {
  color: var(--text-primary);
  font-size: 0.85rem;
  margin: 0 0 1rem 0;
  line-height: 1.8;
  white-space: pre-line;
}

.sponsor-modal-note {
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-style: italic;
  margin: 1rem 0 0 0;
  line-height: 1.5;
  text-align: center;
  opacity: 0.9;
}

.sponsor-module-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  background: var(--background-color);
  border-radius: var(--border-radius-sm);
  margin-bottom: 1.5rem;
}

.sponsor-module-name {
  font-weight: 600;
  color: var(--text-primary);
}

.sponsor-module-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
}

.sponsor-form {
  margin-bottom: 1.5rem;
}

.sponsor-form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.sponsor-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 0.95rem;
  background: var(--background-color);
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.sponsor-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
}

.sponsor-form-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.sponsor-submit-btn {
  display: block;
  width: 100%;
  padding: 0.875rem;
  background: linear-gradient(135deg, #274c77 0%, #1a3a5c 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 1rem;
}

.sponsor-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.sponsor-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* === Sponsor Progress Bar === */
.sponsor-progress {
  margin-bottom: 1rem;
}

.sponsor-progress-bar {
  height: 8px;
  background: var(--border-color, #e0e0e0);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}

.sponsor-progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
  border-radius: 4px;
  transition: width 0.5s ease;
}

.sponsor-progress-text {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* === Sponsor Contributors List === */
.sponsor-contributors {
  margin-bottom: 1rem;
}

.sponsor-contributors-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.4rem 0;
}

.sponsor-contributors-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 100px;
  overflow-y: auto;
  background: var(--background-color);
  border-radius: var(--border-radius-sm);
  padding: 0.5rem 0.75rem;
}

.sponsor-contributors-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.25rem 0;
  font-size: 0.8rem;
}

.sponsor-contributors-list li + li {
  border-top: 1px solid var(--border-color, #eee);
}

.contributor-name {
  color: var(--text-primary);
}

.contributor-amount {
  font-weight: 600;
  color: var(--primary-color);
}

/* === Sponsor Action Buttons === */
.sponsor-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.sponsor-full-btn {
  display: block;
  width: 100%;
  padding: 0.875rem;
  background: linear-gradient(135deg, #274c77 0%, #1a3a5c 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sponsor-full-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.sponsor-full-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.sponsor-contribute-btn {
  display: block;
  width: 100%;
  padding: 0.75rem;
  background: linear-gradient(135deg, #e07c5a 0%, #c0583a 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sponsor-contribute-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(224, 124, 90, 0.3);
}

/* === Sponsor Contribution Form === */
.sponsor-contribution-form {
  margin-top: 1rem;
}

.sponsor-contribution-separator {
  height: 1px;
  background: var(--border-color, #e0e0e0);
  margin-bottom: 1rem;
}

.sponsor-amount-input-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sponsor-amount-currency {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sponsor-amount-input {
  flex: 1;
}

/* === Collecting Badge (on cards) === */
.sponsor-badge.collecting {
  background: linear-gradient(135deg, #f9a825 0%, #f57f17 100%);
  color: #fff;
  box-shadow: 0 2px 4px rgba(249, 168, 37, 0.3);
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  white-space: nowrap;
}

/* === Card Progress Bar (mini, on cards) === */
.card-progress-bar {
  height: 4px;
  background: var(--border-color, #e0e0e0);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 0.5rem;
}

.card-progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%);
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* === Error Report Modal === */
.error-report-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  justify-content: center;
  align-items: center;
}

.error-report-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}

.error-report-modal-content {
  position: relative;
  background: var(--color-surface, var(--card-background, #fff));
  border-radius: 16px;
  padding: 24px;
  max-width: 420px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: errorReportModalSlideIn 0.3s ease-out;
}

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

.error-report-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  color: var(--text-secondary, #666);
  transition: background-color 0.2s, color 0.2s;
}

.error-report-modal-close:hover {
  background: var(--color-surface-hover, #f0f0f0);
  color: var(--text-primary, #333);
}

.error-report-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 8px 0;
  padding-right: 32px;
  color: var(--text-primary, #333);
}

.error-report-modal-desc {
  font-size: 0.875rem;
  color: var(--text-secondary, #666);
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.error-report-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--color-surface-secondary, #f5f5f5);
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 0.875rem;
}

.error-report-module-name {
  font-weight: 500;
  color: var(--text-primary, #333);
}

.error-report-item-id {
  color: var(--text-secondary, #666);
}

.error-report-form-group {
  margin-bottom: 16px;
}

.error-report-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary, #333);
  margin-bottom: 6px;
}

.error-report-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 8px;
  font-size: 0.9375rem;
  color: var(--text-primary, #333);
  background: var(--color-surface, var(--card-background, #fff));
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.error-report-select:focus {
  outline: none;
  border-color: var(--primary, #4a90d9);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.error-report-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color, #ddd);
  border-radius: 8px;
  font-size: 0.9375rem;
  color: var(--text-primary, #333);
  background: var(--color-surface, var(--card-background, #fff));
  resize: vertical;
  min-height: 80px;
  max-height: 200px;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.error-report-textarea:focus {
  outline: none;
  border-color: var(--primary, #4a90d9);
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.error-report-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-tertiary, #999);
  margin-top: 4px;
}

.error-report-submit-btn {
  width: 100%;
  padding: 12px 16px;
  background: var(--primary, #4a90d9);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.2s, transform 0.1s;
}

.error-report-submit-btn:hover:not(:disabled) {
  background: var(--primary-dark, #3a7bc8);
}

.error-report-submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Error Report Button in Flashcard Review - positioned relative to flashcard-container */
.flashcard-container {
  position: relative;
}

.error-report-btn {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: rgba(220, 53, 69, 0.15);
  border: 2px solid #dc3545;
  border-radius: 50%;
  color: #dc3545;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.error-report-btn:hover {
  background: #dc3545;
  color: white;
  transform: scale(1.1);
  box-shadow: 0 3px 10px rgba(220, 53, 69, 0.4);
}

.error-report-btn svg {
  width: 16px;
  height: 16px;
}

/* Dark mode for error report modal */
[data-theme="dark"] .error-report-modal-content {
  background: var(--card-background, #1e1e1e);
}

[data-theme="dark"] .error-report-modal-title,
[data-theme="dark"] .error-report-label,
[data-theme="dark"] .error-report-module-name {
  color: var(--text-primary, #e0e0e0);
}

[data-theme="dark"] .error-report-modal-desc,
[data-theme="dark"] .error-report-item-id,
[data-theme="dark"] .error-report-modal-close {
  color: var(--text-secondary, #a0a0a0);
}

[data-theme="dark"] .error-report-item-info {
  background: var(--color-surface-secondary, #2a2a2a);
}

[data-theme="dark"] .error-report-select,
[data-theme="dark"] .error-report-textarea {
  background: var(--card-background, #1e1e1e);
  border-color: var(--border-color, #404040);
  color: var(--text-primary, #e0e0e0);
}

[data-theme="dark"] .error-report-btn {
  background: rgba(220, 53, 69, 0.15);
  border-color: #dc3545;
  color: #ff6b7a;
}

[data-theme="dark"] .error-report-btn:hover {
  background: #dc3545;
  color: white;
}

/* === Timer Stats Widget (inline in unified stats) === */
.timer-stats-widget {
  padding-top: 16px;
  border-top: 1px solid var(--border-color, #e2e8f0);
}

.timer-stats-header {
  margin-bottom: 12px;
}

.timer-stats-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary, #64748b);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
  font-family: var(--main-font);
}

.timer-stats-title svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--primary-color, #4f46e5);
}

.timer-stats-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.timer-stats-card {
  background: var(--bg-secondary, #f8fafc);
  border-radius: 10px;
  padding: 12px 10px;
  text-align: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timer-stats-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.timer-stats-card-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--primary-color, #4f46e5);
  margin-bottom: 6px;
}

.timer-stats-card-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 8px;
}

.timer-stats-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  border-radius: 6px;
  padding: 2px;
  cursor: pointer;
  color: var(--text-secondary, #64748b);
  transition: all 0.2s;
  flex-shrink: 0;
}

.timer-stats-nav-btn:hover:not(:disabled) {
  color: var(--primary-color, #4f46e5);
  background: var(--primary-light, #e0e7ff);
}

.timer-stats-nav-btn:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.timer-stats-date {
  font-size: 0.72rem;
  color: var(--text-secondary, #64748b);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timer-stats-metrics {
  display: flex;
  justify-content: center;
  gap: 20px;
}

.timer-stats-metric {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.timer-stats-metric-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary, #1a1a2e);
  line-height: 1.2;
}

.timer-stats-metric-label {
  font-size: 0.7rem;
  color: var(--text-secondary, #64748b);
}

/* Timer Stats Dark Mode */
[data-theme="dark"] .timer-stats-widget {
  border-top-color: var(--border-color-dark, #334155);
}

[data-theme="dark"] .timer-stats-card {
  background: var(--bg-secondary-dark, #334155);
}

[data-theme="dark"] .timer-stats-title {
  color: var(--text-secondary-dark, #94a3b8);
}

[data-theme="dark"] .timer-stats-metric-value {
  color: var(--text-primary-dark, #f1f5f9);
}

[data-theme="dark"] .timer-stats-date,
[data-theme="dark"] .timer-stats-metric-label,
[data-theme="dark"] .timer-stats-nav-btn {
  color: var(--text-secondary-dark, #94a3b8);
}

[data-theme="dark"] .timer-stats-nav-btn:hover:not(:disabled) {
  color: var(--primary-color, #4f46e5);
  background: rgba(79, 70, 229, 0.15);
}

/* Timer Stats Responsive */
@media (max-width: 640px) {
  .timer-stats-cards {
    grid-template-columns: 1fr;
  }
}

/* === Tahajud Widget Section === */
.tahajud-widget-section {
  margin: 0;
}

.tahajud-widget-container {
  background: linear-gradient(135deg, rgba(96, 150, 186, 0.08) 0%, rgba(39, 76, 119, 0.04) 100%);
  border: 1px solid rgba(96, 150, 186, 0.2);
  border-radius: var(--border-radius-lg);
  padding: 0;
  max-width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
}

.tahajud-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid rgba(96, 150, 186, 0.15);
}

.tahajud-title-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.tahajud-icon-img {
  width: 28px;
  height: 28px;
}

.tahajud-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--primary-color);
}

.tahajud-header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.tahajud-info-btn,
.tahajud-settings-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.tahajud-info-btn:hover,
.tahajud-settings-btn:hover {
  background: var(--background-color);
  color: var(--primary-color);
}

.tahajud-info-btn svg,
.tahajud-settings-btn svg {
  width: 18px;
  height: 18px;
}

/* Info Popover */
.tahajud-info-popover {
  position: absolute;
  left: 0;
  z-index: 50;
  width: max(100%, 420px);
  padding: var(--spacing-xs) var(--spacing-md);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.tahajud-info-popover-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.tahajud-info-popover-arrow {
  position: absolute;
  top: 2px;
  right: 44px;
  width: 10px;
  height: 10px;
  background: var(--card-background);
  border-top: 1px solid rgba(96, 150, 186, 0.25);
  border-left: 1px solid rgba(96, 150, 186, 0.25);
  transform: rotate(45deg);
  z-index: 1;
}

.tahajud-info-popover-content {
  background: var(--card-background);
  border: 1px solid rgba(96, 150, 186, 0.25);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.tahajud-info-popover-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 6px 0;
  letter-spacing: 0.01em;
}

.tahajud-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tahajud-info-list li {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-secondary);
  padding: 2px 0;
  padding-left: calc(var(--spacing-sm) + 6px);
  position: relative;
  font-family: var(--main-font);
}

.tahajud-info-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.tahajud-info-item-purpose::before {
  background: var(--primary-color);
}

.tahajud-info-item-howto::before {
  background: var(--accent-color, #f0ad4e);
}

.tahajud-info-item-times::before {
  background: var(--success-color, #5cb85c);
}

.tahajud-display {
  padding: var(--spacing-lg);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-background);
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
  flex: 1;
}

/* Loading State */
.tahajud-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tahajud-loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: tahajud-spin 0.8s linear infinite;
}

@keyframes tahajud-spin {
  to { transform: rotate(360deg); }
}

/* Unconfigured State */
.tahajud-unconfigured {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
  text-align: center;
  padding: var(--spacing-sm) 0;
}

.tahajud-unconfigured .tahajud-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(96, 150, 186, 0.1);
  border-radius: 50%;
}

.tahajud-unconfigured .tahajud-icon svg {
  width: 28px;
  height: 28px;
  color: var(--primary-color);
}

.tahajud-setup-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
  max-width: 200px;
  line-height: 1.4;
}

.tahajud-configure-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tahajud-configure-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.tahajud-configure-btn svg {
  width: 16px;
  height: 16px;
}

/* Configured State */
.tahajud-configured {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
  width: 100%;
}

.tahajud-main-time {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tahajud-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tahajud-time {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  font-family: var(--main-font);
}

.tahajud-secondary {
  display: flex;
  justify-content: space-between;
  width: 100%;
  padding-top: var(--spacing-sm);
  border-top: 1px solid var(--border-color);
}

.tahajud-fajr {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.tahajud-secondary-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.tahajud-secondary-time {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tahajud-location {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.tahajud-location svg {
  width: 14px;
  height: 14px;
}

/* Prayer Times Grid - Two Rows Layout */
.tahajud-times-row {
  display: flex;
  justify-content: space-around;
  width: 100%;
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--border-color);
}

.tahajud-times-row:first-child {
  border-top: 1px solid var(--border-color);
}

.tahajud-highlight-row {
  background: rgba(39, 76, 119, 0.05);
}

.tahajud-time-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 80px;
}

.tahajud-time-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Main item with Tahajud title and Last Third subtitle */
.tahajud-main-item {
  gap: 0;
}

.tahajud-time-label-main {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-color);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
}

.tahajud-time-label-sub {
  font-size: 0.6rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-top: -2px;
  text-align: center;
}

.tahajud-time-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tahajud-time-value.tahajud-highlight {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.2rem;
}

.tahajud-location-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  padding-top: var(--spacing-sm);
}

.tahajud-location-row svg {
  width: 14px;
  height: 14px;
}

/* Error State */
.tahajud-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
  text-align: center;
  color: var(--danger-color);
}

.tahajud-error svg {
  width: 32px;
  height: 32px;
}

.tahajud-error p {
  margin: 0;
  font-size: 0.9rem;
}

.tahajud-retry-btn {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs) var(--spacing-sm);
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  border-radius: var(--border-radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tahajud-retry-btn:hover {
  background: var(--primary-color);
  color: white;
}

.tahajud-retry-btn svg {
  width: 14px;
  height: 14px;
}

/* === Tahajud Modal === */
.tahajud-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tahajud-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.tahajud-modal-content {
  position: relative;
  background: var(--card-background);
  border-radius: var(--border-radius-lg);
  padding: var(--spacing-xl);
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  animation: tahajud-modal-in 0.2s ease-out;
}

@keyframes tahajud-modal-in {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tahajud-modal-close {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.tahajud-modal-close:hover {
  background: var(--background-color);
  color: var(--text-primary);
}

.tahajud-modal-close svg {
  width: 20px;
  height: 20px;
}

.tahajud-modal-title {
  margin: 0 0 var(--spacing-lg) 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tahajud-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
}

.tahajud-form-group {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

.tahajud-form-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.tahajud-radio-group {
  display: flex;
  gap: var(--spacing-md);
}

.tahajud-radio-label {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.tahajud-radio-label input[type="radio"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-color);
}

.tahajud-input,
.tahajud-select {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  font-size: 0.9rem;
  background: var(--background-color);
  color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tahajud-input:focus,
.tahajud-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(96, 150, 186, 0.1);
}

.tahajud-location-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--background-color);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tahajud-location-btn:hover:not(:disabled) {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.tahajud-location-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.tahajud-location-btn svg {
  width: 18px;
  height: 18px;
}

.tahajud-coords-display {
  margin-top: var(--spacing-sm);
  padding: var(--spacing-sm);
  background: var(--background-color);
  border-radius: var(--border-radius-sm);
  text-align: center;
}

.tahajud-city-name {
  display: block;
  font-weight: 500;
  color: var(--text-primary);
}

.tahajud-coords-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.tahajud-save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  width: 100%;
  padding: var(--spacing-md);
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius-md);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: var(--spacing-sm);
}

.tahajud-save-btn:hover:not(:disabled) {
  background: var(--primary-dark);
}

.tahajud-save-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.tahajud-save-btn svg {
  width: 18px;
  height: 18px;
}

.tahajud-btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: tahajud-spin 0.8s linear infinite;
}

/* Tahajud Widget Responsive */
@media (max-width: 768px) {
  .tahajud-widget-container {
    max-width: 100%;
  }

  .tahajud-time {
    font-size: 1.75rem;
  }

  .tahajud-modal-content {
    padding: var(--spacing-lg);
  }

  .tahajud-header {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .tahajud-display {
    padding: var(--spacing-md);
    min-height: 100px;
  }
}

@media (max-width: 480px) {
  .tahajud-info-popover {
    width: calc(100vw - 2rem);
    left: 0;
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  .tahajud-info-popover-content {
    padding: var(--spacing-sm);
  }

  .tahajud-info-popover-arrow {
    right: 32px;
  }

  .tahajud-info-list li {
    font-size: 0.78rem;
  }
}

/* ========================================
   DASHBOARD WIDGETS ROW (Side by side)
======================================== */

.dashboard-widgets-row {
  display: flex;
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  align-items: stretch;
}

.dashboard-widgets-row > * {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Mobile: stack widgets vertically */
@media (max-width: 768px) {
  .dashboard-widgets-row {
    flex-direction: column;
  }
}

/* Subscription Goals Widget Container */
.dashboard-subscription-goals {
  display: flex;
}

.dashboard-subscription-goals:empty {
  display: none;
}

/* ========================================
   SURAH SELECTOR WIDGET
======================================== */

.surah-widget-section {
  margin: 0;
}

.surah-widget-container {
  background: linear-gradient(135deg, rgba(96, 150, 186, 0.08) 0%, rgba(39, 76, 119, 0.04) 100%);
  border: 1px solid rgba(96, 150, 186, 0.2);
  border-radius: var(--border-radius-lg);
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: visible;
}

.surah-widget-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-md) var(--spacing-lg);
  border-bottom: 1px solid rgba(96, 150, 186, 0.15);
}

.surah-widget-title-row {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.surah-widget-icon-img {
  width: 28px;
  height: 28px;
}

.surah-widget-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  color: var(--primary-color);
}

.surah-widget-header-actions {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.surah-widget-info-btn,
.surah-widget-settings-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: var(--border-radius-sm);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.surah-widget-info-btn:hover,
.surah-widget-settings-btn:hover {
  background: var(--background-color);
  color: var(--primary-color);
}

.surah-widget-info-btn svg,
.surah-widget-settings-btn svg {
  width: 18px;
  height: 18px;
}

/* Info Popover */
.surah-widget-info-popover {
  position: absolute;
  left: 0;
  z-index: 50;
  width: max(100%, 420px);
  padding: var(--spacing-xs) var(--spacing-md);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.surah-widget-info-popover-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.surah-widget-info-popover-arrow {
  position: absolute;
  top: 2px;
  right: 44px;
  width: 10px;
  height: 10px;
  background: var(--card-background);
  border-top: 1px solid rgba(96, 150, 186, 0.25);
  border-left: 1px solid rgba(96, 150, 186, 0.25);
  transform: rotate(45deg);
  z-index: 1;
}

.surah-widget-info-popover-content {
  background: var(--card-background);
  border: 1px solid rgba(96, 150, 186, 0.25);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-sm) var(--spacing-lg) var(--spacing-sm);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.surah-widget-info-popover-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--primary-color);
  margin: 0 0 6px 0;
  letter-spacing: 0.01em;
}

.surah-widget-info-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.surah-widget-info-list li {
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--text-secondary);
  padding: 2px 0;
  padding-left: calc(var(--spacing-sm) + 6px);
  position: relative;
  font-family: var(--main-font);
}

.surah-widget-info-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.surah-widget-info-item-purpose::before {
  background: var(--primary-color);
}

.surah-widget-info-item-howto::before {
  background: var(--accent-color, #f0ad4e);
}

.surah-widget-info-item-times::before {
  background: var(--success-color, #5cb85c);
}

.surah-widget-display {
  padding: var(--spacing-lg);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--card-background);
  border-radius: 0 0 var(--border-radius-lg) var(--border-radius-lg);
  flex: 1;
}

/* Loading State */
.surah-widget-loading {
  display: flex;
  align-items: center;
  justify-content: center;
}

.surah-widget-loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: surah-widget-spin 0.8s linear infinite;
}

@keyframes surah-widget-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Unconfigured State */
.surah-widget-unconfigured {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  width: 100%;
}

.surah-widget-unconfigured .surah-widget-icon {
  width: 48px;
  height: 48px;
  background: rgba(96, 150, 186, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.surah-widget-unconfigured .surah-widget-icon svg {
  width: 24px;
  height: 24px;
  color: var(--primary-color);
}

.surah-widget-setup-text {
  margin: 0;
  color: var(--gray-color);
  font-size: var(--small-text-size);
}

.surah-widget-configure-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--border-radius-md);
  font-size: var(--small-text-size);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.surah-widget-configure-btn:hover {
  background: var(--secondary-color);
}

.surah-widget-configure-btn svg {
  width: 16px;
  height: 16px;
}

/* Configured State */
.surah-widget-configured {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  width: 100%;
}

.surah-widget-counter-row {
  display: flex;
  align-items: center;
  justify-content: center;
}

.surah-widget-counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(96, 150, 186, 0.15);
  color: var(--primary-color);
  padding: var(--spacing-xs) var(--spacing-md);
  border-radius: var(--border-radius-lg);
  font-size: var(--small-text-size);
  font-weight: 600;
}

.surah-widget-counter-badge svg {
  width: 16px;
  height: 16px;
}

/* Raka Times Row - Same style as Tahajud */
.surah-widget-times-row {
  display: flex;
  justify-content: space-around;
  width: 100%;
  padding: var(--spacing-sm) 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  background: rgba(39, 76, 119, 0.05);
  margin-bottom: 0;
}

.surah-widget-time-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 100px;
}

.surah-widget-time-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.surah-widget-time-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.surah-widget-time-value.surah-widget-placeholder {
  color: var(--gray-color);
  font-weight: 400;
}

/* Start Praying Button Container - Centered */
.surah-widget-start-container {
  display: flex;
  justify-content: center;
  padding: 4px 0;
}

/* Start Praying Button - Circle style */
.surah-widget-start-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  padding: 0;
  background: white;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
}

.surah-widget-start-btn .surah-widget-start-text {
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}

.surah-widget-start-btn .surah-widget-praying-text {
  font-size: 10px;
  font-weight: 500;
  line-height: 1;
  margin-top: 2px;
}

.surah-widget-start-btn:hover:not(:disabled) {
  transform: scale(1.05);
  background: var(--primary-color);
  color: white;
}

.surah-widget-start-btn:active:not(:disabled) {
  transform: scale(0.95);
}

.surah-widget-start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


/* Modal Styles */
.surah-widget-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-md);
}

.surah-widget-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.surah-widget-modal-content {
  position: relative;
  background: var(--card-background);
  border-radius: var(--border-radius-xl);
  padding: var(--spacing-xl);
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: surah-widget-modal-appear 0.3s ease;
}

@keyframes surah-widget-modal-appear {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.surah-widget-modal-close {
  position: absolute;
  top: var(--spacing-md);
  right: var(--spacing-md);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs);
  border-radius: 50%;
  transition: background var(--transition-fast);
}

.surah-widget-modal-close:hover {
  background: var(--light-background);
}

.surah-widget-modal-close svg {
  width: 24px;
  height: 24px;
  color: var(--gray-color);
}

.surah-widget-modal-title {
  margin: 0 0 var(--spacing-lg) 0;
  font-size: 1.25rem;
  color: var(--primary-color);
  font-weight: 600;
}

.surah-widget-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-md);
  flex: 1;
  overflow: hidden;
}

/* Search Input */
.surah-widget-search-group {
  position: relative;
}

.surah-widget-search-icon {
  position: absolute;
  left: var(--spacing-md);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--gray-color);
}

input.surah-widget-search-input {
  width: 100%;
  padding: var(--spacing-sm) var(--spacing-md);
  padding-left: 40px !important;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  font-size: var(--text-size);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  box-sizing: border-box;
}

.surah-widget-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(39, 76, 119, 0.1);
}

/* Counter */
.surah-widget-counter {
  text-align: center;
  font-size: var(--small-text-size);
  color: var(--gray-color);
}

.surah-widget-counter #surah-widget-selected-count {
  font-weight: 700;
  color: var(--primary-color);
  font-size: 1.1rem;
}

/* Surah List */
.surah-widget-list {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: var(--spacing-sm);
  max-height: 350px;
}

.surah-widget-list-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.surah-widget-list-item:hover {
  background: var(--light-background);
}

.surah-widget-list-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary-color);
}

.surah-widget-list-item label {
  flex: 1;
  cursor: pointer;
  font-size: var(--small-text-size);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.surah-widget-surah-name {
  color: var(--text-color);
}

.surah-widget-surah-arabic {
  color: var(--gray-color);
  font-size: 0.9em;
}

/* Save Button */
.surah-widget-save-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  width: 100%;
  padding: var(--spacing-md);
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--border-radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  margin-top: var(--spacing-sm);
}

.surah-widget-save-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.surah-widget-save-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.surah-widget-save-btn svg {
  width: 18px;
  height: 18px;
}

.surah-widget-btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: surah-widget-spin 0.8s linear infinite;
}

/* Dashboard Widgets Row Responsive */
@media (max-width: 768px) {
  .dashboard-widgets-row {
    flex-direction: column;
  }

  .dashboard-widgets-row > * {
    max-width: 100%;
  }

  .surah-widget-container,
  .tahajud-widget-container {
    max-width: 100%;
  }

  .surah-widget-modal-content {
    padding: var(--spacing-lg);
    max-height: 85vh;
  }

  .surah-widget-header {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .surah-widget-display {
    padding: var(--spacing-md);
    min-height: 100px;
  }

  .surah-widget-list {
    max-height: 280px;
  }
}

@media (max-width: 480px) {
  .surah-widget-info-popover {
    width: calc(100vw - 2rem);
    left: 0;
    padding: var(--spacing-xs) var(--spacing-sm);
  }

  .surah-widget-info-popover-content {
    padding: var(--spacing-sm);
  }

  .surah-widget-info-popover-arrow {
    right: 32px;
  }

  .surah-widget-info-list li {
    font-size: 0.78rem;
  }
}

/* ========================================
   DASHBOARD - RESPONSIVE
======================================== */

/* === Breakpoint XXL (1245px) === */
@media (max-width: 1245px) {
  .dashboard-card h2,
  .dashboard-card .tikrar-card-subtitle,
  .dashboard-card .hadith-card-subtitle,
  .dashboard-card .dua-card-subtitle,
  .dashboard-card .arabic-card-subtitle,
  .dashboard-card .supervision-card-subtitle {
    font-size: 1rem;
  }
}

/* === Breakpoint XL (1200px) === */
@media (max-width: 1200px) {
  .dashboard-main-content {
    padding: var(--spacing-lg);
    grid-template-columns: 1fr 300px;
  }
}

/* === Responsive des boutons intégrés === */
@media (max-width: 1024px) {
  .dashboard-topnav-buttons {
    gap: var(--spacing-md);
  }

  .dashboard-main-content {
    margin-left: 0;
    padding: var(--spacing-md);
  }

  .dashboard-header {
    margin-bottom: 20px;
    padding: 20px 0;
  }

  .dashboard-header h1 {
    font-size: 24px !important;
    color: var(--primary-color) !important;
  }

  .page h1 {
    font-size: 1.375rem !important;
    font-family: var(--main-font) !important;
    text-align: center !important;
  }

  /* Exclusion du dashboard qui a son propre header moderne */
  .dashboard-main-content h1:not(.dashboard-header h1) {
    font-size: 1.375rem !important;
    font-family: var(--main-font) !important;
    text-align: center !important;
  }
}

@media (max-width: 768px) {
  .dashboard-topnav-buttons {
    flex-direction: row;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
  }

  .dashboard-messaging-link,
  .dashboard-profile-button {
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--small-text-size);
  }

  .dashboard-profile-dropdown {
    right: 0;
    left: auto;
    min-width: 180px;
  }

  .dashboard-header {
    margin-bottom: 15px;
    padding: 15px 0;
  }

  .dashboard-header h1 {
    font-size: 22px !important;
    color: var(--primary-color) !important;
  }
}

/* === Grille des Cartes === */
.dashboard-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-md);
}

.dashboard-card {
  padding: var(--spacing-md);
}

.dashboard-card img {
  width: 64px;
  height: 64px;
}

.dashboard-card h2 {
  font-size: 1.1rem;
}

.dashboard-menu-btn {
  display: block;
}

/* Styles pour sidebar mobile (si nécessaire) */
.dashboard-sidebar {
  transform: translateX(-100%);
}

.dashboard-sidebar.open {
  transform: translateX(0);
}

.dashboard-close-btn {
  display: block;
}

/* === Breakpoint MD (768px) === */
@media (max-width: 768px) {
  .dashboard-card h2,
  .dashboard-card .tikrar-card-subtitle,
  .dashboard-card .hadith-card-subtitle,
  .dashboard-card .dua-card-subtitle,
  .dashboard-card .arabic-card-subtitle,
  .dashboard-card .supervision-card-subtitle {
    font-size: 0.9rem;
  }

  .dashboard-card-grid {
    gap: var(--spacing-sm);
  }

  .dashboard-main-content {
    padding: var(--spacing-sm);
  }

  /* === MosqueTime Welcome Responsive LG === */
  .welcome-mosquetime-grid {
    grid-template-columns: 1fr;
  }

  .welcome-mosquetime-controls {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .welcomepage-mosque-time .mosquetime-location-search,
  .welcome-mosquetime-location-search {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .welcomepage-mosque-time .prayer-times-grid,
  .welcomepage-mosque-time .additional-times-grid {
    gap: 0.5rem;
    padding: 6px 0;
  }

  .welcomepage-mosque-time .prayer-item {
    padding: 0.65rem;
  }
}

/* === Breakpoint MD (768px) === */
@media (max-width: 768px) {
  .welcomepage-container {
    width: 95vw;
  }

  .mosquetime-sort-buttons {
    flex-direction: row; /* Boutons alignés horizontalement */
    justify-content: flex-start; /* Alignement à gauche */
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
    flex-wrap: wrap; /* Permet le retour à la ligne si nécessaire */
  }

  .mosquetime-sort-buttons .mosquetime-button {
    flex: none; /* Les boutons gardent leur taille naturelle */
    padding: 0.5rem 1rem;
    font-size: var(--small-text-size);
    white-space: nowrap; /* Empêche le texte de se couper */
  }

  .mosquetime-card {
    width: 100%;
    padding: 0;
  }

  .welcomepage-mosque-time .mosque-name {
    font-size: 1rem;
    padding: var(--spacing-xs) var(--spacing-xs) 0 var(--spacing-xs);
    margin: 0 0 0 var(--spacing-xs);
  }

  .welcomepage-mosque-time .mosque-address {
    font-size: 0.8rem;
    margin: 0 0 var(--spacing-xs) var(--spacing-xs);
  }

  #welcome-mosquetime-grid {
    width: 100%;
    padding: 0;
  }

  #welcome-mosquetime-grid .mosquetime-mosque-card {
    width: 100%;
    padding: var(--spacing-sm);
    margin: var(--spacing-xs);
  }

  .mosquetime-location-search {
    padding: var(--spacing-sm) 0;
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .welcomepage-mosque-time .mosquetime-content {
    padding: 0;
  }

  .welcomepage-mosque-time .mosquetime-location-search {
    flex-direction: column;
    gap: var(--spacing-md);
  }

  .welcomepage-mosque-time .mosquetime-sort-buttons {
    flex-direction: row; /* Boutons alignés horizontalement */
    justify-content: flex-start; /* Alignement à gauche */
    gap: var(--spacing-sm);
    flex-wrap: wrap; /* Permet le retour à la ligne si nécessaire */
  }

  .welcomepage-mosque-time .mosquetime-sort-buttons .mosquetime-button {
    flex: none; /* Les boutons gardent leur taille naturelle */
    padding: 0.5rem 1rem;
    font-size: var(--small-text-size);
    white-space: nowrap; /* Empêche le texte de se couper */
  }

  .mosque-prayer-times .prayer-times-grid {
    padding-top: var(--spacing-xs);
  }

  .welcomepage-mosque-time .mosque-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
  }

  .welcomepage-mosque-time .mosque-info {
    flex: 1;
  }

  .welcomepage-mosque-time .prayer-times-grid,
  .welcomepage-mosque-time .additional-times-grid {
    grid-template-columns: repeat(5, 1fr);
    background: var(--card-background);
    border-radius: var(--border-radius-md);
    margin-bottom: 0;
  }
}

/* === Breakpoint XS (480px) === */
@media (max-width: 480px) {
  .dashboard-header {
    margin-bottom: 10px;
    padding: 10px 0;
  }

  .dashboard-header h1 {
    font-size: 20px !important;
    color: var(--primary-color) !important;
  }

  .dashboard-card-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--spacing-sm);
  }

  .dashboard-card h2,
  .dashboard-card .tikrar-card-subtitle,
  .dashboard-card .hadith-card-subtitle,
  .dashboard-card .dua-card-subtitle,
  .dashboard-card .arabic-card-subtitle,
  .dashboard-card .supervision-card-subtitle {
    margin-top: -0.5rem;
    font-size: 0.7rem;
  }

  .dashboard-card {
    padding: var(--spacing-sm);
  }

  .dashboard-card img {
    width: 48px;
    height: 48px;
  }
}

