/* ====== Variables (thème galaxie) ====== */
:root {
  --vert: #6d5dfc;        /* couleur principale (boutons, onglet actif) */
  --vert-clair: #8a7dff;  /* couleur principale au survol */
  --or: #f2c94c;          /* couleur d'accent (doré) */
  --fond: #05061a;        /* fond de base de la page */
  --carte: rgba(22, 20, 54, 0.65); /* cartes semi-transparentes */
  --bordure: rgba(255, 255, 255, 0.12);
  --texte: #f1f1f8;
  --gris: #a9acc8;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { color-scheme: dark; }

body {
  font-family: 'Poppins', sans-serif;
  color: var(--texte);
  line-height: 1.6;
  min-height: 100vh;
  /* Nébuleuses : plusieurs taches de couleur sur un fond bleu nuit */
  background:
    radial-gradient(ellipse at 15% 10%, rgba(168, 85, 247, 0.38), transparent 55%),
    radial-gradient(ellipse at 85% 25%, rgba(236, 72, 153, 0.26), transparent 55%),
    radial-gradient(ellipse at 50% 95%, rgba(59, 130, 246, 0.32), transparent 60%),
    linear-gradient(180deg, #05061a 0%, #0b0d2e 55%, #140a2c 100%);
  background-attachment: fixed;
}

/* ====== Étoiles (deux couches qui scintillent) ====== */
body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}
body::before {
  background-image:
    radial-gradient(1px 1px at 20px 30px, #ffffff, transparent),
    radial-gradient(1px 1px at 90px 120px, #ffffff, transparent),
    radial-gradient(1.5px 1.5px at 160px 60px, #ffe9a8, transparent),
    radial-gradient(1px 1px at 230px 180px, #ffffff, transparent),
    radial-gradient(1px 1px at 60px 200px, #cfd8ff, transparent),
    radial-gradient(1.5px 1.5px at 280px 20px, #ffffff, transparent);
  background-size: 300px 240px;
  opacity: 0.85;
  animation: scintille 5s ease-in-out infinite alternate;
}
body::after {
  background-image:
    radial-gradient(1px 1px at 40px 70px, #ffffff, transparent),
    radial-gradient(2px 2px at 140px 150px, #ffd6f5, transparent),
    radial-gradient(1px 1px at 210px 40px, #ffffff, transparent),
    radial-gradient(1px 1px at 100px 220px, #bcd4ff, transparent);
  background-size: 370px 310px;
  opacity: 0.6;
  animation: scintille 7s ease-in-out infinite alternate-reverse;
}
@keyframes scintille {
  from { opacity: 0.35; }
  to   { opacity: 0.95; }
}

/* ====== En-tête ====== */
.entete {
  background: linear-gradient(135deg, rgba(109, 93, 252, 0.35), rgba(236, 72, 153, 0.2));
  border-bottom: 1px solid var(--bordure);
  color: white;
  text-align: center;
  padding: 28px 15px 18px;
}
.entete h1 {
  font-family: 'Amiri', serif;
  font-size: 3.2rem;
  line-height: 1.3;
  color: var(--or);
  text-shadow: 0 0 22px rgba(242, 201, 76, 0.45);
}
.entete .sous-titre { opacity: 0.9; font-size: 0.9rem; }
.entete #date-hijri { opacity: 0.75; font-size: 0.8rem; }

/* ====== Onglets ====== */
.onglets {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: rgba(8, 9, 30, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--bordure);
  flex-wrap: wrap;
}
.tab {
  background: transparent;
  border: 2px solid transparent;
  padding: 8px 14px;
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--gris);
}
.tab:hover { color: white; background: rgba(255, 255, 255, 0.08); }
.tab.active { background: var(--vert); color: white; }

/* ====== Mise en page ====== */
main { max-width: 900px; margin: 0 auto; padding: 20px 15px; }
.section { display: none; }
.section.active { display: block; }
.cache { display: none; }

.carte,
.priere-carte,
.sourate-item,
.verset,
.dua {
  background: var(--carte);
  border: 1px solid var(--bordure);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.carte {
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 20px;
}
.carte h3 { margin-bottom: 10px; color: var(--or); }
.carte p { margin-bottom: 8px; }
.centre { text-align: center; }
.petit { color: var(--gris); font-size: 0.85rem; }

.grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

/* ====== Formulaires et boutons ====== */
input, select {
  padding: 10px 12px;
  border: 1px solid var(--bordure);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.07);
  color: var(--texte);
}
input::placeholder { color: var(--gris); }
input:focus, select:focus { outline: 2px solid var(--vert); }
option { background: #12122e; color: var(--texte); }
.recherche { width: 100%; margin-bottom: 15px; }

button {
  background: var(--vert);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
  transition: 0.2s;
}
button:hover { background: var(--vert-clair); }
button.secondaire { background: rgba(255, 255, 255, 0.12); color: var(--texte); }
button.secondaire:hover { background: rgba(255, 255, 255, 0.2); }

.formulaire { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.formulaire input { flex: 1; min-width: 130px; }

.ligne { display: flex; align-items: center; gap: 10px; margin: 8px 0; cursor: pointer; }
.ligne input { width: 18px; height: 18px; accent-color: var(--vert); }

.reglages { display: flex; flex-wrap: wrap; gap: 12px; margin: 14px 0; }
.reglages label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 160px;
  font-size: 0.8rem;
  color: var(--gris);
}
.reglages select { width: 100%; }

.boutons-ligne { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 6px 0; }

/* ====== Prières ====== */
.prochaine {
  background: linear-gradient(135deg, rgba(109, 93, 252, 0.55), rgba(88, 28, 135, 0.5));
  color: white;
  text-align: center;
}
.prochaine .petit { color: rgba(255, 255, 255, 0.75); }
#prochaine-nom { font-size: 1.8rem; color: var(--or); }
#compte-a-rebours {
  font-size: 3rem;
  font-weight: 600;
  letter-spacing: 2px;
  margin: 5px 0;
  text-shadow: 0 0 18px rgba(138, 125, 255, 0.7);
}

.priere-carte {
  border-radius: 14px;
  padding: 15px;
  text-align: center;
}
.priere-carte.suivante {
  border-color: var(--or);
  background: rgba(242, 201, 76, 0.14);
  box-shadow: 0 0 18px rgba(242, 201, 76, 0.25);
}
.priere-carte .ar { font-family: 'Amiri', serif; font-size: 1.4rem; color: var(--or); }
.priere-carte .nom { font-size: 0.85rem; color: var(--gris); }
.priere-carte .heure { font-size: 1.5rem; font-weight: 600; }

/* ====== Coran ====== */
.sourate-item {
  border-radius: 12px;
  padding: 12px;
  cursor: pointer;
  text-align: center;
  transition: 0.2s;
}
.sourate-item:hover { transform: translateY(-3px); border-color: var(--or); }
.sourate-item .num { color: var(--or); font-weight: 600; }
.sourate-item .ar { font-family: 'Amiri', serif; font-size: 1.4rem; }
.sourate-item .fr { font-size: 0.8rem; color: var(--gris); }

#vue-lecture h2 { text-align: center; font-family: 'Amiri', serif; font-size: 2rem; margin: 15px 0 5px; color: var(--or); }
#lecteur { width: 100%; margin: 10px 0 6px; }

.bismillah { text-align: center; font-family: 'Amiri', serif; font-size: 1.9rem; color: var(--or); margin: 14px 0; }

.verset {
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 12px;
}
.verset .arabe { font-size: 1.7rem; line-height: 2.2; }
.verset .traduction { color: var(--gris); margin-top: 8px; font-size: 0.92rem; }
.verset .numero {
  display: inline-block;
  background: var(--vert);
  color: white;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  text-align: center;
  line-height: 26px;
  font-size: 0.75rem;
  margin-left: 8px;
  font-family: 'Poppins', sans-serif;
}
.tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(242, 201, 76, 0.2);
  color: var(--or);
  border-radius: 6px;
  padding: 0 6px;
  margin-right: 6px;
  vertical-align: middle;
}

.arabe { font-family: 'Amiri', serif; direction: rtl; text-align: right; }

/* ====== Duas ====== */
.dua {
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 15px;
  border-left: 5px solid var(--or);
}
.dua h4 { color: var(--or); margin-bottom: 8px; }
.dua .arabe { font-size: 1.6rem; line-height: 2.1; }
.dua .translit { font-style: italic; color: var(--gris); margin: 6px 0; }
.dua .btn-copier { margin-top: 8px; padding: 6px 12px; font-size: 0.8rem; }

/* ====== Tasbih ====== */
.arabe.grand { font-size: 2rem; text-align: center; margin: 10px 0; }
#compteur {
  font-size: 5rem;
  font-weight: 600;
  color: var(--or);
  margin: 10px 0;
  text-shadow: 0 0 20px rgba(242, 201, 76, 0.45);
}
#btn-compter {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  font-size: 1.3rem;
  margin: 15px 0;
  box-shadow: 0 6px 28px rgba(109, 93, 252, 0.6);
}
#btn-compter:active { transform: scale(0.94); }

/* ====== Sadaqa Jariya ====== */
.hadith {
  border-left: 4px solid var(--or);
  padding-left: 12px;
  font-style: italic;
  margin-top: 10px;
}
.sj-form { display: grid; gap: 8px; margin: 12px 0; }
.stats-sj { display: flex; gap: 12px; margin-bottom: 8px; }
.stat { flex: 1; text-align: center; }
.stat strong { display: block; font-size: 1.9rem; color: var(--or); }
.dedicace {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--bordure);
}
.dedicace .info { flex: 1; }
.dedicace .nom-sj { font-weight: 600; color: var(--or); }
.btn-suppr { background: transparent; color: var(--gris); padding: 4px 10px; }
.btn-suppr:hover { background: rgba(255, 255, 255, 0.1); color: white; }
.idees { margin: 0 0 14px 20px; }
.idees li { margin-bottom: 6px; }

footer { text-align: center; padding: 25px; color: var(--gris); font-size: 0.85rem; }

@media (max-width: 500px) {
  #compte-a-rebours { font-size: 2.3rem; }
  .verset .arabe { font-size: 1.4rem; }
  .tab { padding: 7px 11px; font-size: 0.85rem; }
}

/* ====== Logo ====== */
.logo {
  display: block;
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 50%;
  margin: 0 auto 8px;
  box-shadow: 0 0 22px rgba(242, 201, 76, 0.35);
}
