@import url('https://fonts.googleapis.com/css2?family=Fira+Sans:wght@400;700&display=swap');

/* Light and dark mode variables */

:root {
  --font-color: #4a4a48;
  --background-color: #f5f5f5;
  --accent-color: #e96e50;
  --white: #ffffff;
  --lightgrey: #f5f5f5;
  --secondary-background-color: #ffffff;
}

[data-theme='dark'] {
  --font-color: #f5f5f5;
  --background-color: #4a4a48;
  --accent-color: #e96e50;
  --secondary-background-color: #4a4a48;
}

/* global controls */

body {
  background-color: var(--background-color);
  font-family: 'Fira Sans', sans-serif;
  color: var(--font-color);
  box-sizing: border-box;
  font-size: 0.875rem;
}

a, a:visited {
  color: var(--font-color);
  text-decoration: none;
}

a:hover {
  color: var(--accent-color);
}

h1 {
  color: var(--accent-color);
  font-weight: normal;
  font-size: 2.5rem;
  margin: 0 0 0.3125rem 0;
}

p {
 margin: 0 0 0.625rem 0; 
}

button {
  background-color: var(--accent-color);
  height: 2.125rem;
  width: 3.75rem;
  border-radius: 3.875rem;
  color: var(--lightgrey);
  border: 0px solid black;
  cursor: pointer;
  margin-left: 0.375rem;
  outline: none;
  font-size: 0.875rem;
}

input {
  height: 2.125rem;
  padding-left: 0.625rem;
  color: var(--font-color);
  font-family: 'Fira Sans', sans-serif;
  border-radius: 2.125rem;
  border: 0.0625rem solid var(--font-color);
  margin: 0 0 0.625rem 0;
  background-color: var(--secondary-background-color);
  outline: none;
  font-size: 0.875rem;
}

/* wrappers */

.sitewrapper {
  display: flex;
  justify-content: center;
}

.wrapper {
  width: 20rem;
  position: absolute;
  height: 60vh;
  margin: 6.25rem 0 0 0;
}

/* temperature and image */

.temp-and-image {
  display: flex;
  margin: 0 0 0.75rem 0;
}

.image {
  background-color: var(--white);
  width: 6.25rem;
  height: 6.25rem;
  border-radius: 2rem;
}

.temp-display {
  font-size: 6rem;
  height: 6.25rem;
  margin: 0 0 0 1.25rem;
}

/* location and details */

.details {
  font-size: 1.5rem;
}

/* loading image */

.loading {
  display: none;
  background-image: url('https://i.stack.imgur.com/kOnzy.gif');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 6.25rem 6.25rem;
  width: 100%;
  height: 6.25rem;
  margin-top: 1rem;
}

/* search bar and unit toggle */

.footer {
  margin-top: 0.625rem;
  font-size: 0.875rem;
  width: 100%;
  text-align: center;
}

.controls {
  position: absolute;
  bottom: 0px;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
}

.search-bar {
  width: 100%;
  display: flex;
  justify-content: space-around;
}

.error-msg {
  display: none;
  color: var(--accent-color);
  margin: 0 0 0.625rem 0;
  width: 100%;
  text-align: center;
}

.unit-control {
  display: flex;
  justify-content: center;
  width: 100%;
}

.unit-selector {
  font-size: 1rem;
  margin-top: 0.3125rem;
}

.unit-switch {
  margin: 0 0.5rem;
}

.switch {
  position: relative;
  display: inline-block;
  width: 3.75rem;
  height: 2.125rem;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--accent-color);
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 2.125rem;
}

.slider:before {
  position: absolute;
  content: "";
  height: 1.625rem;
  width: 1.625rem;
  left: 0.25rem;
  bottom: 0.25rem;
  background-color: var(--lightgrey);
  -webkit-transition: .4s;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .slider:before {
  -webkit-transform: translateX(1.625rem);
  -ms-transform: translateX(1.625rem);
  transform: translateX(1.625rem);
}