/* Overall CSS */

html,
body {
  height: 100%;
  width: 100%;
  font-family: "Inter", sans-serif;
  font-weight: 400;
  background-color: #262626;
  color: white;
  text-align: center;
  line-height: 1.4;
}

* {
  box-sizing: border-box;
}

.about-button {
  color: white;
  text-align: right;
  margin-right: 20px;
  font-size: 16px;
  top: 15px;
  right: 15px;
  z-index: 1100;
  position: absolute;
}

#about-box {
  /* border: 1px solid rgb(255, 255, 255); */
  padding: 15px;
  padding-top: 30px;
  font-size: 17px;
  margin: auto;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  max-width: 800px;
  width: 90%;
}

.paragraph {
  text-align: left;
  padding: 10px;
  margin-left: auto;
  margin-right: auto;
  font-size: 17px;
  position: relative;
  box-sizing: border-box;
  width: 90%;
  max-width: 800px;
}

#standfirst {
  text-align: center;
}
.chart-title {
  text-align: center;
  font-weight: 600;
  margin: auto;
  max-width: 800px;
  padding: 1px;
  padding-top: 3px;
  font-size: 20px;
  color: white;
  box-sizing: border-box;
}

.box-out {
  border: 1px solid black;
  text-align: left;
  width: 90%;
  max-width: 800px;
  padding: 10px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 30px;
  margin-top: 30px;
  font-size: 17px;
  overflow: hidden;
  position: relative;
  background-color: rgb(255, 255, 255);
  color: black;
  display: flex;
  flex: 1;
  align-items: center;
  gap: 20px;
  box-sizing: border-box;
}

/* Stockpiles CSS */
#linechart1,
#linechart2 {
  color: black;
}

/* Japan CSS */

svg#chart-survivor {
  /* border: 1px solid #ccc; */
  background-color: white;
  color: black;
  max-width: 800px;
  width: 90%;
}

.tooltip {
  font-family: Helvetica, sans-serif;
  position: absolute;
  background-color: rgba(40, 40, 40, 0.95);
  color: white;
  padding: 10px 12px;
  font-size: 13px;
  pointer-events: none;
  border: 1px solid #555;
  max-width: 200px;
  text-align: left;
}

.japan .h3 {
  font-family: Helvetica, sans-serif;
  font-size: 30px;
}

.hiroshima_container img {
  max-width: 100%;
}

/* Ukraine CSS */

.map-container {
  position: relative;
  width: 90%;
  max-width: 800px;
  height: auto;
  overflow: hidden;
  background-color: #ffffff;
  margin: 0 auto;
  padding: 20px 0;
  box-sizing: border-box;
}

.map-container .ukraine-outline {
  fill: #c7c7c7;
  stroke: #000000;
  stroke-width: 0.5px;
}

.map-container .facility-point {
  cursor: pointer;
  transition: opacity 0.2s;
}

.map-container .facility-point:hover {
  opacity: 1;
}

#map-container .legend {
  position: absolute;
  bottom: 20px;
  left: 20px;
  /* Moved from 0px to 20px */
  padding: 15px;
  background-color: rgba(255, 255, 255, 0.9);
  /* Added background */
  border: 1px solid #eee;
  /* Added subtle border */
}

#map-container .legend h3 {
  font-family: Helvetica, sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: rgb(0, 0, 0);
  margin-top: 0;
  /* Removes extra space at top */
}

#map-container .legend-item {
  font-family: Helvetica, sans-serif;
  font-size: 12px;
  display: flex;
  align-items: center;
  margin-bottom: 5px;
  color: rgb(0, 0, 0);
}

#map-container .legend-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-right: 8px;
  border: 0.5px solid #555;
}

#map-container .tooltip {
  font-family: Helvetica, sans-serif;
  position: absolute;
  background-color: rgba(40, 40, 40, 0.95);
  color: white;
  padding: 2px 12px;
  font-size: 13px;
  pointer-events: none;
  z-index: 100;
  border: 1px solid #555;
  max-width: 200px;
}

#map-container .tooltip p:first-child {
  font-weight: bold;
  margin-bottom: 3px;
}

.map-container .facility-point:hover {
  opacity: 1;
}

.source {
  text-align: left;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  max-width: 800px;
  width: 90%;
  font-size: small;
}

/* Banner CSS */

#header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: 1000;
  color: #f2f2f2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  pointer-events: none;
}

.headline h1 {
  font-size: 55px;
  margin-bottom: 1rem;
}

.headline p {
  font-size: 29px;
  margin: 0.5rem 0;
}
.h1 {
  color: white;
}

/* reference code for fixed dots on map: https://codepen.io/koyali/pen/opExEm */

.map img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  top: 0;
  left: 0;
}

.dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  z-index: 10;
  position: absolute;
  top: 0;
  left: 0;
}

/* China */
.dot-1 {
  top: 48%;
  left: 78%;
  border: #ffd700 0.05px solid;
  animation: china_dot 5s infinite;
}
@keyframes china_dot {
  0% {
    background-color: #ffd700;
  }
  50% {
    background-color: #000000;
  }
  100% {
    background-color: #ffd700;
  }
}
/* US */
.dot-2 {
  top: 45%;
  left: 20%;
  border: #ff3030 0.05px solid;
  animation: us_dot 5s infinite;
}
@keyframes us_dot {
  0% {
    background-color: #ff3030;
  }
  50% {
    background-color: #000000;
  }
  100% {
    background-color: #ff3030;
  }
}
/* UK */
.dot-3 {
  top: 35%;
  left: 49%;
  border: #00ced1 0.05px solid;
  animation: uk_dot 5s infinite;
}
@keyframes uk_dot {
  0% {
    background-color: #00ced1;
  }
  50% {
    background-color: #000000;
  }
  100% {
    background-color: #00ced1;
  }
}
/* Russia */
.dot-4 {
  top: 25%;
  left: 75%;
  border: #007fff 0.05px solid;
  animation: ru_dot 5s infinite;
}
@keyframes ru_dot {
  0% {
    background-color: #007fff;
  }
  50% {
    background-color: #000000;
  }
  100% {
    background-color: #007fff;
  }
}
/* India */
.dot-5 {
  top: 55%;
  left: 71%;
  border: #ff69b4 0.05px solid;
  animation: in_dot 5s infinite;
}
@keyframes in_dot {
  0% {
    background-color: #ff69b4;
  }
  50% {
    background-color: #000000;
  }
  100% {
    background-color: #ff69b4;
  }
}
/* Pakistan */
.dot-6 {
  top: 51%;
  left: 68%;
  border: #32cd32 0.05px solid;
  animation: pk_dot 5s infinite;
}
@keyframes pk_dot {
  0% {
    background-color: #32cd32;
  }
  50% {
    background-color: #000000;
  }
  100% {
    background-color: #32cd32;
  }
}
/* North Korea */
.dot-7 {
  top: 44%;
  left: 84%;
  border: #00ffff 0.05px solid;
  animation: nk_dot 5s infinite;
}
@keyframes nk_dot {
  0% {
    background-color: #00ffff;
  }
  50% {
    background-color: #000000;
  }
  100% {
    background-color: #00ffff;
  }
}

/* France */
.dot-8 {
  top: 39%;
  left: 50%;
  border: #9b30ff 0.05px solid;
  animation: fr_dot 5s infinite;
}
@keyframes fr_dot {
  0% {
    background-color: #9b30ff;
  }
  50% {
    background-color: #000000;
  }
  100% {
    background-color: #9b30ff;
  }
}

/* Israel*/
.dot-9 {
  top: 50%;
  left: 59%;
  border: #ff00ff 0.05px solid;
  animation: is_dot 5s infinite;
}
@keyframes is_dot {
  0% {
    background-color: #ff00ff;
  }
  50% {
    background-color: #000000;
  }
  100% {
    background-color: #ff00ff;
  }
}

/* Ukraine*/
.dot-10 {
  top: 37%;
  left: 58%;
  border: #d8d6d6 2px dotted;
  animation: ua_dot 5s infinite;
}

/* Japan */
.dot-11 {
  top: 47.5%;
  left: 86%;
  border: #d8d6d6 2px dotted;
  animation: jp_dot 5s infinite;
}

.dot .tooltip {
  visibility: hidden;
  width: auto;
  height: auto;
  background-color: rgb(95, 94, 94);
  color: #cacaca;
  text-align: left;
  font-size: 1.5vh;
  border: #000000 1px solid;
  position: absolute;
  left: 30px;
  z-index: 20;
}

.dot:hover .tooltip {
  visibility: visible;
}

#scroll {
  position: relative;
  color: #f2f2f2;
}

.scroll_graphic {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 0;
}

.scroll_text {
  position: relative;
  padding: 0 1rem;
  margin: 0 auto;
  z-index: 5;
  pointer-events: none;
}

#scroll::after {
  content: "";
  display: block;
  height: 30vh;
}

.step {
  margin: 0 auto 80vh auto;
  padding-top: 12px;
  padding-bottom: 12px;
  padding-left: 12px;
  padding-right: 12px;
  background-color: rgba(50, 50, 50, 0.8);
  border: 1px solid #555;
  max-width: 800px;
  color: #f2f2f2;
  opacity: 0.7;
  transition: transform 0.6s ease, transform-origin 0.6s ease;
  text-align: left;
  font-size: 17px;
  box-sizing: border-box;
}

.step.is-active {
  opacity: 1;
  border-color: #999;
}

.map {
  transition: transform 1s ease;
  transform-origin: center;
  position: relative;
  overflow: hidden;
  width: 100%;
  padding-bottom: 56.35%;
}
/*Hiroshima container*/
.hiroshima_container {
  display: flexbox;
  flex-direction: column;
}

/* CSS for mobile  */
@media (max-width: 768px) {
  .headline h1 {
    font-size: 28px;
    line-height: 1.2;
    margin-bottom: 0.5rem;
    padding: 0 1rem;
  }

  .headline p {
    font-size: 16px;
    padding: 0 1rem;
  }

  #header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1000;
    pointer-events: none;
  }

  .headline {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .step {
    margin-bottom: 60vh;
    width: 90%;
    padding: 10px;
    font-size: 15px;
  }

  .step:first-child {
    margin-top: 10vh;
  }

  .scroll_graphic {
    height: 100vh;
  }
  .box-out {
    flex-direction: column;
  }

  .dot {
    width: 10px;
    height: 10px;
  }
}
