/* =========================================================
   STYLES DE LA LÉGENDE DYNAMIQUE
   ========================================================= */

#legend-panel {
  width: 220px;
  max-height: 400px;
  min-height: 100px;
}

#legend-panel .panel-content {
  padding: 10px;
  overflow-y: auto;
}

/* Liste de légende */
.legend-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.legend-empty {
  text-align: center;
  color: #999;
  font-size: 11px;
  padding: 15px;
  font-style: italic;
}

/* Item de légende */
.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: #f9f9f9;
  border-radius: 4px;
  border: 1px solid #eee;
}

.legend-item:hover {
  background: #f0f0f0;
}

.legend-item-geoserver {
  display: flex;
  align-items: center;
}

/* Symbole */
.legend-symbol {
  flex-shrink: 0;
  width: 30px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.legend-symbol svg {
  display: block;
}

.legend-symbol-geoserver {
  width: 24px;
  height: 24px;
  justify-content: center;
}

.legend-graphic {
  display: block;
  max-width: 24px;
  max-height: 24px;
  object-fit: contain;
}

/* Label */
.legend-label {
  font-size: 11px;
  color: #333;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-label-title {
  display: block;
  margin-bottom: 6px;
  white-space: normal;
  overflow: visible;
  text-overflow: initial;
}

.legend-label-geoserver {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Style catégorisé */
.legend-categorized {
  display: flex;
  gap: 2px;
  align-items: center;
}

/* Responsive */
@media (max-width: 768px) {
  #legend-panel {
    width: 180px;
    max-height: 300px;
  }
  
  .legend-item {
    padding: 4px 6px;
  }
  
  .legend-label {
    font-size: 10px;
  }
}
