@use '../styles/variables' as *;
@use '../styles/mixins' as *;

.pageContent {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 $spacing-lg $spacing-2xl;

  @include mobile {
    padding-left: $spacing-md;
    padding-right: $spacing-md;
  }
}

.settingsCard {
  padding: 0;
  overflow: visible;
}

.settingsHeader {
  display: flex;
  flex-direction: column;
  gap: $spacing-xs;
  padding: $spacing-md $spacing-lg;
  border-bottom: 1px solid var(--border-color);

  @include mobile {
    padding-left: $spacing-md;
    padding-right: $spacing-md;
  }
}

.settingsHeaderTitle {
  display: inline-flex;
  align-items: center;
  gap: $spacing-xs;
  font-weight: 700;
  color: var(--text-primary);
}

.settingsHeaderHint {
  font-size: 13px;
  color: var(--text-secondary);
}

.settingsSection {
  display: flex;
  flex-direction: column;
  gap: $spacing-sm;
  padding: $spacing-md $spacing-lg $spacing-lg;

  @include mobile {
    padding-left: $spacing-md;
    padding-right: $spacing-md;
  }
}

.settingsRow {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: $spacing-lg;

  @include mobile {
    flex-direction: column;
    align-items: stretch;
    gap: $spacing-sm;
  }
}

.settingsInfo {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.settingsLabel {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.settingsDesc {
  font-size: 13px;
  color: var(--text-secondary);
}

.settingsControl {
  flex: 0 0 auto;
  width: min(360px, 45%);
  min-width: 220px;

  @include mobile {
    width: 100%;
    min-width: 0;
  }
}

.tagList {
  display: flex;
  flex-wrap: wrap;
  gap: $spacing-xs;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: $radius-full;
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all $transition-fast;

  &:hover {
    border-color: var(--primary-color);
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
  }

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

.tagActive {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;

  &:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
  }
}

.mappingsHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: $spacing-md;
  padding: $spacing-md $spacing-lg;
  border-bottom: 1px solid var(--border-color);

  @include mobile {
    padding-left: $spacing-md;
    padding-right: $spacing-md;
  }
}

.mappingsTitle {
  font-weight: 700;
  color: var(--text-primary);
}

.modelsHint {
  display: flex;
  align-items: center;
  gap: $spacing-xs;
  padding: $spacing-sm $spacing-lg;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);

  @include mobile {
    padding-left: $spacing-md;
    padding-right: $spacing-md;
  }
}

.mappingsBody {
  padding: $spacing-sm $spacing-lg $spacing-lg;

  @include mobile {
    padding-left: $spacing-md;
    padding-right: $spacing-md;
  }
}

.mappingRow {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto auto;
  align-items: center;
  gap: $spacing-sm;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);

  &:last-child {
    border-bottom: none;
  }

  @include mobile {
    grid-template-columns: 1fr;
    gap: $spacing-sm;
  }
}

.mappingSeparator {
  color: var(--text-secondary);
  text-align: center;

  @include mobile {
    display: none;
  }
}

.mappingAliasInput {
  width: 100%;
}

.mappingFork {
  display: flex;
  align-items: center;

  @include mobile {
    justify-content: flex-start;
  }
}
