/* ============================================================ */
/* CALENDRIER HEGIRIEN - THEME QURANLIGHT PREMIUM (STYLE HADITHS) */
/* ============================================================ */

:root {
  --gold: #b08d57;
  --gold-bright: #d4bc96;
  --gold-glow: rgba(176, 141, 87, 0.3);
  --emerald-dark: #05140f;
  --emerald-mid: #0a2d20;
  --glass: rgba(255, 255, 255, 0.04);
  --header-height: 85px;
}

/* --- HEADER FIXE GLASS PANEL --- */
.glass-panel.main-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height, 85px);
  background: rgba(6, 34, 24, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 2px solid var(--mp-gold, #b08d57);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 2000;
  box-sizing: border-box;
}

.header-spacer {
  height: var(--header-height, 85px);
}

/* --- BARRE DE NAVIGATION (CONTENEURS) --- */
.navigation-top,
.header-actions-right {
  display: flex;
  align-items: center;
  flex: 1; /* Équilibre parfait pour forcer le titre au milieu */
}

.header-actions-right {
  justify-content: flex-end;
}

.header-center-content {
  flex: 0 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* --- STYLE COMMUN BOUTONS (MAISON & REFRESH) --- */
.floating-back-btn,
.action-icon-btn {
  width: 45px;
  height: 45px;
  background: rgba(176, 141, 87, 0.1);
  border: 1px solid rgba(176, 141, 87, 0.3);
  border-radius: 12px;
  color: var(--mp-gold-bright, #f1d5a9);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-back-btn:hover,
.action-icon-btn:hover {
  background: var(--mp-gold, #b08d57);
  color: #062218 !important;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(176, 141, 87, 0.4);
}

/* Suppression du texte "Accueil" */
.floating-back-btn span {
  display: none;
}

/* --- TITRE ET LOGO (CENTRE) --- */
.hero-intro-section {
  display: flex;
  align-items: center;
  gap: 15px; /* Augmenté légèrement pour laisser respirer le logo */
  white-space: nowrap;
}

.header-main-title {
  font-family: "Poppins", sans-serif;
  font-size: clamp(1.1rem, 4vw, 1.6rem);
  font-weight: 900;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0;
}

/* ASPECT GOLD PRÉCIEUX POUR LE LOGO CALENDRIER */
.moon-logo {
  font-size: 1.8rem;
  /* Dégradé métallique Or (du clair au sombre) */
  background: linear-gradient(180deg, #f1d5a9 0%, #b08d57 50%, #8a6d3b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  /* Lueur dorée pour l'effet de brillance */
  filter: drop-shadow(0 0 8px rgba(176, 141, 87, 0.5));
  margin: 0;
  display: inline-block;
}
/* --- RESPONSIVE OPTIMISÉ --- */
@media (max-width: 480px) {
  .glass-panel.main-header {
    height: 75px;
    padding: 0 15px;
  }

  .header-spacer {
    height: 75px;
  }

  .floating-back-btn,
  .action-icon-btn {
    width: 40px;
    height: 40px;
  }

  .header-main-title {
    font-size: 1rem;
    letter-spacing: 1px;
  }

  .moon-logo {
    display: none; /* Cache l'icône sur petit mobile pour éviter la surcharge */
  }
}

/* --- SECTION SOUS-TITRE (TEXTE ARABE EN BAS) --- */
.header-subtext {
  text-align: center;
  padding: 20px 10px;
  width: 100%;
}

.arabic-text {
  font-family: "Amiri", serif;
  font-size: 2.2rem;
  color: var(--gold-bright);
  font-weight: bold;
  margin: 0;
  display: block;
  line-height: 1.2;
}

.french-translation {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
  margin-top: 8px;
  display: block;
  letter-spacing: 0.5px;
}

/* --- CONTENEUR CALENDRIER --- */
.calendar-container {
  max-width: 700px;
  margin: 0 auto 20px auto;
  padding: 25px 30px;
  background: radial-gradient(
    circle at top left,
    var(--emerald-mid),
    var(--emerald-dark)
  );
  border-radius: 12px;
  border: 1px solid rgba(176, 141, 87, 0.2);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8),
    inset 0 1px 20px rgba(176, 141, 87, 0.05);
}

.current-date-info {
  text-align: center;
  margin-bottom: 25px;
}

.date-gregorian {
  font-size: 0.8rem;
  color: var(--gold-bright);
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.7;
}

.date-hijri {
  font-size: 2rem;
  background: linear-gradient(to bottom, #fff 30%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 5px;
  font-weight: 900;
}

/* Navigation Mois */
.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

#calendar-month-year {
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #fff;
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-button {
  background: rgba(176, 141, 87, 0.1);
  border: 1px solid var(--gold);
  color: var(--gold);
  width: 35px;
  height: 35px;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-button:hover {
  background: var(--gold);
  color: #05140f;
}

/* --- GRILLE & JOURS --- */
.weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(176, 141, 87, 0.2);
}

.day-name {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.main-txt {
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.arabic-txt {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.55rem;
  text-transform: capitalize;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.day {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  transition: 0.3s ease;
  cursor: pointer;
  color: #fff;
  position: relative;
}

.day:hover:not(.empty-day) {
  background: rgba(176, 141, 87, 0.1);
  border-color: var(--gold);
  transform: translateY(-2px);
}

.day.current-day {
  background: var(--gold) !important;
  box-shadow: 0 0 20px var(--gold-glow);
  border: none;
  transform: scale(1.05);
  z-index: 2;
}

.day.current-day .gregorian-num,
.day.current-day .hijri-num {
  color: #05140f !important;
  font-weight: 900;
}

.day.event-day {
  border: 1.5px solid var(--gold) !important;
  background: rgba(176, 141, 87, 0.15) !important;
}

.day.white-day::after {
  content: "•";
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--gold-bright);
  font-size: 1.2rem;
  line-height: 1;
}

.empty-day {
  opacity: 0;
  cursor: default;
}

.gregorian-num {
  font-size: 1rem;
  font-weight: 700;
}
.hijri-num {
  font-size: 0.65rem;
  color: var(--gold-bright);
  opacity: 0.8;
}

/* --- SECTION EVENEMENTS --- */
.events-section {
  max-width: 700px;
  margin: 20px auto 40px;
  padding: 25px;
  background: rgba(6, 26, 18, 0.6);
  border-radius: 12px;
  border: 1px solid rgba(176, 141, 87, 0.15);
  width: 95%;
  box-sizing: border-box;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 800;
  text-transform: uppercase;
  color: #fff;
  margin: 0;
  text-align: center;
}

.header-divider {
  width: 35px;
  height: 2px;
  background: var(--gold);
  margin: 8px auto 20px;
}

.event-card {
  background: rgba(255, 255, 255, 0.03);
  border-left: 4px solid var(--gold);
  padding: 18px;
  border-radius: 10px;
  margin-bottom: 12px;
  transition: all 0.3s ease;
}

.event-card:hover {
  transform: translateX(8px);
  background: rgba(176, 141, 87, 0.08);
}

/* --- RESPONSIVE --- */
@media (max-width: 600px) {
  .header-main-title {
    font-size: 1.3rem;
  }
  .moon-logo {
    font-size: 1.4rem;
  }
  .floating-back-btn span {
    display: none;
  }
  .floating-back-btn {
    padding: 10px;
    width: 42px;
    justify-content: center;
  }

  .calendar-container {
    padding: 15px;
    width: 95%;
  }
  .date-hijri {
    font-size: 1.6rem;
  }
  .arabic-txt {
    display: none;
  }
  .day {
    min-height: 50px;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* --- SECTION RESPONSIVE UNIVERSELLE --- */

/* Ajustements pour Tablettes et petits écrans (iPad, etc.) */
@media (max-width: 768px) {
  .calendar-container {
    padding: 20px;
    margin: 10px auto;
    width: 92%;
  }
}

/* --- SECTION RESPONSIVE UNIVERSELLE --- */

@media (max-width: 768px) {
  .calendar-container {
    padding: 20px;
    margin: 10px auto;
    width: 92%;
    box-sizing: border-box; /* Assure que le padding ne fait pas déborder le conteneur */
  }
}

/* Ajustements spécifiques Mobile (iPhone, Android) */
@media (max-width: 480px) {
  .glass-panel.main-header {
    height: 70px;
    padding: 0 12px;
  }
  .header-spacer {
    height: 70px;
  }

  .header-main-title {
    font-size: 0.95rem;
    letter-spacing: 0.5px;
  }

  .calendar-container {
    padding: 15px 8px; /* Réduction du padding latéral pour gagner de la place */
    width: 96%;
    border-radius: 15px;
    box-sizing: border-box;
  }

  /* Grille : Gap réduit pour éviter la sortie de page */
  .calendar-grid,
  .weekdays {
    gap: 4px; /* Gap identique pour l'alignement parfait */
    width: 100%;
  }

  .main-txt {
    font-size: 0.55rem;
  }

  /* Correction de la superposition dans la case */
  .day {
    padding: 6px 0 12px 0; /* Plus d'espace en bas pour le point */
    min-height: 45px;
    justify-content: flex-start; /* Aligne les chiffres vers le haut */
  }

  .gregorian-num {
    font-size: 0.85rem;
    line-height: 1;
  }

  .hijri-num {
    font-size: 0.55rem;
    margin-top: 2px;
  }

  /* Positionnement du point (White Day) pour éviter la superposition */
  .day.white-day::after {
    font-size: 0.8rem; /* Plus petit sur mobile */
    bottom: 2px; /* Fixé tout en bas de la case */
    line-height: 1;
  }

  .date-hijri {
    font-size: 1.3rem;
  }

  .events-section {
    width: 96%;
    padding: 15px;
    box-sizing: border-box;
  }
}

/* Écrans ultra-compacts (iPhone SE) */
@media (max-width: 340px) {
  .calendar-grid,
  .weekdays {
    gap: 2px;
  }
  .header-main-title {
    font-size: 0.8rem;
  }
  .gregorian-num {
    font-size: 0.75rem;
  }
}
