@use "../../../../styles/int.scss";

.state {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: none;
  border-bottom: 1px solid int.$warmgray-10;
  padding: int.$spacing-2 0 int.$spacing-2 0;

  @include int.container-at-least("sm") {
    padding: int.$spacing-2 int.$spacing-3 int.$spacing-2 int.$spacing-5;
  }

  @include int.container-at-least("lg") {
    height: 49px;
    padding: 0 int.$spacing-3 0 int.$spacing-5;
  }

  &.calledDem {
    background: int.$dem-10;
    border-color: int.$dem-20;
    padding: int.$spacing-2 int.$spacing-5;
  }

  &.calledGop {
    background: int.$gop-10;
    border-color: int.$gop-20;
    padding: int.$spacing-2 int.$spacing-5;
  }
}

.stateName {
  @include int.sans($size: "200", $weight: "bold", $role: "label");

  @include int.container-at-least("md") {
    @include int.sans($size: "300", $weight: "bold", $role: "label");
  }
}

.evs {
  color: int.$warmgray-60;

  @include int.overline() {
    font-weight: 400;
    text-transform: none;
  }
}

.call {
  display: flex;
  flex-flow: row;
  align-items: center;
  gap: int.$spacing-1;

  @include int.sans($size: "200", $role: "label", $weight: "bold");

  .calledDem & {
    color: int.$dem-80;
  }

  .calledGop & {
    color: int.$gop-80;
  }
}

.options {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.unsetButton {
  cursor: pointer;
  margin-right: int.$spacing-2;
  opacity: 0;
  transition: opacity .2s ease-in-out;

  &:has(input[type="radio"]:focus-visible) {
    opacity: 1;

    @include int.universal-focus;
  }

  &.visible {
    opacity: 1;
  }

  label {
    display: block;
    cursor: inherit;
  }

  input[type="radio"] {
    position: absolute;
    top: 0;
    left: 0;
    cursor: inherit;

    @include int.sr-only-styles;
  }
}

.option {
  position: relative;
  cursor: pointer;
  border: 1px solid int.$warmgray-20;

  &:hover {
    background-color: int.$warmgray-10;
  }

  &:has(input[type="radio"]:focus-visible) {
    @include int.universal-focus;
  }

  &.selectedDem {
    border-radius: 4px 0 0 4px;
    border-right: none;
  }

  &.selectedGop {
    border-radius: 0 4px 4px 0;
  }

  &.selectedDem:has(input[type="radio"][value="selectedDem"]:checked) {
    background: int.$dem-70;
    border-color: int.$dem-70;
    color: white;
  }

  &.selectedGop:has(input[type="radio"][value="selectedGop"]:checked) {
    background: int.$gop-70;
    border-color: int.$gop-70;
    color: white;
  }

  label {
    display: block;
    cursor: inherit;
    padding: int.$spacing-2;

    @include int.sans($size: "200", $role: "label");
  }

  input[type="radio"] {
    position: absolute;
    top: 0;
    left: 0;
    cursor: inherit;

    @include int.sr-only-styles;
  }
}
