/* Variables CSS pour le mode clair */
:root {
  --bg-color: #e4e4e4;
  --text-color: #333;
  --header-text-color: #2d295c; /* Couleur corrigée pour le header */
  --categorie-bg-color: rgba(255, 255, 255, 0.9);
  --link-color: #1e3a8a;
  --popup-bg-color: white;
  --popup-text-color: #333;
  --search-bg-color: #ccc;
  --search-text-color: #333;
}

/* Style de base */
body {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  line-height: 1.2;
  margin: 0;
  padding: 0;
  color: var(--text-color);
  background-color: var(--bg-color);
  transition: background-color 0.3s, color 0.3s;
}

/* Header */
header {
  background-image: url('header-background.jpg');
  background-size: cover;
  background-position: center;
  padding: 1rem;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  height: 160px;
  transition: background-color 0.3s, color 0.3s;
}

/* Texte du header */
header h1 {
  margin: 0;
  font-size: 1.8rem;
  color: var(--header-text-color) !important;
  text-shadow: none; /* Supprime l'ombre en mode sombre pour éviter les effets bizarres */
}

header p {
  margin: 0.2rem 0;
  font-size: 0.9rem;
  color: var(--header-text-color) !important;
  text-shadow: none;
}
/* Conteneur principal des liens */
#liens-container {
  max-width: 1200px;
  margin: 180px auto 1rem;
  padding: 0 1rem;
}

/* Style pour les catégories */
.categorie {
  background-color: var(--categorie-bg-color);
  border-radius: 8px;
  padding: 0.8rem;
  margin-bottom: 0.8rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  color: var(--text-color);
}

.categorie h2 {
  color: #bc0f37;
  margin-bottom: 0.3rem;
  font-size: 1.4rem;
  border-bottom: 2px solid #bc0f37;
  padding-bottom: 0.2rem;
}

/* Style pour les colonnes */
.colonne {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.colonne-half {
  flex: 1 1 calc(50% - 0.5rem);
  min-width: 300px;
}

/* Style pour les listes de liens */
#liens-container ul {
  padding-left: 1rem;
  margin: 0.2rem 0;
  list-style-type: none;
}

/* Barre de recherche */
#search {
  padding: 0.4rem;
  width: 300px;
  border-radius: 4px;
  border: 1px solid var(--search-bg-color);
  background-color: var(--bg-color);
  color: var(--search-text-color);
}

/* Style pour la popup */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.popup-content {
  background-color: var(--popup-bg-color);
  padding: 2rem;
  border-radius: 10px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  color: var(--popup-text-color);
}

.close-popup {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 1.5rem;
  background: none;
  border: none;
  cursor: pointer;
  color: #555;
}

.popup-content h2 {
  color: #2c285b;
  margin-top: 0;
}

.popup-content p {
  line-height: 1.5;
  margin: 0.5rem 0;
}

.popup-image {
  margin: 1rem 0;
}

.ok-popup {
  background-color: #1e3a8a;
  color: white;
  border: none;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  border-radius: 5px;
  cursor: pointer;
  margin-top: 1rem;
  transition: background-color 0.3s;
}

.ok-popup:hover {
  background-color: #2c285b;
}

/* Style pour les liens */
#liens-container a {
  font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--link-color);
  text-decoration: none;
}

#liens-container a:hover {
  text-decoration: underline;
}

/* Style pour les descriptions et tags */
#liens-container p {
  margin: 0.2rem 0;
  font-size: 0.9rem;
}

#liens-container small {
  color: #aaa;
  font-size: 0.8rem;
}

/* Style pour les mots recherchés */
mark {
  background-color: #ffe066;
  padding: 0 2px;
  border-radius: 2px;
}

#clear-search:hover {
  color: #000;
}

/* Responsive */

/* Responsive header */
@media (max-width: 700px) {

  /* Header en colonne : logo puis texte */
  header > div:first-child {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    text-align: center !important;
    gap: 0.6rem !important;
    padding: 0 1rem !important;
  }

  header > div:first-child a {
    display: block !important;
    margin: 0 auto !important;
  }

  header img {
    height: 75px !important;
    width: auto !important;
    margin-right: 0 !important;
  }

  header h1 {
    font-size: 1.25rem !important;
    line-height: 1.25 !important;
  }

  header p {
    font-size: 0.8rem !important;
    line-height: 1.3 !important;
  }

  /* Zone de recherche */
  header > div:last-child {
    position: relative !important;
    margin-top: 1rem !important;
    margin-bottom: 1.5rem !important;
    padding: 0 1rem !important;
  }

  #search {
    width: 80vw !important;
    max-width: 320px !important;
  }

  #search-button {
    display: block !important;
    margin: 0.6rem auto 0 auto !important;
  }

  /* Décale les résultats sous le header */
  #liens-container {
    margin-top: 20rem !important;
  }
}

/* Responsive footer */
@media (max-width: 700px) {
  footer {
    padding: 1rem !important;
    margin-top: 1.5rem !important;
  }

  footer img {
    height: 36px !important;
  }

  footer div {
    max-width: 90vw !important;
  }
}
