* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  overflow-x: hidden;
}

body {
  font-family: "Montserrat", sans-serif;
  position: relative;
  background: #f4f4f4;
}

/* utility classes */
:root {
  --text-color: #565656;
  --primary-color: #008ad8;
}

.font-rale {
  font-family: "Raleway", sans-serif;
}

/* navbar */
#navbar {
  background-color: white;
  color: black;
  overflow: auto;
  border-bottom: 1px solid #111;
}

.nav-container {
  margin: auto;
  max-width: 1200px;
  overflow: auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  height: 8vh;
  align-items: center;
  background: white;
}

.logo {
  text-decoration: none;
  color: black;
}

.nav-ul {
  display: flex;
  justify-content: space-around;
  width: 40%;
}

.nav-ul li {
  list-style-type: none;
}

.nav-ul li a {
  text-decoration: none;
  color: black;
}
/* hamburger menu */
.burger div {
  width: 23px;
  height: 2px;
  background-color: black;
  margin: 5px;
  transition: all 0.3s ease;
}

.burger {
  display: none;
}

/* header and search button */
#data-header {
  padding: 2rem 4rem;
  display: flex;
  justify-content: space-between;
}

#data-header h1 {
  font-size: calc(1rem + 1vw);
  padding-bottom: 1rem;
}

.search-button {
  position: relative;
}

#search {
  padding: 1rem 2rem;
  margin-top: 0.5rem;
  padding-left: 3rem;
  border: 1px solid #111;
  border-radius: 2rem;
  outline: none;
  font-size: 1.2rem;
}

/* main table */
main {
  margin: 2.8rem;
}

.labels {
  display: block;
  background-color: var(--primary-color);
  color: white;
  text-transform: uppercase;
  font-size: 0.875rem;
  display: grid;
  grid-template-columns: 30% 25% 25% auto;
  border-radius: 0.5rem;
  padding: 0.2em 1em;
}

.company {
  display: grid;
  grid-template-columns: 30% 25% 25% auto;
}

.hide {
  display: none;
}

.company:hover {
  background-color: white;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead > tr {
  background-color: var(--primary-color);
}

tbody > tr:hover {
  background-color: white;
}

td,
th {
  padding: 1rem 0;
}

th {
  color: white;
  text-transform: uppercase;
  font-size: 0.875rem;
  text-align: left;
}

td:first-child,
th:first-child {
  padding-left: 1rem;
}

td:last-child,
th:last-child {
  padding-right: 1rem;
}

@media screen and (max-width: 1024px) {
  .nav-ul {
    width: 50%;
  }
}

@media screen and (max-width: 768px) {
  .nav-ul {
    position: absolute;
    right: 0;
    top: 8vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 30vh;
    background: #111;
    /* change transform to generate diff animation */
    transform: translateY(-150%);
  }

  .nav-ul li {
    opacity: 0;
  }

  .nav-ul li a {
    color: white;
  }

  .burger {
    display: block;
    cursor: pointer;
  }

  /* data header */

  #data-header {
    flex-direction: column;
    padding: 3rem 0.5rem;
  }
  #search {
    margin-top: 2rem;
  }

  /* main style */
  .labels {
    display: none;
  }

  thead {
    display: none;
  }

  tbody tr {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 3rem 0;
    border-bottom: 1px solid #111;
  }
  .company,
  .person,
  .contact,
  .city {
    padding: 0;
    margin: 0.5rem 0;
  }

  .company {
    display: block;
    padding: 0;
    padding-left: 0;
    font-weight: 700;
  }

  .contact {
    font-weight: 800;
  }

  td:first-child,
  th:first-child {
    padding-left: 0rem;
  }

  td:last-child,
  th:last-child {
    padding-right: 0rem;
  }
}

.nav-active {
  transform: translateY(0%);
  opacity: 1;
}

/* Hamburger animation */
.toggle .line1 {
  transform: rotate(-45deg) translate(-4px, 6px);
}
.toggle .line2 {
  opacity: 0;
}
.toggle .line3 {
  transform: rotate(45deg) translate(-4px, -6px);
}

/* link animation */
@keyframes navLinkFade {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0px);
  }
}
