/* ===================== RESET ===================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===================== CORPS DE PAGE ===================== */
body {
  background-color: #fff;
  color: #000;
  font-family: 'Montserrat', sans-serif;
}

/* ===================== HEADER ===================== */
.header {
  background-color: #bb0b0b;
  width: 100%;
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  position: relative; /* Pour pouvoir positionner la barre de recherche par rapport à l'en-tête */
}

.header-logo img {
  height: 30px;
}

/* Conteneur de droite : liens + icône user */
.header-user {
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Liens "NEWS", "METTRE MON EVENEMENT..." et "MES FAVORIS" */
.news-link,
.add-event-link,
.favorites-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.7rem;
  margin-right: 1rem;
}

.news-link:hover,
.add-event-link:hover,
.favorites-link:hover {
  color: #dedede;
}

/* Icône utilisateur */
.user-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

/* ===================== MAIN ===================== */
main {
  padding: 2rem;
  margin-top: 10px; /* Espace pour permettre à la barre de recherche de déborder */
}

/* ===================== BARRE DE RECHERCHE ===================== */
.search-wrapper {
  display: flex;
  justify-content: flex-start;
  margin-top: 0;
  margin-left: auto; /* Positionné à droite */
  position: absolute;
  bottom: -25px; /* Pour déborder sur le main */
  left: 15rem; /* Distance depuis la droite */
  z-index: 15; /* Plus élevé que l'en-tête */
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: #fff;
  border-radius: 50px;
  padding: 0.4rem 0.8rem;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  transition: box-shadow 0.3s ease;
}

.search-bar:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

/* Chaque "champ" de la barre de recherche */
.search-field {
  display: flex;
  flex-direction: column;
  margin: 0 0.8rem;
  max-width: 120px;
}

.search-field input {
  border: none;
  outline: none;
  font-size: 0.9rem;
  padding: 0.2rem 0;
  background: transparent;
  color: #000;
  min-width: 180px;
  font-weight: 500;
}

.field-title {
  font-size: 0.7rem;
  font-weight: 600;
  color: #555;
  margin-bottom: 0.2rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Séparateur vertical entre les champs */
.separator {
  width: 1px;
  height: 1.8rem;
  background-color: #e0e0e0;
  margin: 0 0.5rem;
}

/* Bouton de recherche */
.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  margin-left: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}

.search-btn:hover {
  transform: scale(1.05);
}

.icon-search {
  width: 45px;
  height: 45px;
  object-fit: contain;
  margin: -8px;
}

/* Titres de la page - conteneur */
.location-info {
  margin-top: 2rem;
  margin-bottom: 1rem;
  margin-left: 10rem;
  text-align: left;
}

/* Titre de la ville */
.location-info h2 {
  font-size: 2rem;
  color: #000;
  margin-bottom: 0.5rem;
}

/* Titre de la date */
.location-info h3 {
  font-size: 1.5rem;
  color: #000;
  margin-bottom: 1rem;
}

.categories-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 20px;
  max-width: 1000px;
  margin: 20px auto;
}

.filter-btn {
  border: 1px solid #bb0b0b;
  border-radius: 20px;
  background-color: transparent;
  color: #000000;
  padding: 8px 40px;
  cursor: pointer;
  font-size: 1rem;
}

.filter-btn.active {
  background-color: #bb0b0b;
  color: #fff;
}

/* ====================== CARTE ====================== */
#map {
  width: 100%;
  max-width: 1000px;
  height: 500px;
  margin: 2rem auto;
}

/* ====================== LAYOUT AVEC SIDEBAR ====================== */
.map-container {
  display: flex;
  flex-direction: row; /* Direction normale, on ne renverse pas l'ordre */
  width: 100%;
  height: 600px;
  margin-top: 2rem;
}

.sidebar {
  width: 45%;
  max-width: 600px;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-right: 1rem;
  margin-right: 20px;
  order: 1; /* S'assurer que la sidebar est toujours à gauche */
}

.sidebar::-webkit-scrollbar {
  display: none;
}

@media (max-width: 1200px) {
  .sidebar {
    width: 50%;
  }
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    margin-left: 0;
    margin-bottom: 20px;
    max-height: 400px;
    padding-left: 0;
  }
  
  .map-container {
    flex-direction: column;
  }
  
  #sidebar-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Indicateur de chargement pour la carte */
.loading-map {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  text-align: center;
  color: #777;
  width: 100%;
}

.loading-spinner {
  border: 4px solid rgba(187, 11, 11, 0.1);
  border-left-color: #BB0B0B;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spinner 1s linear infinite;
  margin-bottom: 15px;
}

.loading-map p {
  font-size: 1rem;
  color: #555;
}

.loading-error {
  padding: 20px;
  text-align: center;
  color: #e53e3e;
  background-color: #fff5f5;
  border-radius: 8px;
  margin: 20px;
}

/* Overlay de chargement pour la carte */
.map-loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.map-loading-overlay.fade-out {
  opacity: 0;
}

.map-loading-overlay .loading-spinner {
  width: 60px;
  height: 60px;
  border-width: 5px;
}

.map-loading-overlay p {
  margin-top: 20px;
  font-size: 1.1rem;
  color: #333;
  font-weight: 500;
}

@keyframes spinner {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@media (max-width: 480px) {
  #sidebar-list {
    grid-template-columns: 1fr;
  }
}

#sidebar-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  box-sizing: border-box;
}

.sidebar-event-item {
  background-color: white;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sidebar-event-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.sidebar-event-content {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.sidebar-img-container {
  width: 100%;
  height: 150px;
  overflow: hidden;
}

.sidebar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.sidebar-img:hover {
  transform: scale(1.05);
}

.sidebar-text {
  text-align: left;
  padding: 12px 15px;
}

.sidebar-title {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: bold;
  text-transform: uppercase;
  color: #000;
}

.sidebar-venue {
  margin: 8px 0 5px;
  font-size: 14px;
  font-weight: 500;
  color: #555;
}

.sidebar-date {
  display: block;
  margin: 5px 0;
  font-size: 13px;
  color: #777;
}

.sidebar-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.sidebar-favorite-btn {
  width: 24px;
  height: 24px;
  background-color: white;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #999; /* Gris par défaut */
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.sidebar-favorite-btn:hover {
  background-color: #f5f5f5;
  color: #BB0B0B;
}

.sidebar-favorite-btn.active {
  color: #BB0B0B;
}

.map-container #map {
  flex: 1;
  height: 100%;
  min-width: 200px;
  margin: 0;
  border: none;
  /* La carte occupe tout l'espace restant à droite */
  order: 2; /* S'assurer que la carte est toujours à droite */
}

/* ====================== CONTACT (contact.html) ====================== */
.contact-infos,
.contact-form {
  max-width: 600px;
  margin: 2rem auto;
  text-align: left;
}

.contact-infos h3,
.contact-form h3 {
  color: #bb0b0b;
  margin-bottom: 1rem;
}

.contact-form form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form label {
  font-weight: bold;
}

.contact-form input,
.contact-form textarea {
  padding: 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.contact-form button {
  background-color: #bb0b0b;
  color: #fff;
  border: none;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.contact-form button:hover {
  background-color: #a53131;
}

/* ===== SECTION : DES IDÉES POUR BOUGER, CRÉER, PARTAGER ! ===== */
.ideas-section {
  max-width: 1060px;
  margin: 2rem auto;
  padding: 2rem 2rem;
  background-color: #fff;
  color: #000;
}

.ideas-section h2,
.ideas-section .ideas-intro {
  text-align: left;
}

.ideas-section h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.ideas-intro {
  font-size: 1rem;
  color: #555;
  margin-bottom: 2rem;
  line-height: 1.4;
}

.ideas-cards {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.idea-card {
  background: none;
  border: none;
  box-shadow: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.smaller-card img {
  width: 210px;
  height: 190px;
  border-radius: 8px;
}

.smaller-card h3 {
  font-size: 0.7rem;
  margin: 0.5rem 0 0.3rem;
  font-weight: 600;
  color: #000;
  text-align: left;
}

.smaller-card p {
  font-size: 0.8rem;
  color: #555;
  margin: 0 0 0.5rem;
  line-height: 1.3;
  text-align: left;
}

.bigger-card img {
  width: 550px;
  height: auto;
  border-radius: 8px;
}

.ideas-cta {
  margin-top: -2.5rem;
  margin-right: 5rem;
  text-align: right;
}

.btn-discover {
  display: inline-block;
  background-color: #BB0B0B;
  border: 2px solid white;
  outline: none;
  box-shadow: 0 0 0 2px #BB0B0B;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  transition: background-color 0.3s ease;
}

.btn-discover:hover {
  background-color: #a80b0b;
  box-shadow: 0 0 0 2px #a80b0b;
}

@media (max-width: 768px) {
  .ideas-cards {
    flex-direction: column;
    align-items: flex-end;
  }
  
  .smaller-card img,
  .bigger-card img {
    width: 100%;
    max-width: 400px;
  }
}

/* ======= FOOTER ======= */
.footer {
  margin-top: 3rem;
  background-color: #BB0B0B;
  color: #fff;
  text-align: center;
  padding: 2rem 1rem;
}

.footer-wrapper {
  max-width: 1060px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.footer-top .footer-logo {
  display: block;
  margin: 2rem auto 3rem;
  max-width: 240px;
  height: auto;
}

.footer-top h2 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  line-height: 1.3;
}

.footer-top p {
  font-size: 0.7rem;
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.footer-newsletter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.footer-newsletter input[type="email"] {
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 25px;
  width: 400px;
  max-width: 100%;
}

.footer-newsletter input[type="email"]:focus {
  outline: none;
  border: none;
  color: #333;
}

.footer-newsletter button {
  background-color: #BB0B0B;
  color: #fff;
  border: 2px solid #fff;
  outline: none;
  box-shadow: 0 0 0 2px #BB0B0B;
  border-radius: 25px;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s ease;
  text-transform: uppercase;
  margin-left: -3.5rem;
  margin-top: 2px;
  margin-bottom: 2px;
}

.footer-newsletter button:hover {
  background-color: #a80b0b;
  box-shadow: 0 0 0 2px #a80b0b;
}

.footer-links {
  margin-top: 5rem;
  display: flex;
  justify-content: center;
  gap: 15rem;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column li {
  margin-bottom: 0.5rem;
  text-align: left;
}

.footer-column a {
  color: #fff;
  text-decoration: none;
  font-size: 0.8rem;
}

.footer-column a:hover {
  text-decoration: underline;
}

/* ===================== CUSTOM OVERLAY STYLES ===================== */
.custom-overlay {
  background-color: white;
  border: none;
  border-radius: 20px;
  padding: 0;
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
  transform: translate(-30%, -110%); /* Positionnement plus proche et décalé vers la droite */
  position: absolute;
  z-index: 100;
  max-width: 280px;
  transition: all 0.3s ease;
  overflow: hidden;
  cursor: pointer; /* Indique que l'infobulle est cliquable */
}

.custom-overlay:hover {
  transform: translate(-30%, -115%) scale(1.02); /* Maintenir le décalage lors du survol */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.custom-overlay .overlay-actions {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 10px;
  z-index: 2;
}

.custom-overlay .overlay-close-btn,
.custom-overlay .overlay-favorite-btn {
  width: 24px;
  height: 24px;
  background-color: white;
  border: none;
  border-radius: 50%;
  text-align: center;
  line-height: 22px;
  cursor: pointer;
  font-weight: normal;
  color: #666;
  transition: all 0.2s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-overlay .overlay-close-btn:hover,
.custom-overlay .overlay-favorite-btn:hover {
  background-color: #f5f5f5;
  color: #333;
}

.custom-overlay .overlay-favorite-btn {
  color: #999; /* Gris par défaut */
  transition: color 0.3s ease;
}

.custom-overlay .overlay-favorite-btn:hover {
}

.custom-overlay .overlay-favorite-btn.active {
  color: #BB0B0B; /* Rouge quand favori actif */
}

.custom-overlay .overlay-img-container {
  width: 100%;
  margin: 0;
  overflow: hidden;
}

.custom-overlay .overlay-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.custom-overlay .overlay-img:hover {
  transform: scale(1.05);
}

.custom-overlay .overlay-text {
  text-align: left;
  padding: 12px 15px;
}

.custom-overlay .overlay-title {
  margin: 0 0 8px 0;
  font-size: 15px;
  font-weight: bold;
  text-transform: uppercase;
  color: #000;
  /* Réinitialiser les styles hérités du h3 général */
  padding: 0;
  text-align: left;
}

.custom-overlay .overlay-venue {
  margin: 8px 0 5px;
  font-size: 14px;
  font-weight: 500;
  color: #555;
  text-align: left;
}

.custom-overlay .overlay-date {
  display: block;
  margin: 5px 0;
  font-size: 13px;
  color: #777;
  text-align: left;
  background: none;
  padding: 0;
}

/* Styles pour les notifications de favoris */
.favorite-confirmation,
.favorite-error {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  border-radius: 5px;
  z-index: 1000;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  animation: fadeIn 0.3s ease, fadeOut 0.3s ease 2.7s;
}

.favorite-confirmation {
  background-color: #4CAF50;
  color: white;
}

.favorite-error {
  background-color: #f44336;
  color: white;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(20px); }
}
