
/* ============================================
   HEADER
============================================ */
.header {
  width: 100%;
  margin: 0 auto;
  position: fixed;
  border-radius: 0 0 10px 10px;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 12px;
  transition: background 0.4s, backdrop-filter 0.4s, box-shadow 0.3s;
}

.header.scrolled {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .header.scrolled {
  background: rgba(10,15,14,0.85);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--emerald), var(--teal));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(16,185,129,0.3);
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
}

.logo-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.logo-name span {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text3);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg2);
  color: var(--text2);
  font-size: 18px;
  transition: all 0.2s;
  border: 1px solid var(--border);
}

.icon-btn:hover {
  background: var(--emerald-glow);
  color: var(--emerald);
  border-color: var(--border2);
  transform: translateY(-1px);
}

.whatsapp-header-btn {
  background: #25d366;
  color: #ffffff;
  border-color: rgba(37, 211, 102, 0.35);
}

.whatsapp-header-btn:hover {
  background: #20bd5a;
  color: #ffffff;
  border-color: rgba(37, 211, 102, 0.5);
}

.whatsapp-icon {
  width: 23px;
  height: 23px;
  display: block;
  fill: currentColor;
  flex-shrink: 0;
}

/* Search bar */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 100px;
}

.search-overlay.open {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.search-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
  max-width: 500px;
  margin: 0 16px;
  box-shadow: var(--shadow-lg);
}

.search-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid var(--border2);
  background: var(--bg2);
  color: var(--text);
  font-family: 'Alexandria', sans-serif;
  font-size: 16px;
  outline: none;
  transition: border 0.2s;
}

.search-input:focus { border-color: var(--emerald); }

.search-results {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.search-result-item {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg2);
  color: var(--text2);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-result-item:hover {
  background: var(--emerald-glow);
  color: var(--emerald);
}


/* ============================================
   BOTTOM NAV
============================================ */
.bottom-nav {
  width: 98%;
  margin: 5px auto;
  border-radius: 20px;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom);
}

[data-theme="dark"] .bottom-nav {
  background: rgba(17,26,22,0.95);
  backdrop-filter: blur(20px);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 10px;
  border-radius: 14px;
  transition: all 0.2s;
  color: #34d399;
  font-size: 10px;
  font-weight: 500;
  min-width: 50px;
  cursor: pointer;
  position: relative;
}

.nav-item .nav-icon {
  font-size: 22px;
  transition: transform 0.2s;
  line-height: 1;
  color: #34d399;
}

.nav-item.active {
  color: var(--emerald);
}

.nav-item.active .nav-icon {
  transform: translateY(-2px);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  width: 32px;
  height: 3px;
  background: var(--emerald);
  border-radius: 0 0 4px 4px;
}

.nav-item:hover {
  color: var(--emerald);
  background: var(--emerald-glow2);
}


/* صفحة القرائ */


.scholar-page {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  gap: 24px;
  padding: 20px 0 40px;
}

.scholar-header {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.scholar-header img {
  width: 180px;
  height: 180px;
  border-radius: 28px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.scholar-info h1 {
  font-size: clamp(32px, 4vw, 42px);
  font-weight: 800;
  margin-bottom: 12px;
  color: var(--text);
  line-height: 1.05;
}

.scholar-info p {
  color: var(--text2);
  line-height: 1.8;
}

.audio-section {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 24px;
}

.audio-player,
.surah-list {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.audio-player {
  display: grid;
  gap: 20px;
  align-items: start;
}

.audio-player img {
  width: 140px;
  height: 140px;
  border-radius: 24px;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  justify-self: center;
}

#current-surah {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.controls {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

.control-item {
  display: grid;
  gap: 6px;
  justify-items: center;
  text-align: center;
}

.btn {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  display: grid;
  place-items: center;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--emerald-glow);
  color: var(--emerald);
  border-color: var(--border2);
  transform: translateY(-1px);
}

.btn-play {
  width: 68px;
  height: 68px;
}

.btn-repeat.active {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #ffffff;
}

.btn-repeat.active i {
  color: #ffffff;
}

.progress-row {
  display: grid;
  gap: 10px;
}

.progress-row span {
  color: var(--text2);
  font-size: 14px;
}

#progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--bg2);
  accent-color: var(--emerald);
}

.surah-list h2 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text);
}

.surah-list ul {
  list-style: none;
  display: grid;
  gap: 10px;
  max-height: 310px;
  overflow-y: auto;
  padding-right: 4px;
}

.surah-list ul::-webkit-scrollbar {
  width: 8px;
}

.surah-list ul::-webkit-scrollbar-thumb {
  background: var(--emerald);
  border-radius: 999px;
}

.surah-list li {
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--bg2);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  font-size: 0.96rem;
}

.surah-list li:hover,
.surah-list li.active {
  background: var(--emerald-glow);
  border-color: var(--border2);
  color: var(--emerald-dark);
  transform: translateX(-2px);
}


.disc {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.disc-ring {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: inset 0 6px 20px rgba(0, 0, 0, 0.2), 0 6px 18px rgba(0, 0, 0, 0.15);
  border: 6px solid rgba(255, 255, 255, 0.06);
}

.disc-image {
  width: 86%;
  height: 86%;
  border-radius: 50%;
  object-fit: cover;
  border: 6px solid var(--bg);
  z-index: 2;
  transition: transform 0.3s ease;
  animation: spin 4s linear infinite;
  animation-play-state: paused;
}

.disc-image.playing {
  animation-play-state: running;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@media (max-width: 992px) {
  .scholar-page {
    padding: 20px 16px 70px;
  }

  .scholar-header {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .audio-section {
    grid-template-columns: 1fr;
  }

  .audio-player,
  .surah-list {
    max-width: 100%;
  }

  .audio-player img {
    width: 120px;
    height: 120px;
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    position: static;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
  }

  .nav-links a {
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg2);
  }

  .menu-toggle {
    display: none;
  }

  .header {
    padding: 0 14px;
  }
}

@media (max-width: 480px) {
  .scholar-page {
    padding: 18px 12px 70px;
  }

  .scholar-header img {
    width: 130px;
    height: 130px;
  }

  .audio-player img {
    width: 100px;
    height: 100px;
  }

  .nav-links a {
    font-size: 0.95rem;
  }
}


/* الاذكار  */

.azkar-main {
  display: block;
  min-height: calc(100vh - var(--header-h) - var(--nav-h) - 210px);
}

.azkar-hero {
  margin-bottom: 22px;
}

.azkar-hero .prayer-name {
  font-size: 28px;
}

.azkar-hero-text {
  color: rgba(255,255,255,0.82);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.8;
  position: relative;
  max-width: 560px;
}

.azkar-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.azkar-type-card {
  min-height: 185px;
}

.azkar-back-row {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 14px;
}

.azkar-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border2);
  background: var(--emerald-glow2);
}

.azkar-reader .card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  transition: opacity 0.25s, transform 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.azkar-reader .card.transitioning {
  opacity: 0.55;
  transform: scale(0.98);
}

.zekr-container {
  min-height: 390px;
  padding: 32px 24px;
  display: grid;
  grid-template-rows: auto minmax(150px, 1fr) auto;
  align-items: center;
  justify-items: center;
  gap: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.zekr-container::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, var(--emerald-glow), transparent 36%),
    linear-gradient(135deg, var(--emerald-glow2), transparent 66%);
  pointer-events: none;
}

.zekr-number {
  position: relative;
  z-index: 1;
  color: var(--emerald);
  background: var(--emerald-glow);
  border: 1px solid var(--border2);
  border-radius: 99px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.zekr-text {
  position: relative;
  z-index: 1;
  color: var(--text);
  font-size: 22px;
  font-weight: 700;
  line-height: 2.05;
  max-width: 100%;
  margin: 0;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  text-wrap: pretty;
}

.counter-btn {
  position: relative;
  z-index: 1;
  min-width: 136px;
  min-height: 56px;
  padding: 14px 28px;
  border-radius: 16px;
  border: 0;
  background: linear-gradient(135deg, var(--emerald), var(--teal));
  color: #ffffff;
  font-family: 'Alexandria', sans-serif;
  font-size: 20px;
  font-weight: 800;
  box-shadow: var(--shadow-emerald);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s;
  touch-action: manipulation;
}

.counter-btn:hover {
  transform: translateY(-2px);
}

.counter-btn:active,
.counter-btn.pressed {
  transform: scale(0.96);
}

.counter-btn:disabled {
  cursor: not-allowed;
  opacity: 0.78;
}

.counter-btn.completed {
  background: linear-gradient(135deg, #22c55e, #16a34a);
}

.azkar-reader + .footer,
.azkar-main + .footer {
  margin-top: 28px;
}

@media (min-width: 600px) {
  .azkar-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .azkar-type-card {
    min-height: 210px;
  }
}

@media (min-width: 900px) {
  .azkar-main {
    min-height: calc(100vh - var(--header-h) - 210px);
  }
}

@media (max-width: 480px) {
  .azkar-hero .prayer-name {
    font-size: 24px;
  }

  .zekr-container {
    min-height: 360px;
    padding: 26px 16px;
    gap: 20px;
  }

  .zekr-text {
    font-size: 18px;
    line-height: 2;
  }

  .counter-btn {
    font-size: 18px;
    min-width: 118px;
    min-height: 52px;
    padding: 12px 22px;
  }
}
