/* ======================================================== */
/* 1. CONFIGURATION DU THÈME HADITHS (PREMIUM)              */
/* ======================================================== */
:root {
  --mp-green-bg: #060e0a;
  --mp-green-surface: #0d1612;
  --mp-gold: #b08d57;
  --mp-gold-bright: #e6c18a;
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.5);
  --font-ar: "Amiri", serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --header-height: 85px;
}

/* ADAPTATION AU THÈME CLAIR (Si activé via la classe .light-theme sur le body) */
body.light-theme {
  --mp-green-bg: #f4f7f6;
  --mp-green-surface: #ffffff;
  --text-main: #1a2a24;
  --text-muted: rgba(0, 0, 0, 0.5);
  background-image: linear-gradient(
    to bottom,
    rgba(176, 141, 87, 0.1),
    transparent
  );
}

body {
  background-color: var(--mp-green-bg);
  color: var(--text-main);
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
  background-image: linear-gradient(
    to bottom,
    rgba(176, 141, 87, 0.05),
    transparent
  );
  background-attachment: fixed;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

body.light-theme .glass-panel.main-header {
  background: rgba(255, 255, 255, 0.95);
}

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

.navigation-top,
.header-actions-right {
  display: flex;
  align-items: center;
  flex: 1;
}

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

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

.floating-back-btn,
.action-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  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);
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

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

.header-main-title {
  font-family: "Poppins", sans-serif;
  font-size: clamp(1.1rem, 4vw, 1.5rem);
  font-weight: 800;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin: 0;
  white-space: nowrap;
}

.moon-logo {
  font-size: 1.5rem;
  color: var(--mp-gold);
  filter: drop-shadow(0 0 10px rgba(176, 141, 87, 0.4));
  margin-left: 10px;
}

/* ======================================================== */
/* 3. CONTAINER & RECHERCHE                                 */
/* ======================================================== */
.legal-page-container {
  max-width: 800px;
  margin: 20px auto 40px;
  padding: 0 20px;
  animation: fadeIn 0.8s ease-out;
}

.legal-header {
  text-align: center;
  margin-bottom: 30px;
}
.header-sub {
  color: var(--mp-gold);
  font-style: italic;
  font-size: 1rem;
  display: block;
  margin-top: 10px;
}

.search-bar {
  position: relative;
  max-width: 500px;
  margin: 30px auto;
}
.search-bar i {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mp-gold);
}

.search-bar input {
  width: 100%;
  padding: 15px 20px 15px 55px;
  background: var(--mp-green-surface);
  border: 1px solid rgba(176, 141, 87, 0.2);
  border-radius: 12px;
  color: var(--text-main);
  font-size: 1rem;
  box-sizing: border-box;
  outline: none;
}

.filter-tabs {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 35px;
}

.tab-btn {
  padding: 8px 20px;
  background: transparent;
  border: 1px solid rgba(176, 141, 87, 0.3);
  color: var(--mp-gold-bright);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  transition: var(--transition);
}

.tab-btn.active {
  background: var(--mp-gold);
  color: #060e0a;
}

/* ======================================================== */
/* 4. CARTES DES HADITHS (ADAPTÉES AU JS)                   */
/* ======================================================== */
.hadiths-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.hadith-card {
  background: var(--mp-green-surface);
  border: 1px solid rgba(176, 141, 87, 0.15);
  border-radius: 15px;
  padding: 25px 30px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.hadith-card:hover {
  border-color: var(--mp-gold);
  background: rgba(176, 141, 87, 0.03);
  transform: translateY(-3px);
}

.hadith-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.badge {
  background: rgba(176, 141, 87, 0.15);
  color: var(--mp-gold);
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.copy-btn {
  background: transparent;
  border: none;
  color: var(--mp-gold);
  cursor: pointer;
  font-size: 1.1rem;
  transition: 0.2s;
  padding: 5px;
}

.copy-btn:hover {
  transform: scale(1.2);
  color: var(--mp-gold-bright);
}

.hadith-arabic {
  font-family: var(--font-ar);
  font-size: 1.8rem;
  color: var(--mp-gold-bright);
  text-align: right;
  line-height: 1.8;
  margin-bottom: 20px;
  direction: rtl;
}

.hadith-french {
  font-size: 1.05rem;
  color: var(--text-main);
  line-height: 1.6;
  font-weight: 700;
  padding-left: 15px;
  border-left: 3px solid var(--mp-gold);
}

.hadith-ref {
  margin-top: 15px;
  font-size: 0.8rem;
  color: var(--mp-gold);
  opacity: 0.8;
  font-weight: 600;
}

.hadith-ref i {
  margin-right: 5px;
}
/* ======================================================== */
/* MODIFICATION DU FOOTER (COPYRIGHT)                       */
/* ======================================================== */
.legal-footer-info {
  text-align: center;
  margin-top: 50px;
  padding: 20px 0;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.5px;

  /* Utilisation des variables pour s'adapter aux thèmes */
  color: var(--text-muted);
  border-top: 1px solid rgba(176, 141, 87, 0.1);

  width: 100%;
  display: block;
}

/* Ajustement spécifique pour le thème clair si nécessaire */
body.light-theme .legal-footer-info {
  color: #666666; /* Un gris un peu plus lisible sur fond blanc */
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}
/* ======================================================== */
/* 5. RESPONSIVE & ANIMATIONS                               */
/* ======================================================== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translate(-50%, 20px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@media (max-width: 768px) {
  .header-main-title {
    font-size: 1.2rem;
  }
  .legal-page-container {
    padding: 0 15px;
  }
}

@media (max-width: 600px) {
  .glass-panel.main-header {
    padding: 0 10px;
    height: 75px;
  }
  .header-spacer {
    height: 75px;
  }
  .floating-back-btn,
  .action-icon-btn {
    width: 40px;
    height: 40px;
  }
  .header-main-title {
    font-size: 1rem;
    letter-spacing: 1px;
  }
  .hadith-card {
    padding: 20px;
  }
  .hadith-arabic {
    font-size: 1.5rem;
  }
  .hadith-french {
    font-size: 0.95rem;
  }
}

@media (max-width: 380px) {
  .header-main-title {
    font-size: 0.85rem;
  }
  .tab-btn {
    padding: 6px 12px;
    font-size: 0.65rem;
  }
}
