/* Popup API Data - Styles standalone */
.kg-popup-api {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.kg-popup-api.is-active {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.kg-popup-api__overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

.kg-popup-api__dialog {
  padding: 10px;
  position: relative;
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.kg-popup-api.is-active .kg-popup-api__dialog {
  transform: scale(1);
}

.kg-popup-api__header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid #e5e5e5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.kg-popup-api__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #333;
}

/* Permettre la surcharge par les styles inline */
.kg-popup-api__title[style*="color"] {
  color: inherit;
}

.kg-popup-api__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  line-height: 1;
  color: #666;
  transition: color 0.2s ease, background 0.2s ease, opacity 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 4px;
}

.kg-popup-api__close:hover {
  color: #000;
  background: rgba(0, 0, 0, 0.1);
  opacity: 0.8;
}

/* La couleur du bouton de fermeture sera ajustée dynamiquement par JavaScript */

.kg-popup-api__close:focus {
  outline: 2px solid #0066cc;
  outline-offset: 2px;
}

.kg-popup-api__body {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.kg-popup-api__content {
  line-height: 1.6;
  color: #333;
}

/* Permettre la surcharge par les styles inline */
.kg-popup-api__content[style*="color"] {
  color: inherit;
}

.kg-popup-api__content p {
  margin-bottom: 1rem;
}

.kg-popup-api__content p:last-child {
  margin-bottom: 0;
}

/* Styles pour les balises HTML dans le contenu */
.kg-popup-api__content h1,
.kg-popup-api__content h2,
.kg-popup-api__content h3,
.kg-popup-api__content h4,
.kg-popup-api__content h5,
.kg-popup-api__content h6 {
  margin-top: 1.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: #333;
}

.kg-popup-api__content h1:first-child,
.kg-popup-api__content h2:first-child,
.kg-popup-api__content h3:first-child {
  margin-top: 0;
}

.kg-popup-api__content h2 {
  font-size: 1.25rem;
}

.kg-popup-api__content h3 {
  font-size: 1.1rem;
}

.kg-popup-api__content strong {
  font-weight: 600;
}

.kg-popup-api__content u {
  text-decoration: underline;
}

.kg-popup-api__content em {
  font-style: italic;
}

.kg-popup-api__content ul,
.kg-popup-api__content ol {
  margin: 1rem 0;
  padding-left: 2rem;
}

.kg-popup-api__content li {
  margin-bottom: 0.5rem;
}

.kg-popup-api__content a {
  color: #0066cc;
  text-decoration: underline;
}

.kg-popup-api__content a:hover {
  color: #0052a3;
}

/* Empêcher le scroll du body quand la popup est ouverte */
body.kg-popup-api-open {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
  .kg-popup-api__dialog {
    width: 95%;
    max-height: 95vh;
  }

  .kg-popup-api__header {
    padding: 1rem 1.5rem;
  }

  .kg-popup-api__title {
    font-size: 1.25rem;
  }

  .kg-popup-api__body {
    padding: 1.5rem;
  }
}

