/* ============================================
   Resources Mega Menu — Styles consolidés
   (ex resources-megamenu.css + resources-megamenu-fix.css)
   ============================================ */

/* --------------------------------------------
   1. Reset des styles conflictuels de new-ui.css L357-369
   header .dropdown-menu a { font-size:16px; color:#080025; margin:1px 0; padding:8px 15px; border-radius:8px }
   header .dropdown-menu a:hover { background:#FFEDF0; color:#fc2249 }
   Spécificité (0,2,1) bat (0,1,2)
   -------------------------------------------- */
header .dropdown-menu.resources-megamenu a {
  font-size: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
  border-radius: 0;
}
header .dropdown-menu.resources-megamenu a:hover {
  background: transparent;
  color: inherit;
}

/* Protection contre les styles génériques du header */
header .navbar .dropdown-menu.resources-megamenu {
  padding: 0;
  border: 0;
  margin-top: 8px;
}

/* --------------------------------------------
   2. Conteneurs mega-menu — 4 variantes
   -------------------------------------------- */
header .dropdown-menu.resources-megamenu {
  position: absolute;
  top: 100%;
  min-width: 650px;
  max-width: 95vw;
  background: #fff;
  box-shadow: 0px 0px 14px rgba(8, 0, 37, 0.1);
  border-radius: 8px;
  padding: 0;
  margin-top: 8px;
  border: 0;
}

header .dropdown-menu.location-megamenu {
  position: absolute;
  top: 100%;
  min-width: 620px;
  max-width: 95vw;
  background: #fff;
  box-shadow: 0px 0px 14px rgba(8, 0, 37, 0.1);
  border-radius: 8px;
  padding: 0;
  margin-top: 8px;
  border: 0;
  width: auto;
}

header .dropdown-menu.rentabilisez-megamenu {
  position: absolute;
  top: 100%;
  min-width: 680px;
  max-width: 95vw;
  background: #fff;
  box-shadow: 0px 0px 14px rgba(8, 0, 37, 0.1);
  border-radius: 8px;
  padding: 0;
  margin-top: 8px;
  border: 0;
  width: auto;
}

header .dropdown-menu.community-megamenu {
  position: absolute;
  top: 100%;
  min-width: 720px;
  max-width: 95vw;
  background: #fff;
  box-shadow: 0px 0px 14px rgba(8, 0, 37, 0.1);
  border-radius: 8px;
  padding: 0;
  margin-top: 8px;
  border: 0;
  width: auto;
}

/* --------------------------------------------
   3. Contenu grid
   -------------------------------------------- */
.resources-megamenu-content {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  padding: 24px 32px;
}

.resources-column {
  min-width: 250px;
}

/* --------------------------------------------
   4. Titres de colonnes
   -------------------------------------------- */
.resources-column-title {
  color: #fc2249;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --------------------------------------------
   5. Liens simples .resources-link
   -------------------------------------------- */
header .dropdown-menu .resources-link {
  display: block;
  width: 100%;
  padding: 4px 0;
  color: #9b9b9b;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.2s;
  line-height: 1.6;
  clear: both;
}

header .dropdown-menu .resources-link:hover {
  color: #080025;
  text-decoration: none;
  background: transparent;
}

/* --------------------------------------------
   6. Items avec descriptions
   Spécificité base (0,2,1) ; media query (0,3,1) bat le reset (0,2,1)
   -------------------------------------------- */
header .dropdown-menu .resources-item-with-desc {
  margin-bottom: 24px;
  cursor: pointer;
  transition: all 0.2s;
  padding: 6px 8px;
  margin-left: -8px;
  margin-right: -8px;
  border-radius: 8px;
  text-decoration: none;
  display: block;
}

header .dropdown-menu .resources-item-with-desc:hover {
  background: #FFEDF0;
  text-decoration: none;
}

header .dropdown-menu .resources-item-with-desc:hover .resources-item-title {
  color: #fc2249;
}

header .dropdown-menu .resources-item-with-desc:hover .resources-item-desc {
  color: #fc2249;
}

/* --------------------------------------------
   7. Titres, descriptions, icônes d'items
   -------------------------------------------- */
.resources-item-title {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #080025;
  font-size: 16px;
  transition: all 0.2s;
  line-height: 1.6;
  margin-bottom: 2px;
  text-decoration: none;
}

.resources-item-title:hover {
  text-decoration: none;
}

.resources-item-icon {
  width: 20px;
  height: 20px;
  color: #fc2249;
}

.resources-item-desc {
  color: #9b9b9b;
  font-size: 14px;
  line-height: 1.4;
  margin-left: 32px;
  padding-right: 4px;
}

/* Badge "Nouveau" */
.resources-item-title .badge {
  background-color: #EDFFF0;
  color: #28933A;
  font-size: 11px;
  padding: 3px 8px;
  font-weight: 600;
  vertical-align: middle;
}

/* --------------------------------------------
   8. Box du bas .resources-bottom-box
   -------------------------------------------- */
.resources-bottom-box {
  background: var(--Primary-50, #fff4f6);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 32px;
  padding: 16px 24px;
  align-self: stretch;
  border-top: 1px solid #e5e7eb;
}

header .dropdown-menu .resources-bottom-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fc2249;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
  padding: 4px 8px;
  border-radius: 6px;
  margin: -4px -8px;
}

/* Ordre correct dans la grille */
.resources-bottom-link:nth-child(1) { grid-column: 1; grid-row: 1; }
.resources-bottom-link:nth-child(2) { grid-column: 2; grid-row: 1; }
.resources-bottom-link:nth-child(3) { grid-column: 1; grid-row: 2; }
.resources-bottom-link:nth-child(4) { grid-column: 2; grid-row: 2; }

.resources-bottom-link:hover {
  background: rgba(252, 34, 73, 0.08);
  color: #fc2249;
  text-decoration: none;
}

.resources-bottom-icon {
  width: 18px;
  height: 18px;
  color: #fc2249;
}

/* Règles spécifiques pour forcer l'application */
#navbarDropdown2 + .dropdown-menu .resources-bottom-link {
  color: #fc2249;
}

#navbarDropdown2 + .dropdown-menu .resources-bottom-box {
  gap: 4px 32px;
}

/* --------------------------------------------
   9. Override Bootstrap dropdown styles
   -------------------------------------------- */
#navbarDropdown2 + .dropdown-menu,
#navbarDropdown3 + .dropdown-menu,
#navbarDropdown4 + .dropdown-menu,
#navbarDropdown5 + .dropdown-menu {
  border: none;
  padding: 0;
}

.nav-item.dropdown .resources-megamenu {
  display: none;
}

.nav-item.dropdown.show .resources-megamenu {
  display: block;
}

/* --------------------------------------------
   10. Media query desktop — spécificités élevées
   -------------------------------------------- */
@media (min-width: 992px) {
  /* Liens .resources-link — gris 14px */
  header .dropdown-menu .resources-link {
    display: block;
    width: 100%;
    font-size: 14px;
    color: #9b9b9b;
    padding: 6px 0;
    margin: 0 0 6px 0;
    background: transparent;
    border-radius: 0;
    font-weight: normal;
    clear: both;
    float: none;
  }

  header .dropdown-menu .resources-link:hover {
    color: #080025;
    background: #f9fafb;
    border-radius: 6px;
    padding: 8px 12px;
    margin: 0 -12px;
  }

  /* Items avec descriptions — spécificité (0,3,1) bat le reset (0,2,1) */
  header .dropdown-menu.resources-megamenu .resources-item-with-desc {
    border-radius: 8px;
    margin-bottom: 24px;
    padding: 12px 16px;
    margin-left: -16px;
    margin-right: -16px;
  }

  header .dropdown-menu.resources-megamenu .resources-item-with-desc:hover {
    background: #FFEDF0;
    border-radius: 8px;
  }

  header .dropdown-menu.resources-megamenu .resources-item-with-desc:last-child {
    margin-bottom: 0;
  }

  header .dropdown-menu.resources-megamenu .resources-item-with-desc .resources-item-title,
  header .dropdown-menu.resources-megamenu .resources-item-with-desc .resources-item-desc {
    margin: 0;
    padding: 0;
  }

  /* Liens du bas — rouges */
  header .dropdown-menu .resources-bottom-link {
    font-size: 14px;
    color: #fc2249;
    padding: 8px 12px;
    margin: -8px -12px;
    background: transparent;
    font-weight: 500;
    border-radius: 6px;
  }

  header .dropdown-menu .resources-bottom-link:hover {
    background: rgba(252, 34, 73, 0.08);
    color: #fc2249;
    border-radius: 6px;
  }
}

/* --------------------------------------------
   11. Variantes par menu — Location
   -------------------------------------------- */
header .dropdown-menu.location-megamenu .resources-megamenu-content {
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
  padding: 20px 24px;
}

header .dropdown-menu.location-megamenu .resources-column {
  min-width: 270px;
}

/* --------------------------------------------
   12. Variantes par menu — Rentabilisez
   -------------------------------------------- */
header .dropdown-menu.rentabilisez-megamenu .resources-megamenu-content {
  grid-template-columns: repeat(2, 1fr);
  gap: 50px;
  padding: 20px 32px;
}

header .dropdown-menu.rentabilisez-megamenu .resources-column {
  min-width: 280px;
}

/* --------------------------------------------
   13. Section vidéo Communauté
   -------------------------------------------- */
header .dropdown-menu .community-megamenu-content {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  padding: 24px;
  align-items: stretch;
}

.community-left-section {
  padding-right: 20px;
}

.community-video-section {
  background: #f9fafb;
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 320px;
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 16px;
  cursor: pointer;
}

.video-thumbnail {
  width: 100%;
  height: auto;
  display: block;
}

.video-play-button {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-play-button:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: translate(-50%, -50%) scale(1.1);
}

.video-play-button i {
  margin-left: 3px;
}

.video-title {
  font-size: 18px;
  font-weight: 600;
  color: #080025;
  margin-bottom: 8px;
  line-height: 1.3;
}

.video-desc {
  font-size: 14px;
  color: #9b9b9b;
  line-height: 1.5;
  margin: 0;
}

/* --------------------------------------------
   14. Transitions d'ouverture/fermeture
   -------------------------------------------- */
.navbar-nav .dropdown .resources-megamenu {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease-in-out;
  pointer-events: none;
}

.navbar-nav .dropdown.show .resources-megamenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.navbar-nav .dropdown:hover .resources-megamenu {
  display: block;
}

/* --------------------------------------------
   15. Hover nav-link menu principal
   -------------------------------------------- */
.navbar-nav .nav-item.dropdown .nav-link {
  position: relative;
  padding: 8px 16px;
  border-radius: 8px;
  transition: all 0.3s ease;
  color: inherit;
  text-decoration: none;
}

.navbar-nav .nav-item.dropdown .nav-link:hover {
  background-color: rgba(108, 117, 125, 0.03);
  color: inherit;
  text-decoration: none;
}

.navbar-nav .nav-item.dropdown.show .nav-link {
  background-color: rgba(108, 117, 125, 0.04);
  color: inherit;
}

.navbar-nav .nav-item.dropdown.show .nav-link:hover {
  background-color: rgba(108, 117, 125, 0.06);
}

/* --------------------------------------------
   16. Modal vidéo YouTube
   -------------------------------------------- */
#communityVideoModal {
  z-index: 9999;
}

#communityVideoModal .youtube-video-wrapper {
  border: none;
  background: #000;
}

#communityVideoModal .youtube-video-wrapper iframe {
  width: 100%;
  height: 400px;
  border: none;
}

#communityVideoModal .modal-header {
  border-bottom: none;
  padding: 15px 15px 0;
  position: absolute;
  top: 0;
  right: 0;
  z-index: 10;
  background: transparent;
}

#communityVideoModal .modal-header .close {
  opacity: 0.8;
  font-size: 1.5rem;
  color: white;
  text-shadow: none;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#communityVideoModal .modal-header .close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.8);
}
