/**
 * Styles pour la carte interactive des projets
 */

.cp-projects-map-wrapper {
  margin: 20px 0;
}

.cp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 20px;
  padding: 20px;
  background: #dddddd;
  border-radius: 8px;
}

.cp-filter {
  flex: 1;
  min-width: 200px;
  display: flex;
  flex-direction: column;
}

.cp-filter label {
  font-weight: 600;
  margin-bottom: 5px;
  color: #333;
  font-size: 14px;
}

.cp-filter-select {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: white;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.cp-filter-select:hover {
  border-color: #0064b4;
}

.cp-filter-select:focus {
  outline: none;
  border-color: #0064b4;
  box-shadow: 0 0 0 3px rgba(0, 100, 180, 0.1);
}

.cp-projects-map {
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1;
}

.cp-marker-popup {
  min-width: 200px;
  max-width: 300px;
}

.cp-marker-popup h4 {
  font-size: 16px;
  color: #333;
}

.cp-marker-popup p {
  color: #666;
  line-height: 1.4;
}

.cp-projects-map-wrapper {
  --cp-cluster-base: #0064b4;
  --cp-cluster-dark: #004b87;
  --cp-cluster-light: #3f9ae0;
  --cp-cluster-ring: rgba(0, 100, 180, 0.2);
  --cp-cluster-medium-light: #58ace8;
  --cp-cluster-large-light: #7abef0;
}

.cp-permanent-cluster {
  background: transparent;
  border: none;
}

.cp-simple-project-marker {
  background: transparent;
  border: none;
}

.cp-simple-project-marker svg {
  display: block;
  width: 100%;
  height: 100%;
}

.cp-permanent-cluster span {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 19px;
  background: linear-gradient(145deg, var(--cp-cluster-light), var(--cp-cluster-base) 55%, var(--cp-cluster-dark));
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  border: 2px solid #fff;
  box-shadow: 0 10px 22px rgba(0, 75, 135, 0.28);
}

.cp-projects-map-wrapper .marker-cluster-small,
.cp-projects-map-wrapper .marker-cluster-medium,
.cp-projects-map-wrapper .marker-cluster-large {
  background: var(--cp-cluster-ring);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cp-projects-map-wrapper .marker-cluster-small div,
.cp-projects-map-wrapper .marker-cluster-medium div,
.cp-projects-map-wrapper .marker-cluster-large div {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(145deg, var(--cp-cluster-light), var(--cp-cluster-base) 58%, var(--cp-cluster-dark));
  border: 2px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 24px rgba(0, 75, 135, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.cp-projects-map-wrapper .marker-cluster-small {
  background: rgba(0, 100, 180, 0.14);
}

.cp-projects-map-wrapper .marker-cluster-small div {
  background: linear-gradient(145deg, #5db0ea, var(--cp-cluster-base) 58%, var(--cp-cluster-dark));
  box-shadow: 0 8px 18px rgba(0, 75, 135, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.cp-projects-map-wrapper .marker-cluster-medium {
  background: rgba(0, 100, 180, 0.2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 0 8px rgba(0, 100, 180, 0.08);
}

.cp-projects-map-wrapper .marker-cluster-medium div {
  background: linear-gradient(145deg, var(--cp-cluster-medium-light), #1981cf 55%, var(--cp-cluster-dark));
  box-shadow: 0 12px 24px rgba(0, 75, 135, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.cp-projects-map-wrapper .marker-cluster-large {
  background: rgba(0, 100, 180, 0.24);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35), 0 0 0 10px rgba(0, 100, 180, 0.1);
}

.cp-projects-map-wrapper .marker-cluster-large div {
  background: linear-gradient(145deg, var(--cp-cluster-large-light), #2d93de 52%, var(--cp-cluster-dark));
  box-shadow: 0 14px 28px rgba(0, 75, 135, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.cp-projects-map-wrapper .marker-cluster-small:hover,
.cp-projects-map-wrapper .marker-cluster-medium:hover,
.cp-projects-map-wrapper .marker-cluster-large:hover,
.cp-projects-map-wrapper .cp-permanent-cluster:hover span {
  transform: translateY(-1px) scale(1.04);
}

.cp-projects-map-wrapper .marker-cluster-small:hover {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.38), 0 10px 22px rgba(0, 75, 135, 0.18);
}

.cp-projects-map-wrapper .marker-cluster-medium:hover {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.38), 0 0 0 8px rgba(0, 100, 180, 0.1), 0 12px 24px rgba(0, 75, 135, 0.22);
}

.cp-projects-map-wrapper .marker-cluster-large:hover {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.4), 0 0 0 10px rgba(0, 100, 180, 0.12), 0 14px 28px rgba(0, 75, 135, 0.24);
}

.cp-projects-map-wrapper .cp-permanent-cluster span {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cp-cluster-selection-list {
  display: grid;
  gap: 10px;
}

.cp-cluster-project-item {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  text-align: left;
  padding: 12px;
  cursor: pointer;
}

.cp-cluster-project-item span {
  display: block;
  margin-top: 6px;
  color: #666;
  font-size: 13px;
  line-height: 1.4;
}

.cp-cluster-project-item:hover {
  border-color: #0064b4;
  background: #f6fbff;
}

.cp-view-details {
  background: #0064b4;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.3s ease;
}

.cp-view-details:hover {
  background: #004d8c;
}

.cp-project-details {
  margin-top: 30px;
  padding: 30px;
  background: linear-gradient(180deg, #ffffff, #f8fbfe);
  border: 1px solid #d8e4ef;
  border-radius: 18px;
  box-shadow: 0 18px 40px rgba(18, 42, 66, 0.08);
}

.cp-project-details h3 {
  margin-top: 0;
  margin-bottom: 24px;
  color: #0064b4;
  font-size: 28px;
  line-height: 1.2;
  border-bottom: 1px solid #d8e4ef;
  padding-bottom: 16px;
}

.cp-project-layout {
  display: grid;
  gap: 28px;
}

.cp-project-main {
  min-width: 0;
}

.cp-project-thumbnail {
  margin-bottom: 24px;
  border-radius: 16px;
  overflow: hidden;
  background: #eef5fb;
  box-shadow: 0 10px 28px rgba(18, 42, 66, 0.08);
}

.cp-project-details img,
.cp-project-thumbnail img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 0;
  margin: 0;
}

.cp-project-content {
  color: #2a3947;
}

.cp-project-content > *:first-child {
  margin-top: 0;
}

.cp-project-content > *:last-child {
  margin-bottom: 0;
}

.cp-project-content p,
.cp-project-content li {
  line-height: 1.7;
}

.cp-project-content h2,
.cp-project-content h3,
.cp-project-content h4 {
  color: #16344d;
  margin-top: 1.4em;
  margin-bottom: 0.6em;
}

.cp-project-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.cp-project-meta-group {
  min-width: 0;
  padding: 22px;
  background: #fdfefe;
  border: 1px solid #dce7f1;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(18, 42, 66, 0.06);
}

.cp-project-meta-group-heading {
  margin: 0 0 16px;
  color: #16344d;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.cp-project-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.cp-project-meta-item {
  min-width: 0;
  padding: 16px 18px;
  background: #fff;
  border: 1px solid #dce7f1;
  border-radius: 14px;
  box-shadow: 0 8px 20px rgba(18, 42, 66, 0.05);
}

.cp-project-meta-title {
  margin: 0 0 8px;
  color: #0064b4;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cp-project-meta-value {
  color: #32485c;
  font-size: 15px;
  line-height: 1.6;
}

.cp-project-meta-value a {
  color: #0064b4;
  font-weight: 600;
  text-decoration: none;
}

.cp-project-meta-value a:hover,
.cp-project-meta-value a:focus {
  text-decoration: underline;
}

/* Lien "Accéder au document" */
.cp-project-document {
  margin-top: 24px;
  text-align: center;
}

.cp-project-document-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 32px;
  background: #0064b4;
  color: #fff !important;
  font-size: 15px;
  font-weight: 700;
  border-radius: 10px;
  text-decoration: none !important;
  box-shadow: 0 4px 14px rgba(0, 100, 180, 0.30);
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.cp-project-document-link::before {
  content: "📄";
  font-style: normal;
}

.cp-project-document-link:hover,
.cp-project-document-link:focus {
  background: #004d8c;
  box-shadow: 0 6px 20px rgba(0, 100, 180, 0.40);
  transform: translateY(-1px);
  text-decoration: none !important;
}

/* Responsive */
@media (max-width: 768px) {
  .cp-filters {
    flex-direction: column;
  }
  
  .cp-filter {
    width: 100%;
  }
  
  .cp-projects-map {
    height: 400px !important;
  }
  
  .cp-project-details {
    padding: 20px;
  }

  .cp-project-layout {
    gap: 20px;
  }

  .cp-project-groups {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .cp-project-meta-grid {
    grid-template-columns: 1fr;
  }
  
  .cp-project-details h3 {
    font-size: 22px;
  }
}

/* Animation de chargement */
@keyframes cpPulse {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
  100% {
    opacity: 1;
  }
}

.cp-project-details.loading {
  animation: cpPulse 1.5s ease-in-out infinite;
}

/* Style des popups Leaflet */
.leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
  margin: 15px;
}

.leaflet-popup-tip {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.cp-projects-map-wrapper .leaflet-control-layers {
  border: 0;
  border-radius: 10px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  overflow: hidden;
}

.cp-projects-map-wrapper .leaflet-control-layers-toggle {
  width: 34px;
  height: 34px;
  background-size: 18px 18px;
  opacity: 0.86;
}

.cp-projects-map-wrapper .leaflet-control-layers-expanded {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.94);
  color: #2f3b45;
}

.cp-projects-map-wrapper .leaflet-control-layers label {
  font-size: 13px;
  line-height: 1.4;
}