/* ---- Bandeau principal ---- */
#cookie-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 650px;
  background: rgba(34, 34, 34, 0.95);
  color: #f1f1f1;
  border-radius: 12px;
  padding: 30px 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  z-index: 9999;
  font-family: system-ui, sans-serif;
  display: none;
  min-height: 250px;
  box-sizing: border-box;
}

#cookie-banner p {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.6;
  color: #f1f1f1;
}

#cookie-banner .banner-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

#cookie-banner .banner-header img {
  height: 40px;
  margin-right: 10px;
  border-radius: 6px;
}

#cookie-banner .banner-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #f1f1f1;
}

/* Boutons centrés et uniformes */
#cookie-banner .buttons {
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 15px;
}

#cookie-banner button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
  background: #1976d2;
  color: white;
  flex: unset; /* ne plus utiliser flex pour ne pas agrandir */
  width: auto;
  min-width: 120px;
}

#cookie-banner button:hover {
  background: #1565c0;
}

/* Footer du bandeau */
#cookie-banner .banner-footer {
  margin-top: 10px;
  font-size: 12px;
  text-align: center;
  color: #ccc;
}

#cookie-banner .banner-footer a {
  color: #4fc3f7;
  text-decoration: none;
  margin: 0 5px;
}

#cookie-banner .banner-footer a:hover {
  text-decoration: underline;
}

/* ---- Modal de personnalisation ---- */
#cookie-modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  box-sizing: border-box;
}

/* Contenu modal (par défaut desktop) */
#cookie-modal .modal-content {
  background: rgba(34, 34, 34, 0.95);
  border-radius: 12px;
  padding: 25px 20px;
  width: 90%;
  max-width: 550px;
  font-family: system-ui, sans-serif;
  color: #f1f1f1;
  box-shadow: 0 6px 25px rgba(0,0,0,0.35);

  /* Scroll interne si beaucoup de texte */
  max-height: 80vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

/* Scrollbar stylée (Chrome/Edge/Safari) */
#cookie-modal .modal-content::-webkit-scrollbar {
  width: 6px;
}
#cookie-modal .modal-content::-webkit-scrollbar-track {
  background: transparent;
}
#cookie-modal .modal-content::-webkit-scrollbar-thumb {
  background: #666;
  border-radius: 3px;
}

#cookie-modal h2 {
  margin-top: 0;
  font-size: 20px;
  color: #fff;
  text-align: center;
}

#cookie-modal .options {
  margin: 20px 0;
}

#cookie-modal label {
  display: flex;
  align-items: center;
  margin: 8px 0;
  font-size: 14px;
  font-weight: 600;
  color: #f1f1f1;
}

#cookie-modal input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
}

#cookie-modal .option-desc {
  font-size: 13px;
  color: #ccc;
  margin-left: 25px;
  margin-bottom: 12px;
  line-height: 1.5;
}

/* Boutons modal */
#cookie-modal .modal-buttons {
  text-align: center;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

#cookie-modal button {
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  width: auto;
  min-width: 120px;
  max-width: 150px;
  transition: background 0.2s ease;
}

#savePreferences {
  background: #1976d2;
  color: #fff;
}
#savePreferences:hover {
  background: #1565c0;
}

#cancelPreferences {
  background: #9e9e9e;
  color: #fff;
}
#cancelPreferences:hover {
  background: #7e7e7e;
}

/* Bouton croix (fermeture mobile/desktop) */
#cookie-modal .close-btn {
  display: none; /* caché par défaut */
  position: relative;
  float: right;
  font-size: 36px;
  font-weight: bold;
  color: #fff;
  cursor: pointer;
  background: none;
  border: none;
  padding : 5px;
}

/* ---- Version mobile ---- */
@media (max-width: 600px) {
  #cookie-modal {
    padding: 0;
  }
  #cookie-modal .modal-content {
    width: 100%;
    height: 70%;
    max-width: none;
    max-height: none;
    border-radius: 0;
    padding: 20px;
    overflow-y: auto;
  }
  #cookie-modal .close-btn {
    display: block; /* visible sur mobile */
  }
}
#savePreferences {
  background: #1976d2;
  color: #fff;
}

#savePreferences:hover {
  background: #1565c0;
}

#cancelPreferences {
  background: #9e9e9e;
  color: #fff;
}

#cancelPreferences:hover {
  background: #7e7e7e;
}

/* Responsive : boutons empilés sur petits écrans */
@media (max-width: 400px) {
  #cookie-modal .modal-buttons,
  #cookie-banner .buttons {
    flex-direction: column;
  }
  #cookie-modal button,
  #cookie-banner button {
    max-width: 100%;
  }
}

/* ---- Lien persistent ---- */
#modifyConsent {
  display: block;
  text-align: center;
  font-size: 13px;
  margin: 20px auto;
  color: #fff;
  cursor: pointer;
}

/* ---- Placeholder YouTube ---- */
.youtube-placeholder {
  background: #000;
  color: #fff;
  text-align: center;
  padding: 40px;
  border-radius: 12px;
  margin: 20px 0;
}

.youtube-placeholder button {
  margin-top: 15px;
  padding: 10px 20px;
  border-radius: 6px;
  border: none;
  background: #d32f2f;
  color: #fff;
  cursor: pointer;
}