/*
*********************
* Author: Joel Foster
* Created 24/10/2024
*********************
*/

@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');

:root {
  --primary: #3d5a80;
}

html {
  scroll-padding-top: 7em;
}

body {
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
}

body,
input {
  font-family: "Montserrat", sans-serif;
  font-optical-sizing: auto;
  font-style: normal;
}

header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  color: white;
  background-color: var(--primary);
  position: sticky;
  top: 0;
  width: 100%;
}

.title {
  grid-column: 1 / span 1;
  text-align: left;
  padding-left: 1.5em;
  font-size: small;
}

.title a:link, .title a:visited {
  color: white;
  text-decoration: none;
}

.title a:hover {
  color: rgb(201, 201, 201);
}

.nav-bar {
  grid-column: 2 / span 1;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-right: 3em;
  gap: 0.5em;
}

.nav-bar a {
  padding: 0.4em;
  font-size: large;
  border-radius: 5px;
  transition: background-color .1s;
}

.nav-bar a:link, .nav-bar a:visited {
  color: white;
  text-decoration: none;
}

.nav-bar a:hover {
  background-color: rgba(0, 0, 0, 0.2);
}

main {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.learn {
  display: grid;
  grid-template-columns: 1fr 3fr;
  align-items: start;
  gap: 1em;
}

.table-of-contents {
  grid-column: 1;
  border: solid black 1px;
  border-radius: 5px;
  margin: 1em;
  padding: 1em;
  position: sticky;
  top: 7em;
}

.table-of-contents ul {
  margin: 0;
}

.content {
  grid-column: 2 / span 3;
  margin-right: 2em;
}

.intro {
  text-align: center;
  margin-left: 1em;
  margin-right: 1em;
  width: 75%;
}

.card-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 2em;
  justify-content: center;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 0.75em;
  border-radius: 5px;
  box-shadow: 0px 0px 2px;
  max-width: 250px;
  transition: box-shadow .2s, scale .2s;
}

.card a {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  border-radius: 5px;
  text-decoration: none;
  color: transparent;
}

.card:hover {
  box-shadow: 0px 0px 10px;
  scale: 1.05;
  cursor: pointer;
}

.card-title {
  margin: 0;
  padding: 0;
  font-size: large;
  margin-bottom: 0.2em;
}

.card-desc {
  margin: 0;
  padding: 0;
}

.card-link-icon {
  margin-top: 1em;
  margin-left: 0.5em;
  margin-bottom: 0.5em;
}

#k-selector {
  width: 4em;
}

.trace-input-explanation {
  width: 60%;
}

#trace-insert {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  gap: 1.5em;
  justify-self: center;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin-bottom: 1em;
}

#trace-text-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5em;
}

#submit-txt-btn {
  width: 10em;
  margin-bottom: 1em;
}

#trace-text-input {
  resize: none;
}

.upload-file {
  justify-items: center;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
}

.upload-file * {
  margin: 0;
}

.svg-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  padding-top: 1em;
  padding-bottom: 1em;
}

#d3-container {
  width: 75%;
  outline-style: solid;
  outline-width: 2px;
  border-radius: 5px;
  box-shadow: 0px 0px 10px;
}

#tooltip {
  position: absolute;
  padding: 1em;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 0.85em;
}

#merge-info {
  font-size: larger;
  margin-bottom: 0.5em;
  background-color: rgb(18, 190, 18);
  color: white;
  padding: 0.5em;
  border-radius: 5px;
}

.graph-navigation {
  display: block;
  justify-content: center;
  text-align: center;
}

#graph-hint {
  margin-bottom: 0.3em;
  font-size: small;
}

.graph-navigation input {
  margin-left: 0.25em;
  margin-right: 0.25em;
}

.nav-button-wrapper {
  display: flex;
  justify-content: center;
}

.node rect,
.node circle,
.node ellipse,
.node polygon {
  stroke: #333;
  fill: #fff;
  stroke-width: 1.5px;
}

.edgePath path {
  stroke: #333;
  fill: #333;
  stroke-width: 1.5px;
}

g.red-state > circle {
  fill: rgb(228, 40, 40);
}

g.red-state text {
  fill: #fff;
}

g.blue-state > circle {
  fill: rgb(80, 145, 243)
}

footer {
  width: 100%;
  text-align: center;
  padding: 1.5em 0;
  margin-top: 2em;
  background-color: var(--primary);
  color: white;
}

@media (max-width: 1100px) {
  .learn {
    grid-template-columns: 1fr 2fr;
  }
}

@media (max-width: 900px) {
  .trace-input-explanation {
    width: 80%;
  }

  #trace-insert {
    flex-direction: column;
    gap: 0.5em;
  }

  .table-of-contents {
    top: 7em;
  }
}

@media (max-width: 600px) {
  html {
    scroll-padding-top: 9em;
  }

  .learn {
    display: flex;
    flex-direction: column;
    padding-left: 1.5em;
    padding-right: 1.5em;
  }

  .table-of-contents {
    position: static;
  }
}

@media (max-width: 450px) {
  html {
    scroll-padding-top: 11em;
  }

  .learn {
    display: flex;
    flex-direction: column;
    padding-left: 1.5em;
    padding-right: 1.5em;
  }

  .table-of-contents {
    position: static;
  }
}
