.ddselect-wrapper {
  display: flex;
  gap: 20px;
}

.ddselect-options, .ddselect-selection {
  width: 50%;
}

.ddselect-list {
  border: 1px solid #ccc;
  min-height: 100px;
  padding: 10px;
  list-style: none;
  background: #f9f9f9;
  width: 100%;
  box-sizing: border-box;
}

.ddselect-list li {
  background: white;
  border: 1px solid #ccc;
  margin-bottom: 5px;
  padding: 8px 10px 8px 5px;
  cursor: move;
  display: flex;
  align-items: flex-start;
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  flex-wrap: wrap;
  gap: 8px;
}

.ddselect-label-text {
  flex: 1 1 auto;
  min-width: 120px;
  white-space: normal;
  word-break: break-word;
  margin-right: 8px;
  align-self: flex-start;
}

.ddselect-score-wrap {
  flex: 0 0 80px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 80px;
  position: relative;
  z-index: 2;
}

.ddselect-score {
  width: 90px;
  min-width: 0;
  text-align: right;
  pointer-events: auto !important;  /* Ensure it's clickable */
  position: relative;
  z-index: 10;  /* Higher z-index to ensure clickability */
  cursor: text !important; /* Ensure text cursor */
}

/* Follow-up text field styles */
.ddselect-followup-wrap {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  position: relative;
  z-index: 2;
}

.ddselect-followup-label {
  font-size: 12px;
  font-weight: 500;
  color: #555;
  margin: 0;
  display: block;
}

.ddselect-followup-text {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 13px;
  min-height: 32px;
  box-sizing: border-box;
  pointer-events: auto !important;
  position: relative;
  z-index: 10;
  cursor: text !important;
  resize: vertical;
}

.ddselect-followup-text:focus {
  border-color: #0073aa;
  outline: none;
  box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.3);
}

/* Follow-up select field styles */
.ddselect-followup-select-wrap {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  position: relative;
  z-index: 2;
}

.ddselect-followup-select-label {
  font-size: 12px;
  font-weight: 500;
  color: #555;
  margin: 0;
  display: block;
}

.ddselect-followup-select {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #ddd;
  border-radius: 3px;
  font-size: 13px;
  min-height: 32px;
  box-sizing: border-box;
  pointer-events: auto !important;
  position: relative;
  z-index: 10;
  cursor: pointer !important;
  background-color: white;
}

.ddselect-followup-select:focus {
  border-color: #0073aa;
  outline: none;
  box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.3);
}

/* Make sure increment/decrement buttons are clickable */
.ddselect-score::-webkit-inner-spin-button, 
.ddselect-score::-webkit-outer-spin-button { 
  opacity: 1;
  pointer-events: auto !important;
  z-index: 20;
  position: relative;
  cursor: pointer !important;
  height: 20px;
}

.ddselect-empty-message {
  color: #777;
  font-style: italic;
  background: transparent !important;
  border: none !important;
  text-align: center;
  cursor: default !important;
  padding: 15px 5px !important;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Style for initial state - no selections made yet */
.ddselect-empty-message[data-state="initial"] {
  color: #0073aa;
}

/* Style for cleared state - selections were removed */
.ddselect-empty-message[data-state="cleared"] {
  color: #d63638;
}

/* Dragging helper styles */
.ddselect-list li.ui-sortable-helper {
  width: auto !important;
  max-width: 600px !important;
  min-width: 450px !important;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  border: 2px solid #0073aa;
  background: #f0f8ff !important;
  z-index: 1000;
}

/* Hide additional fields during drag to keep it simple */
.ddselect-list li.ui-sortable-helper .ddselect-score-wrap,
.ddselect-list li.ui-sortable-helper .ddselect-followup-wrap,
.ddselect-list li.ui-sortable-helper .ddselect-followup-select-wrap {
  display: none !important;
}

/* Ensure label text is visible and properly styled during drag */
.ddselect-list li.ui-sortable-helper .ddselect-label-text {
  flex: 1 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 0;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .ddselect-wrapper {
    flex-direction: column;
    gap: 15px;
  }
  
  .ddselect-options, .ddselect-selection {
    width: 100%;
  }
  
  .ddselect-list li {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .ddselect-label-text {
    margin-right: 0;
    margin-bottom: 4px;
  }
  
  .ddselect-score-wrap {
    align-self: flex-start;
  }
  
  .ddselect-followup-wrap {
    margin-top: 4px;
  }
  
  .ddselect-followup-select-wrap {
    margin-top: 4px;
  }
}
