/* ============================================
   المسلم - Al-Muslim Islamic Web App
   Design System & Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Cairo:wght@300;400;600;700;800&family=Noto+Naskh+Arabic:wght@400;500;600;700&display=swap');

/* ============================================
   CSS Custom Properties (Theme)
   ============================================ */
:root {
  /* Primary Palette - Calming Green */
  --primary-50: #E8F5E9;
  --primary-100: #C8E6C9;
  --primary-200: #A5D6A7;
  --primary-300: #81C784;
  --primary-400: #66BB6A;
  --primary-500: #4CAF50;
  --primary-600: #43A047;
  --primary-700: #388E3C;
  --primary-800: #2E7D32;
  --primary-900: #1B5E20;

  /* Gold Accents */
  --gold-100: #FFF8E1;
  --gold-200: #FFECB3;
  --gold-300: #FFD54F;
  --gold-400: #FFCA28;
  --gold-500: #FFC107;
  --gold-600: #C6930A;

  /* Blue Accents */
  --blue-400: #42A5F5;
  --blue-500: #1E88E5;
  --blue-600: #1565C0;

  /* Neutrals */
  --neutral-50: #FAFAFA;
  --neutral-100: #F5F5F5;
  --neutral-200: #EEEEEE;
  --neutral-300: #E0E0E0;
  --neutral-400: #BDBDBD;
  --neutral-500: #9E9E9E;
  --neutral-600: #757575;
  --neutral-700: #616161;
  --neutral-800: #424242;
  --neutral-900: #212121;

  /* Warm Beige */
  --beige-50: #FDF8F0;
  --beige-100: #F5F0E8;
  --beige-200: #EDE5D8;

  /* Semantic Colors */
  --bg-primary: var(--beige-50);
  --bg-secondary: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-nav: rgba(255, 255, 255, 0.92);
  --text-primary: var(--neutral-900);
  --text-secondary: var(--neutral-600);
  --text-muted: var(--neutral-400);
  --accent: var(--primary-700);
  --accent-light: var(--primary-100);
  --accent-glow: rgba(76, 175, 80, 0.3);
  --border: var(--neutral-200);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-xl: 0 12px 40px rgba(0,0,0,0.15);

  /* Typography */
  --font-ui: 'Cairo', 'Segoe UI', sans-serif;
  --font-quran: 'Amiri', 'Noto Naskh Arabic', serif;
  --font-arabic: 'Noto Naskh Arabic', 'Amiri', serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Border Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 50%;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Layout */
  --nav-height: 70px;
  --header-height: 60px;
  --max-width: 480px;
}

/* Dark Mode */
[data-theme="dark"] {
  --bg-primary: #0D1B0E;
  --bg-secondary: #132614;
  --bg-card: #1A3A1C;
  --bg-nav: rgba(13, 27, 14, 0.95);
  --text-primary: #E8F5E9;
  --text-secondary: #A5D6A7;
  --text-muted: #66BB6A;
  --accent: var(--primary-400);
  --accent-light: rgba(76, 175, 80, 0.15);
  --accent-glow: rgba(76, 175, 80, 0.4);
  --border: rgba(76, 175, 80, 0.15);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
  --shadow-xl: 0 12px 40px rgba(0,0,0,0.6);
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-primary);
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Background Pattern */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: 
    radial-gradient(circle at 20% 20%, var(--accent-glow) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(21, 101, 192, 0.1) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

a {
  text-decoration: none;
  color: inherit;
}

button {
  border: none;
  background: none;
  font-family: inherit;
  cursor: pointer;
  color: inherit;
}

img {
  max-width: 100%;
  height: auto;
}

ul, ol {
  list-style: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

/* ============================================
   App Shell
   ============================================ */
#app {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(var(--nav-height) + 20px);
}

.page {
  display: none;
  padding: var(--space-md);
  animation: pageIn 0.4s ease;
  min-height: calc(100vh - var(--nav-height));
  min-height: calc(100dvh - var(--nav-height));
}

.page.active {
  display: block;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   Header Bar
   ============================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  margin-bottom: var(--space-md);
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.page-header .header-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

/* ============================================
   Bottom Navigation
   ============================================ */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  height: var(--nav-height);
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  padding: 0 var(--space-sm);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  position: relative;
  -webkit-tap-highlight-color: transparent;
  min-width: 56px;
}

.nav-item svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: all var(--transition-fast);
}

.nav-item span {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  white-space: nowrap;
}

.nav-item.active {
  background: var(--accent-light);
}

.nav-item.active svg {
  stroke: var(--accent);
  filter: drop-shadow(0 0 6px var(--accent-glow));
}

.nav-item.active span {
  color: var(--accent);
}

.nav-item:hover:not(.active) {
  background: rgba(0,0,0,0.03);
}

[data-theme="dark"] .nav-item:hover:not(.active) {
  background: rgba(255,255,255,0.05);
}

/* ============================================
   Cards
   ============================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: all var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.card-header .icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.card-green .icon { background: var(--primary-50); color: var(--primary-700); }
.card-gold .icon { background: var(--gold-100); color: var(--gold-600); }
.card-blue .icon { background: #E3F2FD; color: var(--blue-600); }

[data-theme="dark"] .card-green .icon { background: rgba(76,175,80,0.15); }
[data-theme="dark"] .card-gold .icon { background: rgba(255,193,7,0.15); }
[data-theme="dark"] .card-blue .icon { background: rgba(30,136,229,0.15); }

/* ============================================
   HOME PAGE
   ============================================ */

/* Greeting & Date */
.home-greeting {
  text-align: center;
  padding: var(--space-lg) 0;
}

.home-greeting .bismillah {
  font-family: var(--font-quran);
  font-size: 1.8rem;
  color: var(--accent);
  margin-bottom: var(--space-sm);
  opacity: 0.9;
}

.home-greeting .greeting-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.home-greeting .date-hijri {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.home-greeting .date-miladi {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Next Prayer Hero */
.next-prayer-card {
  background: linear-gradient(135deg, var(--primary-800), var(--primary-600));
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  color: white;
  text-align: center;
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-lg);
  box-shadow: 0 8px 32px rgba(27, 94, 32, 0.3);
}

[data-theme="dark"] .next-prayer-card {
  background: linear-gradient(135deg, #0D3B0F, #1A5C1D);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.next-prayer-card::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.next-prayer-card::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -20%;
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
  border-radius: 50%;
}

.next-prayer-label {
  font-size: 0.85rem;
  opacity: 0.85;
  margin-bottom: var(--space-xs);
  font-weight: 600;
}

.next-prayer-name {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: var(--space-xs);
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.next-prayer-time {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-bottom: var(--space-md);
}

.countdown-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  direction: ltr;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown-unit .number {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  min-width: 48px;
  text-align: center;
}

.countdown-unit .label {
  font-size: 0.65rem;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.countdown-separator {
  font-size: 1.5rem;
  opacity: 0.5;
  margin-top: -14px;
}

/* Prayer Times Grid */
.prayer-times-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.prayer-time-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-sm);
  text-align: center;
  transition: all var(--transition-fast);
}

.prayer-time-item.current {
  background: var(--accent-light);
  border-color: var(--accent);
}

.prayer-time-item .prayer-icon {
  font-size: 1.3rem;
  margin-bottom: var(--space-xs);
}

.prayer-time-item .prayer-name {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.prayer-time-item .prayer-time {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  direction: ltr;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.quick-action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.quick-action-btn:active {
  transform: scale(0.97);
}

.quick-action-btn .action-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.quick-action-btn .action-text {
  font-size: 0.82rem;
  font-weight: 600;
}

.action-green { background: var(--primary-50); color: var(--primary-700); }
.action-gold { background: var(--gold-100); color: var(--gold-600); }
.action-blue { background: #E3F2FD; color: var(--blue-600); }
.action-purple { background: #F3E5F5; color: #7B1FA2; }

[data-theme="dark"] .action-green { background: rgba(76,175,80,0.15); }
[data-theme="dark"] .action-gold { background: rgba(255,193,7,0.15); }
[data-theme="dark"] .action-blue { background: rgba(30,136,229,0.15); }
[data-theme="dark"] .action-purple { background: rgba(123,31,162,0.15); }

/* Daily Suggestion */
.daily-suggestion {
  background: linear-gradient(135deg, var(--gold-100), var(--beige-100));
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--gold-200);
}

[data-theme="dark"] .daily-suggestion {
  background: linear-gradient(135deg, rgba(255,193,7,0.1), rgba(255,193,7,0.05));
  border-color: rgba(255,193,7,0.2);
}

.daily-suggestion .suggestion-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold-600);
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.daily-suggestion .suggestion-text {
  font-family: var(--font-quran);
  font-size: 1.2rem;
  line-height: 2;
  color: var(--text-primary);
}

.daily-suggestion .suggestion-source {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* ============================================
   QURAN PAGE
   ============================================ */
.quran-controls {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.surah-selector {
  flex: 1;
  min-width: 150px;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 600;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239E9E9E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  direction: rtl;
}

.quran-search-input {
  flex: 1;
  min-width: 120px;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  direction: rtl;
}

.quran-search-input::placeholder {
  color: var(--text-muted);
}

/* Surah Header */
.surah-header {
  text-align: center;
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}

.surah-header .bismillah-text {
  font-family: var(--font-quran);
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.surah-header .surah-name {
  font-family: var(--font-quran);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
}

.surah-header .surah-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Ayah Display */
.ayah-container {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  margin-bottom: var(--space-md);
}

.ayah-text {
  font-family: var(--font-quran);
  font-size: 1.6rem;
  line-height: 2.4;
  color: var(--text-primary);
  text-align: justify;
  word-spacing: 3px;
}

.ayah-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-full);
  font-family: var(--font-ui);
  font-size: 0.75rem;
  font-weight: 700;
  margin: 0 4px;
  vertical-align: middle;
}

.ayah-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.ayah-action-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  border: 1px solid var(--border);
}

.ayah-action-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

.ayah-action-btn.favorited {
  background: var(--gold-100);
  color: var(--gold-600);
  border-color: var(--gold-300);
}

/* Quran Audio Player */
.quran-audio-player {
  position: sticky;
  bottom: calc(var(--nav-height) + 8px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-lg);
  z-index: 100;
  display: none;
}

.quran-audio-player.visible {
  display: block;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.audio-player-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.audio-now-playing {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.audio-reciter-name {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  justify-content: center;
}

.audio-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.audio-btn.play-btn {
  width: 48px;
  height: 48px;
  background: var(--accent);
  color: white;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.audio-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.audio-btn.play-btn:hover {
  background: var(--primary-600);
  color: white;
}

.audio-progress {
  width: 100%;
  height: 4px;
  background: var(--neutral-200);
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
}

[data-theme="dark"] .audio-progress {
  background: rgba(255,255,255,0.1);
}

.audio-progress-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  width: 0%;
  transition: width 0.1s linear;
}

/* Reciter Selection Modal */
.reciter-select {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-ui);
  direction: rtl;
}

/* ============================================
   AZKAR PAGE
   ============================================ */
.azkar-categories {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-lg);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.azkar-categories::-webkit-scrollbar {
  display: none;
}

.azkar-category-btn {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.azkar-category-btn.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.azkar-category-btn:hover:not(.active) {
  border-color: var(--accent);
  color: var(--accent);
}

/* Dhikr Card */
.dhikr-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.dhikr-card.completed {
  opacity: 0.5;
  border-color: var(--accent);
}

.dhikr-card.completed::after {
  content: '✓';
  position: absolute;
  top: var(--space-md);
  left: var(--space-md);
  width: 28px;
  height: 28px;
  background: var(--accent);
  color: white;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

.dhikr-text {
  font-family: var(--font-arabic);
  font-size: 1.2rem;
  line-height: 2.2;
  color: var(--text-primary);
  margin-bottom: var(--space-md);
}

.dhikr-reference {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.dhikr-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
}

.counter-circle {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  position: relative;
}

.counter-circle:active {
  transform: scale(0.92);
  background: var(--accent);
  color: white;
}

.counter-info {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.counter-progress {
  position: absolute;
  inset: -3px;
  border-radius: var(--radius-full);
}

.counter-progress svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.counter-progress circle {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-dasharray: 226;
  stroke-dashoffset: 226;
  transition: stroke-dashoffset var(--transition-fast);
}

/* ============================================
   LIVE QURAN PAGE
   ============================================ */
.live-hero {
  background: linear-gradient(135deg, var(--blue-600), var(--primary-800));
  border-radius: var(--radius-xl);
  padding: var(--space-xl);
  color: white;
  text-align: center;
  margin-bottom: var(--space-lg);
  position: relative;
  overflow: hidden;
}

[data-theme="dark"] .live-hero {
  background: linear-gradient(135deg, #0A2647, #0D3B0F);
}

.live-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Ccircle cx='50' cy='50' r='40' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='0.5'/%3E%3Ccircle cx='50' cy='50' r='30' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='0.5'/%3E%3Ccircle cx='50' cy='50' r='20' fill='none' stroke='rgba(255,255,255,0.05)' stroke-width='0.5'/%3E%3C/svg%3E");
  background-size: 150px;
  opacity: 0.5;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 4px 12px;
  background: rgba(244,67,54,0.9);
  border-radius: var(--radius-xl);
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  position: relative;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  animation: livePulse 1.5s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.live-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: var(--space-xs);
  position: relative;
}

.live-subtitle {
  font-size: 0.85rem;
  opacity: 0.8;
  position: relative;
}

/* Waveform Animation */
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 40px;
  margin: var(--space-md) 0;
  position: relative;
}

.waveform .bar {
  width: 4px;
  background: rgba(255,255,255,0.7);
  border-radius: 2px;
  animation: wave 1.2s ease-in-out infinite;
}

.waveform .bar:nth-child(1) { height: 40%; animation-delay: 0s; }
.waveform .bar:nth-child(2) { height: 70%; animation-delay: 0.1s; }
.waveform .bar:nth-child(3) { height: 50%; animation-delay: 0.2s; }
.waveform .bar:nth-child(4) { height: 90%; animation-delay: 0.3s; }
.waveform .bar:nth-child(5) { height: 60%; animation-delay: 0.4s; }
.waveform .bar:nth-child(6) { height: 80%; animation-delay: 0.5s; }
.waveform .bar:nth-child(7) { height: 45%; animation-delay: 0.6s; }
.waveform .bar:nth-child(8) { height: 65%; animation-delay: 0.15s; }
.waveform .bar:nth-child(9) { height: 35%; animation-delay: 0.35s; }

.waveform.paused .bar {
  animation-play-state: paused;
  height: 4px !important;
}

@keyframes wave {
  0%, 100% { transform: scaleY(0.5); }
  50% { transform: scaleY(1); }
}

/* Radio Station Cards */
.radio-stations {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.radio-station {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  transition: all var(--transition-fast);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.radio-station:hover {
  border-color: var(--accent);
}

.radio-station.playing {
  background: var(--accent-light);
  border-color: var(--accent);
}

.radio-station .station-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

.radio-station.playing .station-icon {
  background: var(--accent);
  color: white;
}

.station-info {
  flex: 1;
}

.station-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.station-desc {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.station-play-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--accent);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.station-play-btn:active {
  transform: scale(0.9);
}

/* Volume Control */
.volume-control {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg);
  padding: var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.volume-control span {
  font-size: 1rem;
}

.volume-slider {
  flex: 1;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--neutral-200);
  border-radius: 2px;
  outline: none;
  direction: ltr;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 6px var(--accent-glow);
}

/* ============================================
   SETTINGS PAGE
   ============================================ */
.settings-section {
  margin-bottom: var(--space-lg);
}

.settings-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-sm);
  padding-right: var(--space-xs);
}

.settings-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}

.settings-item:last-child {
  border-bottom: none;
}

.settings-item:hover {
  background: var(--bg-primary);
}

.settings-item-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.settings-item-info .icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.settings-item-info .text h4 {
  font-size: 0.9rem;
  font-weight: 600;
}

.settings-item-info .text p {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 48px;
  height: 28px;
  cursor: pointer;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--neutral-300);
  border-radius: 14px;
  transition: all var(--transition-fast);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 22px;
  height: 22px;
  background: white;
  border-radius: 50%;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle input:checked + .toggle-slider {
  background: var(--accent);
}

.toggle input:checked + .toggle-slider::before {
  transform: translateX(-20px);
}

/* Daily Intention */
.intention-card {
  background: linear-gradient(135deg, var(--primary-50), var(--beige-50));
  border: 1px solid var(--primary-100);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

[data-theme="dark"] .intention-card {
  background: linear-gradient(135deg, rgba(76,175,80,0.1), rgba(76,175,80,0.05));
  border-color: rgba(76,175,80,0.2);
}

.intention-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.intention-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  direction: rtl;
  resize: none;
  min-height: 60px;
  transition: border-color var(--transition-fast);
}

.intention-input:focus {
  outline: none;
  border-color: var(--accent);
}

/* Worship Log */
.worship-log {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-top: var(--space-md);
}

.worship-day {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.worship-day.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.worship-day.partial {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================
   Modals
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 2000;
  backdrop-filter: blur(4px);
}

.modal-overlay.visible {
  display: flex;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-lg);
  width: 100%;
  max-width: var(--max-width);
  max-height: 70vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-handle {
  width: 40px;
  height: 4px;
  background: var(--neutral-300);
  border-radius: 2px;
  margin: 0 auto var(--space-lg);
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  box-shadow: var(--shadow-lg);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 3000;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  transition: transform 0.3s ease;
  max-width: 320px;
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
}

/* ============================================
   Loading Spinner
   ============================================ */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: var(--space-xl) auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: var(--space-sm);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  text-align: center;
  padding: var(--space-3xl) var(--space-lg);
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state p {
  font-size: 0.9rem;
}

/* ============================================
   Khushoo Mode Overlay
   ============================================ */
.khushoo-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 5000;
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  color: white;
  text-align: center;
  animation: fadeIn 1s ease;
}

.khushoo-overlay.visible {
  display: flex;
}

.khushoo-overlay .prayer-name-large {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: var(--space-sm);
  animation: breathe 3s ease-in-out infinite;
}

.khushoo-overlay .khushoo-text {
  font-family: var(--font-quran);
  font-size: 1.3rem;
  opacity: 0.8;
  margin-bottom: var(--space-xl);
}

.khushoo-overlay .dismiss-btn {
  padding: var(--space-sm) var(--space-xl);
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-xl);
  font-size: 0.85rem;
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
}

@keyframes breathe {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.03); }
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
  width: 4px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--neutral-300);
  border-radius: 2px;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.1);
}

/* ============================================
   Responsive
   ============================================ */
@media (min-width: 768px) {
  :root {
    --max-width: 520px;
  }
}

@media (min-width: 1024px) {
  :root {
    --max-width: 480px;
  }
}

/* Landscape on mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .next-prayer-card {
    padding: var(--space-md);
  }
  
  .countdown-unit .number {
    font-size: 1.5rem;
  }
}

/* PWA - Standalone Mode */
@media (display-mode: standalone) {
  body {
    padding-top: env(safe-area-inset-top, 0);
  }
}

/* ============================================
   Selection Highlight
   ============================================ */
::selection {
  background: var(--accent);
  color: white;
}

/* ============================================
   Focus styles for accessibility
   ============================================ */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Surah List in Quran */
.surah-list-modal .surah-list-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.surah-list-item:hover {
  background: var(--bg-primary);
}

.surah-list-item .surah-num {
  width: 36px;
  height: 36px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.surah-list-item .surah-details {
  flex: 1;
}

.surah-list-item .surah-ar-name {
  font-family: var(--font-arabic);
  font-size: 1.05rem;
  font-weight: 600;
}

.surah-list-item .surah-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Tadabbur mode */
.tadabbur-meaning {
  background: var(--gold-100);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-top: var(--space-sm);
  font-size: 0.85rem;
  color: var(--neutral-700);
  line-height: 1.8;
  border-right: 3px solid var(--gold-400);
}

[data-theme="dark"] .tadabbur-meaning {
  background: rgba(255,193,7,0.1);
  color: var(--text-secondary);
}

/* Qibla Compass */
.qibla-compass {
  width: 200px;
  height: 200px;
  margin: 0 auto var(--space-lg);
  position: relative;
}

.compass-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 3px solid var(--border);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
}

.compass-arrow {
  width: 4px;
  height: 80px;
  position: absolute;
  top: 20px;
  left: 50%;
  transform-origin: bottom center;
  transform: translateX(-50%);
}

.compass-arrow::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 20px solid var(--accent);
}

.compass-arrow::after {
  content: '';
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 60px;
  background: var(--accent);
  border-radius: 2px;
}

.compass-center {
  width: 16px;
  height: 16px;
  background: var(--accent);
  border-radius: 50%;
  z-index: 1;
  box-shadow: 0 0 12px var(--accent-glow);
}

.compass-label {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 600;
}

/* Reading stats */
.reading-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.stat-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
}

.stat-item .stat-number {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--accent);
}

.stat-item .stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}
