@use '../../../../shared/styles/settings-shared' as settings;

.settings-card {
  @include settings.settings-card;
}

.section-header {
  @include settings.settings-section-header;
}

.section-title {
  @include settings.settings-section-title;
}

.section-description {
  @include settings.settings-section-description;
}

.section-body {
  @include settings.settings-section-body;
}

.setting-item {
  @include settings.settings-item;
}

.setting-header {
  @include settings.settings-item-header;
}

.setting-header-standalone {
  @include settings.settings-item-header-standalone;
}

.setting-label {
  @include settings.settings-label;
}

.setting-description {
  @include settings.settings-item-description;
}

.setting-options {
  @include settings.settings-options;
}

.select-group {
  @include settings.settings-select-group;
}

.overrides-table {
  @include settings.settings-table;
}

.setting-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-color);
}

.multi-sort-editor {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--border-color);
}

.multi-sort-label {
  display: block;
  font-weight: 500;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

// Visible sort fields editor styles
.sort-field-count {
  font-weight: 500;
  color: var(--p-primary-color);
}

.sort-field-order-editor {
  margin-top: 0.75rem;
}

.sort-field-order-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 40px;
  max-height: 320px;
  max-width: 350px;
  overflow-y: auto;
  margin-bottom: 0.75rem;
}

.sort-field-order-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background-color: var(--overlay-background);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  cursor: move;
  transition: background-color 0.15s ease, box-shadow 0.15s ease;

  &:hover {
    background-color: var(--ground-background);
  }
}

.cdk-drag-preview {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.75rem;
  background-color: var(--card-background);
  border: 1px solid var(--primary-color);
  border-radius: 6px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.25);
}

.cdk-drag-placeholder {
  opacity: 0.3;
}

.cdk-drag-animating {
  transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
}

.sort-field-order-list.cdk-drop-list-dragging .sort-field-order-row:not(.cdk-drag-placeholder) {
  transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
}

.sort-field-drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary-color);
  cursor: grab;

  &:active {
    cursor: grabbing;
  }

  i {
    font-size: 0.85rem;
  }
}

.sort-field-rank {
  font-weight: 600;
  color: var(--primary-color);
  min-width: 1.75rem;
}

.sort-field-label {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-color);
}

.remove-sort-field-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background-color: transparent;
  color: var(--p-red-500);
  cursor: pointer;
  transition: background-color 0.15s ease;

  i {
    font-size: 0.85rem;
  }

  &:hover:not(:disabled) {
    background-color: var(--ground-background);
  }

  &:disabled {
    opacity: 0.4;
    cursor: not-allowed;
  }
}

.sort-field-actions-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.reset-sort-fields-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: none;
  border-radius: 4px;
  background-color: transparent;
  color: var(--text-secondary-color);
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;

  i {
    font-size: 0.85rem;
  }

  &:hover {
    background-color: var(--ground-background);
    color: var(--primary-color);
  }
}
