@import '../../constants/theme.scss';
@import '../../utils/mixins.scss';

.questionDetails {
  & li {
    @include theme(color, contrast1Opacity90);
  }
}

.questionDescription {
  @include spacing(0 0.25rem);
  word-break: break-word;
  white-space: break-spaces;

  a {
    @include theme(color, ePrimaryDeep);

    &:hover {
      filter: brightness(125%);
    }
  }
}

.questionTitle {
  @include theme(color, ePrimary);
}

.questionDescriptionHighlight {
  @include spacing(0 0.25rem);
  @include theme(color, contrast1Opacity90);
  @include theme(background-color, eSecondaryDeep);
  border-radius: 0.25rem;
}

.solutionContainer {
  @include spacing($margin: 2rem 1rem);
  max-width: 50rem;
}

.sudokuContainer {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: center;

  @media screen and (min-width: 1200px) {
    flex-direction: row;
    align-items: flex-start;
  }
}

.board {
  border-collapse: collapse;
}

.boardColumnGroup {
  border: 2px solid $dark;
}

.boardRow {
  &:nth-of-type(3n) {
    border-bottom: 2px solid $dark;
  }
}

.cell {
  @include square(2.5rem, $light);
  position: relative;
  border: 1px solid $dark;
  padding: 0;
  text-align: center;
  font-size: 0.9rem;
  color: $dark;
  cursor: pointer;
  background-clip: padding-box;
  overflow: hidden;

  @media screen and (min-width: 1200px) {
    @include square(2.75rem, $light);
    font-size: 1.25rem;
  }
}

.givenNumber {
  cursor: default;
  background-color: $grey-5;
}

.candidates {
  position: absolute;
  top: 1px;
  right: 1px;
  font-size: 0.5rem;
  color: $eCandidates;

  @media screen and (min-width: 1200px) {
    font-size: 0.6rem;
  }
}

.controls {
  @include spacing(0.75rem);
  margin-left: 0.25rem;
  height: fit-content;
  border: 2px solid $dark;
  background-color: $light;

  @media screen and (min-width: 1200px) {
    align-self: flex-start !important;
  }
}

.numberControls {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-content: center;
  align-items: center;
  gap: 0.75rem;
}

.numberControl {
  @include square(3rem, $grey-5);
  font-size: 1.5rem;
  border: 1px solid $dark;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;

  &:focus,
  &:active {
    filter: brightness(0.9);
  }
}

.candidateSwitch {
  appearance: none;
  width: 100%;
  height: 2.5rem;
  position: relative;
  border-radius: 1.5rem !important;
  margin-top: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  background-color: $blue-2 !important;

  &::before {
    @include square(1.8rem, $white, 50%);
    content: 'Candidate Move              Normal Move';
    display: flex;
    align-items: center;
    position: absolute;
    top: calc(50% - 0.9rem);
    left: 0.25rem;
    font-weight: bold;
    white-space: pre;
    font-size: 0.85rem;
    text-indent: -115px;
    color: $white;
  }

  &:checked {
    background-color: $green-3 !important;

    &::before {
      left: calc(100% - 1.8rem - 0.25rem);
    }
  }
}
