:root {
  --primary-nonmetal: rgb(76, 175, 80);
  --primary-noble-gas: rgb(33, 150, 243);
  --primary-alkali-metal: rgb(244, 67, 54);
  --primary-alkaline-earth-metal: rgba(243, 149, 7, 0.826);
  --primary-metalloid: rgb(121, 85, 72);
  --primary-halogen: rgb(176, 169, 35);
  --primary-transition-metal: rgb(191, 79, 87);
  --primary-lanthanide: rgb(204, 61, 194);
  --primary-actinide: rgb(148, 80, 204);
  --primary-post-transition-metal: rgba(40, 148, 139, 0.82);
  --primary-other: rgb(116, 112, 128);
  --primary-text: rgb(255, 255, 250);
}

body {
  background-color: darkblue;
  color: var(--primary-text);
}

nav {
  display: flex;
  flex-direction: row;
  padding: 20px 50px;
  gap: 30px;

  a {
    border: 2px solid var(--primary-text);
    box-shadow: 10px 10px 4px #000;
    padding: 10px;
    color: var(--primary-text);
    text-decoration: none;
  }
}

header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 20px auto;
  max-width: 600px;
  
  h1 {
    max-width: 300px;
    padding: 20px 10px;
    border: 2px solid var(--primary-text);
    box-shadow: 10px 10px 4px #000;
  }
  
  h2 {
    padding-top: 20px;
  }
}

table {
  color: #2797b0
}

/* Element Table Layout */
.table-container,
.table-legend-container {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  font-size: 24px;
  margin: 20px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(18, 60px);
  grid-template-rows: repeat(7, 80px);
  gap: 20px;
}

.element-cell {
  border: 1px solid var(--primary-text);
  padding: 10px;
  text-align: left;
  transition: all 0.4s ease-in-out;
  box-shadow: 10px 10px 4px #000;
  
  &:hover {
    filter: brightness(120%);
    transform: scale(1.2);
    cursor: pointer;
  }

  .atomic-number {
    font-weight: bold;
    padding-bottom: 5px
  }
}

.element-cell-sample {
  border: 1px solid var(--primary-text);
  padding: 10px;
  height: 10px;
  width: 10px;
}

/* Element Modal  */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.hidden {
  display: none;
}

#element-modal-content {
  filter: brightness(120%);
  padding: 50px;
  border-radius: 10px;
  width: 500px;
  max-width: 90%;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  animation: fadeIn 1s ease;

  p {
    padding-top: 10px;

    &:last-of-type {
      padding-bottom: 10px;
    }
  }

  a {
    color: lightblue;
    font-style: italic;
    text-decoration: none;

    &:hover {
      text-decoration: underline;
    }
  }
}

.close-button {
  position: relative;
  top: 0;
  left: 100%;
  font-size: 30px;
  cursor: pointer;
  transition: all 0.4s ease-in-out;
  
  &:hover {
    background: rgba(0, 0, 0, 0.783);
    font-weight: bolder;
    box-shadow: 1px 1px 5px 4px #000;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Element Legend */
.table-legend-container {
  max-width: 65%;
  justify-self: center;
}

#legend {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  padding: 20px;
  margin-top: 20px;
  margin-bottom: 20px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-color {
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1px solid var(--primary-text);
  box-shadow: 5px 5px 4px #000;
}

.legend-label {
  font-size: 16px;
}

/* About Page */
.about-container {
  margin: auto 50px;
  display: flex;
  gap: 50px;
  flex-direction: row;

  .about-column-left,
  .about-column-right {
    width: 50%;
  }
}
