/* --- BASE FUNCTIONS --- */

@font-face {
    font-family: "quicksand";
    src: url(./assets/Quicksand-Regular.ttf);
}

:root {
    --bg-dark: #161414;
    --primary-white: #f5f5f5;
    --secondary-black: #232020;
    --link-blue: #7272E5;
    font-family: "quicksand";
}

*,*:before, *:after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@keyframes fadein {
  from { opacity: 0; }
  to   { opacity: 1; }
}

body {
    color: var(--primary-white);
    background-color: var(--bg-dark);
    box-sizing: border-box;
    padding: 1rem 0rem;
    animation: fadein 1s;
}

header {
  padding-top: 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

a {
  color: inherit;
  text-decoration: inherit; 
}

main {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center all items e.g. link boxes*/
  }

#background {  
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  opacity: 0.4;
}

/* --- TITLE, TIME, SEARCH --- */

#searchbar {
  padding-top: 1rem;
  background-color: transparent;
  border: none;
  border-bottom: 0.2rem solid var(--primary-white);
  outline: none;
  color: var(--primary-white);
  font-family: 'quicksand';
  width: 30%;
  font-size: 16px;
  opacity: 0.6;
}

input::placeholder {
  color: var(--primary-white);
  opacity: 0.75;
}

#currentTime {
  font-size: 7rem;
  font-weight: 600;
  text-shadow: 0.5rem 0.5rem var(--secondary-black);
}

/* Additional class for AM/PM separate styling */
#currentTime12 {
  font-size: 4rem;
  font-weight: 400;
  text-shadow: 0.5rem 0.5rem var(--secondary-black);
}

#currentDate {
  font-size: 2rem;
}

#currentWeather {
  font-size: 1.25rem;
}

#searchform {
  display: flex;
  justify-content: center;
  align-items: center;
}

#searchbar {
  padding-top: 1rem;
  background-color: transparent;
  border: none;
  border-bottom: 0.2rem solid var(--primary-white);
  outline: none;
  color: var(--primary-white);
  font-family: 'quicksand';
  width: 30%;
  font-size: 16px;
}

/* --- CARDS --- */

.card {
    background-color: var(--secondary-black);
    border-radius: 12px;
    /*border: 2px solid rgba(255,255,255, .5);*/
    box-shadow: 0px 4px 5px #171D20;
    display: flex;
    justify-content:  center;
    align-items: center;
    margin: 1rem;
    padding: 1rem 4rem; 
    position: relative;
    font-weight: 400;
    min-width: 218px;
    max-height: 122px;
    width: 218px;
    height: 122px;
}

.card:hover,
.card:focus {
  opacity: 0.95;
  transform: scale(1.1);
  transition: 0.2s;
}

.card:not(:hover, :focus) {
  transition: 0.2s;
}

.card__icon {
    transform: translate(0%, -5%);
    border-radius: 25%;
    border: 2px;
    padding: 0rem;
    place-items: center;
    display: grid;
    max-width: 160px;
    max-height: 80px;
    height: auto;
    width: auto;
}

.card__name {
    color: var(--primary-white);
    font-weight: 60%;
    transform: translate(-50%, -10%);
    position: absolute;
    bottom: 0;
    left: 50%;
    transition: 0.1s;
    white-space: nowrap;
}

hr.divider {
  border-top: 0.5rem solid #bbb;
  border-radius: 1rem;
  margin: 1rem;
}

/* --- PHONE OPTIMIZATION --- */

@media only screen and (min-width: 2000px) {
  .card {
    padding: 2rem 6rem;
    min-width: 300px;
    max-height: 170px;
    width: 300px;
    height: 170px;
  }

  main {
    margin-top: 2rem;
  }

  header {
    padding-top: 2rem;
  }

  .card__icon {
    max-width: 100px;
    max-height: 100px;
  }
}