/* Layer Selection Panel Styles */
#layerSelection {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 9999;
  background: white;
  border: 1px solid black;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  padding: 0;
  min-width: 280px;
  max-width: 320px;
  overflow: hidden;
}

#layerSelection .layer-header {
  background: white;
  color: black;
  border-bottom: 1px solid black;
  padding: 16px 20px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

#layerSelection .layer-header:hover {
  background: #f5f5f5;
}

#layerSelection .layer-header .layer-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

#layerSelection .layer-header .layer-title i {
  font-size: 18px;
}

#layerSelection .layer-header .layer-toggle {
  font-size: 18px;
  transition: transform 0.3s;
}

#layerSelection.collapsed .layer-header .layer-toggle {
  transform: rotate(180deg);
}

#layerSelection .layer-content {
  max-height: 500px;
  overflow-y: auto;
  transition: max-height 0.3s ease-out;
}

#layerSelection.collapsed .layer-content {
  max-height: 0;
  overflow: hidden;
}

#layerSelection .layer-group {
  border-bottom: 1px solid #f0f0f0;
}

#layerSelection .layer-group:last-child {
  border-bottom: none;
}

#layerSelection .layer-group-title {
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  color: black;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

#layerSelection .layer-item {
  padding: 12px 20px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s;
  border-left: 3px solid transparent;
}

#layerSelection .layer-item:hover {
  background: #f8f9fa;
  border-left-color: #667eea;
}

#layerSelection .layer-item.active {
  background: #e8eaf6;
  border-left-color: #667eea;
}

#layerSelection .layer-item input[type="radio"],
#layerSelection .layer-item input[type="checkbox"] {
  margin-right: 10px;
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #667eea;
}

#layerSelection .layer-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  cursor: pointer;
}

#layerSelection .layer-item.active label {
  font-weight: 600;
}

#layerSelection .layer-item .layer-preview {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
}

#layerSelection .layer-item .layer-name {
  flex: 1;
  color: black;
}

#layerSelection .layer-item-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  object-fit: contain;
}

#layerSelection .layer-item .layer-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 10px;
  background: #e3f2fd;
  color: #1976d2;
  font-weight: 500;
}

/* Responsive */
@media (max-width: 1024px) {
  #layerSelection {
    max-width: 300px;
  }
}

@media (max-width: 768px) {
  #layerSelection {
    right: 10px;
    left: auto;
    top: 80px;
    min-width: 280px;
    max-width: calc(100vw - 20px);
    width: auto;
  }
  
  #layerSelection .layer-header {
    padding: 12px 16px;
    font-size: 15px;
  }
  
  #layerSelection .layer-content {
    max-height: 400px;
  }
  
  #layerSelection .layer-group-title {
    padding: 10px 16px;
    font-size: 12px;
  }
  
  #layerSelection .layer-item {
    padding: 10px 16px;
  }
  
  #layerSelection .layer-item label {
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  #layerSelection {
    right: 5px;
    left: auto;
    top: 70px;
    min-width: auto;
    max-width: calc(100vw - 10px);
    width: 280px;
  }
  
  #layerSelection .layer-header {
    padding: 10px 12px;
    font-size: 14px;
  }
  
  #layerSelection .layer-content {
    max-height: 350px;
  }
  
  #layerSelection .layer-group-title {
    padding: 8px 12px;
    font-size: 11px;
  }
  
  #layerSelection .layer-item {
    padding: 8px 12px;
  }
  
  #layerSelection .layer-item label {
    font-size: 12px;
  }
}

