:root {
  --hover-primary: rgb(59, 59, 152);
  --hover-bg: rgb(245, 246, 250);
  --bg-white: #ffffff;
  --bg-dark: rgb(116, 125, 140);
}
.darkmode {
  --hover-primary: rgb(59, 59, 152);
  --hover-bg: rgb(38, 42, 51);
  --bg-white: rgb(53, 59, 72);
  --bg-dark: rgb(47, 54, 64);
}
.darkmode .country-list li {
  color: rgb(220, 221, 225);
}
.darkmode h1 {
  color: rgb(220, 221, 225);
}
body {
  background-color: var(--bg-dark);
  transition: background 0.2s linear;
}
#search:focus {
  box-shadow: 0px 0px 5px var(--hover-primary);
}
.country-list {
  max-height: 300px;
  overflow-y: auto;
}

.country-list li {
  border: none;
  border-left: 3px solid transparent;
  background-color: var(--bg-white);
}
.country-list li:hover {
  border-left-color: var(--hover-primary);
  transition: all 0.2s ease-in;
  background-color: var(--hover-bg);
}
.checkbox {
  opacity: 0;
  position: absolute;
}

.label {
  width: 50px;
  height: 26px;
  background-color: var(--hover-bg);
  display: flex;
  border-radius: 50px;
  align-items: center;
  justify-content: space-between;
  padding: 5px;
  position: relative;
  transform: scale(1.5);
}

.ball {
  width: 20px;
  height: 20px;
  background-color: var(--bg-dark);
  position: absolute;
  top: 2px;
  left: 2px;
  border-radius: 50%;
  transition: transform 0.2s linear;
}

/*  target the elemenent after the label*/
.checkbox:checked + .label .ball {
  transform: translateX(24px);
}

.fa-moon {
  color: rgb(232, 65, 24);
}

.fa-sun {
  color: rgb(225, 177, 44);
}

@media only screen and (max-width: 768px) {
  #search,
  #list {
    width: 90% !important;
  }
}
