@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@200;300;400&display=swap");

:root {
  --background-color: #1b1b1b;
  --primary-color: #0e0e0e;
  --divider-color: #2a2a2a;
  --off-white: #bdbdbd;
  --links-color: #3496ff;
  --date-color: #ffa33b;
  --not-dangerous: #6fff87;
  --dangerous: #fb5252;
  --disclaimer-bg: #8eddff;
  --error: #fb5252;
}

body {
  background-color: var(--background-color);
  color: white;
  font-family: "Poppins", sans-serif;
  margin: 0;
  padding: 0;
  display: flex; 
  flex-direction: column;
  height: 100vh;
}

h1,
h2,
h3,
p,
ul,
li {
  margin: 0;
  padding: 0;
}

h1 {
  text-align: center;
}

ul,
li {
  list-style: none;
}

button {
  padding: 0;
  margin: 0;
  border: none;
}
button:hover {
  cursor: pointer;
}

a {
  text-decoration: none;
  color: white;
}

/*  */

#header-link {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  font-size: 2rem;
  letter-spacing: 1px;
}
#header-img {
  width: 3rem;
  animation: shake 0.3s infinite;
}
@keyframes shake {
  0% {transform: translateX(0);}
  25% {transform: translateX(0.8px);}
  25% {transform: translateY(0.8px);}
  50% {transform: translateX(-0.8px);}
  75% {transform: translateX(0.8px);}
  100% {transform: translateX(0);}
}

#divider {
  width: 99%;
  padding: 1px;
  background-color: var(--divider-color);
  margin: -5px auto 8px auto;
}

#about {
  text-align: justify;
  padding: 0 1.5rem 0.5rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 300;
  word-spacing: 1px;
  line-height: 28px;
  width: 1000px;
  margin: 0 auto;
}
#about-img {
  width: 1.8rem;
  margin: 0 -5px -8px -5px;
}
#about-img:hover {
  cursor: pointer;
  animation: rotate 2s infinite;
}
.date {
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--date-color);
  word-spacing: -2px;
}
.about-links {
  font-weight: 500;
  color: var(--links-color);
}
#about-divider-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  opacity: 0.8;
  margin-top: 0.3rem;
}
.asterik {
  width: 1rem;
}
.about-divider {
  width: 20%;
  padding: 0.8px;
  background-color: var(--divider-color);
}

/*  */

#loading-img {
  position: relative;
  width: 300px;
  border: none;
  margin: -35px 0 0 0;
  z-index: -1;
}
#loading-message {
  text-align: center;
  margin: 3rem 0 0 0;
  font-size: 1.3rem;
  font-weight: 200;
}
.blink {
  opacity: 0.78;
}

/*  */

#error-message {
  font-size: 1.3rem;
  font-weight: 200;
  text-align: center;
  margin: 2rem 0 0.4rem 0;
  color: var(--error);
}
#error-image {
  width: 250px;
  border: none;
  border-radius: 0.5rem;
  opacity: 0.9;
}
#dog-image {
  width: 280px;
  border: none;
  border-radius: 0.5rem;
  opacity: 0.9;
}
/*  */
#orbit-data-error-message {
  font-weight: 200;
  text-align: center;
  font-size: 1.8rem;
  padding: 5rem 0 0 0;
  line-height: 2rem;
  text-shadow: 0 0 1vw #e2e2e2;
}

/*  */

#asteroids {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#asteroids-heading {
  text-align: center;
  font-size: 1.15rem;
  font-weight: 200;
  margin: 0 0 0.8rem 0;
}
.dangerous-count {
  color: var(--dangerous);
}
.container {
  margin: 0 0 2rem 0;
}
.asteroid-container {
  background-color: var(--primary-color);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  justify-items: stretch;
  width: 900px;
  border-radius: 5px;
  padding: 1.3rem 0 1.3rem 5rem;
  letter-spacing: 0.4px;
}
.grid-col-span-3 {
  grid-column: span 3;
}

span {
  font-size: 1.2rem;
  font-weight: bold;
}

.asteroid-size-comparison, .asteroid-speed-comparison {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  font-weight: 300;
}
.comparison-image {
  width: 110px;
}

.asteroid-details {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-weight: 200;
}
.asteroid-name {
  font-size: 2.5rem;
  font-weight: bold;
  line-height: 3rem;
}

.toggle-orbit-div {
  display: flex;
  gap: 0.5rem;
  height: 3rem;
}
.toggle-orbit-btn {
  width: 2.5rem;
  border-radius: 0.2rem;
  background: url("./assets/images/asteroid-button.png") no-repeat center;
  background-size: contain;
  margin: 0 0 0.2rem 0;
}
.rotate {
  animation: rotate 2s infinite;
}
.open-space {
  animation: rotate 2s infinite;
  opacity: 0.5;
}
@keyframes rotate {
  100% {transform: rotate(360deg);}
}
.dangerous, .not-dangerous {
  font-weight: 400;
  border: none;
  border-radius: 0.2rem;
  padding: 0.15rem 0.4rem;
  height: 1.5rem;
  margin: 0.5rem 0 0 0;
}
.dangerous {
  background-color: var(--dangerous);
  color: white;
}
.not-dangerous {
  background-color: var(--not-dangerous);
  color: black;
}

.orbit-container {
  width: 980px;
  height: 450px;
  background-color: var(--primary-color);
}
.orbit-container > canvas {
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
  margin: -2px 0 0 0;
}
.hide {
  display: none;
}

.space-options {
  position: relative;
}
.options-toggle {
  position: absolute;
  left: 5px;
  top: 0;
  opacity: 0.5;
}
.options {
  position: absolute;
  display: none;
  gap: 0.5rem;
  right: 5px;
  top: 3px;
}
.options > button {
  border: none;
  border-radius: 2px;
  opacity: 0.6;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
}
.options > button:hover {
  opacity: 0.7;
}
.set-date-btn {
  position: absolute;
  right: 5px;
  top: 32px;
  border-radius: 2px;
  opacity: 0.6;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  display: none;
}
.set-date-btn:hover {
  opacity: 0.7;
}
.disclaimer-msg {
  position: absolute;
  bottom: -447px;
  left: 1px;
  background-color: var(--disclaimer-bg);
  color: black;
  font-size: 0.9rem;
  font-weight: 400;
  opacity: 0.5;
  padding: 0 0.3rem;
  border-top-right-radius: 0.5rem;
}
.fullscreen-btn {
  position: absolute;
  right: -2px;
  bottom: -450px;
  background: url("./assets/images/fullscreen-icon.png") no-repeat center;
  background-size: contain;
  padding: 0.6rem;
  margin: 0.3rem;
  opacity: 0.45;
}

/*  */

footer {
  background-color: var(--primary-color);
  color: var(--off-white);
  text-align: center;
  margin-top: auto;
  padding: 0.5rem 0 0.2rem 0;
}
#powered-by {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}
#powered-by > p {
  margin: 0 0 0.6rem 0;
}
#logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin: 0 0 0.2rem 0;
}
.logo {
  width: 2.5rem;
  opacity: 0.6;
}
.logo:hover {
  opacity: 0.9;
}
.netlify-logo {
  width: 2rem;
}
.nasa-logo {
  width: 2.5rem;
}
.github-logo {
  width: 1.9rem;
}
.flaticon-logo {
  width: 2.3rem;
}
#hits-count-img {
  margin: 0 0 0.2rem 0;
}

/*  */

@media (max-width:1065px) {
  #about {
    width: 800px;
  }
}

@media (max-width: 1050px) {
  .asteroid-container {
    width: 800px;
    letter-spacing: 0.1px;
    padding: 1rem 0 1.5rem 5rem;
  }
  .orbit-container {
    width: 880px;
  }
  .asteroid-name {
    font-size: 2.2rem;
    margin: 0.5rem 0 -0.1rem 0;
  }
  .asteroid-size-comparison,
  .asteroid-speed-comparison {
    padding-top: 0.5rem;
  }
  .comparison-image {
    width: 110px;
  }
}

@media (max-width: 950px) {
  .asteroid-container {
    width: 700px;
    padding: 1rem 0 1.5rem 4rem;
  }
  .orbit-container {
    width: 764px;
  }
  .asteroid-size-comparison, .asteroid-speed-comparison {
    padding-top: 1.5rem;
  }
  .comparison-image {
    width: 100px;
  }
  .asteroid-name {
    font-size: 2rem;
  }
  .dangerous, .not-dangerous {
    font-size: 0.9rem;
    font-weight: 400;
    padding: 0 0.4rem -1rem 0.4rem;
  }
}

@media (max-width:865px) {
  #about {
    width: 700px;
  }
}

@media (max-width: 800px) {
  .asteroid-container {
    width: 600px;
    padding: 1rem 0 1.5rem 4rem;
    grid-template-columns: 240px 170px 170px;
  }
  .orbit-container {
    width: 664.5px;
  }
  .asteroid-size-comparison, .asteroid-speed-comparison {
    text-align: center;
  }
}

@media (max-width:765px) {
  #about {
    width: 600px;
    font-size: 1rem;
    line-height: normal;
    word-spacing: normal;
  }
  .date {
    font-size: 1rem;
  }
  #about-img {
    width: 1.5rem;
    margin: 0 -3px -7px -3px;
  }
}

@media (max-width: 700px) {
  #header-link {
    font-size: 1.8rem;
    letter-spacing: 0;
    margin: 0.5rem 0;
  }
  .asteroid-container {
    width: 550px;
    padding: 1.3rem 1rem 1.5rem 2rem;
    grid-template-columns: 240px 170px 170px;
    align-items: flex-end;
  }
  .orbit-container {
    width: 598px;
  }
  .asteroid-name {
    font-size: 1.6rem;
    margin: 0 0 -0.5rem 0;
  }
  .asteroid-size-comparison,
  .asteroid-speed-comparison {
    padding-top: 0;
    margin: 0 0 0.5rem 0;
  }
  .comparison-image {
    width: 90px;
  }
}

@media (max-width:665px) {
  #about {
    width: auto;
  }
}

@media (max-width: 642px) {
  .asteroid-container {
    width: 450px;
    grid-template-columns: repeat(2, 1fr);
    justify-items: center;
    gap: 1.3rem;
    padding: 1.8rem;
  }
  .orbit-container {
    width: 508px;
    height: 400px;
  }
  .options-toggle {
    font-size: 0.9rem;
  }
  .disclaimer-msg {
    bottom: -397px;
  }
  .fullscreen-btn {
    bottom: -400px;
  }
  .asteroid-details {
    grid-column: span 2;
    align-items: center;
    letter-spacing: 0.5px;
  }
  .asteroid-name {
    font-size: 3.2rem;
    margin: 0 0 0.2rem 0;
  }
  .comparison-image {
    width: 100px;
  }
  .asteroid-size-comparison {
    margin: 0;
    justify-self: end;
    width: 105px;
  }
  .asteroid-speed-comparison {
    margin: 0;
    justify-self: start;
    width: 100px;
  }
}

@media (max-width:550px) {
  .asteroid-container {
    width: 350px;
  }
  .orbit-container {
    width: 408px;
  }
}

@media (max-width:480px) {
  #header-link {
    gap: 0.5rem;
    font-size: 1.5rem;
    letter-spacing: 0;
  }
  #header-img {
    width: 2.5rem;
  }
  #asteroids-heading > .count, .dangerous-count {
    font-size: 1rem;
  }
  .asteroid-container {
    padding: 0.8rem 0;
    gap: 0.5rem;
  }
  .orbit-container {
    width: 350px;
  }
  .asteroid-name {
    font-size: 2rem;
    margin: 0 0 -0.3rem 0;
  }
  .asteroid-size-comparison, .asteroid-speed-comparison {
    width: 100px;
  }
  .asteroid-size-comparison > p, .asteroid-speed-comparison > p {
    font-size: 0.9rem;
  }
  span {
    font-size: 0.9rem;
  }
  .comparison-image {
    width: 80px;
  }
  .netlify-logo {
    width: 2rem;
  }
  .nasa-logo {
    width: 2.1rem;
  }
  .flaticon-logo {
    width: 2rem;
  }
  .github-logo {
    width: 1.8rem;
  }
}

@media (max-width:400px) {
  #header-link {
    font-size: 1.3rem;
  }
  .asteroid-container {
    width: 350px;
  }
  .comparison-image {
    width: 60px;
  }
  .orbit-container {
    height: 280px;
  }
  .options, .options-toggle, .set-date-btn {
    display: none;
  }
  .disclaimer-msg {
    bottom: -277px;
  }
  .fullscreen-btn {
    bottom: -280px;
  }
}

@media (max-width:370px) {
  .asteroid-container {
    width: 300px;
  }
  .orbit-container {
    width: 300px;
  }
}

@media (max-width:340px) {
  #header-img {
    display: none;
  }
}