html {
  scroll-behavior: smooth;
}

* {
  --whitefont: #fafafa;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Courier New", Courier, monospace;
}

.main-section {
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: linear-gradient(
      to bottom,
      rgba(19, 22, 17, 0) 60%,
      /* Start transparent at 60% height */ rgb(17, 19, 22) 90%
        /* Transition to solid color from 90% */
    ),
    url(imgs/946678c3-2d74-4a20-9d14-70f3b92958b3-EDIT.jpg);
  height: 94vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--whitefont);
  margin-bottom: 10vh;
  width: 65vh;
  background-color: rgba(0, 0, 0, 0.178);
  animation: leFadeInLeft 1.3s ease-in-out forwards; /* Apply animation */
}

@keyframes leFadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-60px); /* Start position off to the left */
  }
  to {
    opacity: 1;
    transform: translateX(0); /* End at the original position */
  }
}

.welcome h1,
h2,
h3 {
  padding: 1px;
}

.welcome h1 {
  font-size: 1.5rem;
  margin-bottom: -10px;
}

.welcome h2 {
  margin-bottom: -5px;
  font-size: 3.1rem;
  font-weight: 900;
  word-spacing: -9px;
}

.welcome h3 {
  font-size: 1.1rem;
  width: 90%;
}

.welcome #explore {
  border-radius: 4px;
  border: 1px solid white;
  font-size: 1.1rem;
  background-color: transparent;
  width: 200px;
  color: var(--whitefont);
}

.welcome #explore:hover {
  background-color: rgba(195, 198, 214, 0.281);
}

.map-section {
  display: flex;
  position: relative;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 73vh;
  color: var(--whitefont);
  background-color: rgb(17, 19, 22);
}

.map-legend {
  display: flex;
  align-items: center; /* Centers vertically within the flex container */
  justify-content: center; /* Centers horizontally */
  opacity: 0; /*Set back to 0!!!!!!!!*/
  transition: opacity 1.5s ease;
  gap: 60px;
}

.visited {
  display: flex;
  align-items: center;
}

.non-visited {
  display: flex;
  align-items: center;
}

.map-legend p {
  padding: 0;
  margin: 0;
}

.box {
  padding: -10px;
  margin-left: 10px;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(0, 0, 0, 0.411);
}

#visited {
  background-color: rgb(104, 152, 224);
}

#non-visited {
  background-color: rgb(211, 219, 245);
}

.us_map {
  width: 100%;
  max-width: 110vh; /* Set this as a limit */
  height: auto;
  opacity: 0; /*Set back to 0!!!!!!!!*/
  pointer-events: none;
  transition: opacity 1.5s ease;
  padding-left: 30px;
  padding-right: 30px;
}

.us_map path {
  fill: rgb(137, 140, 143);
}

@keyframes colorChange {
  0% {
    fill: rgb(104, 152, 224); /* Starting color */
  }
  50% {
    fill: rgb(153, 180, 221); /* Intermediate color */
  }
  100% {
    fill: rgb(104, 152, 224); /* Back to starting color */
  }
}

#tx {
  animation: colorChange 2s ease-in-out infinite; /* Color change animation */
  cursor: pointer;
}

#nm,
#az,
#nv,
#ny,
#co {
  fill: rgb(104, 152, 224);
  cursor: pointer;
}

#tx:hover,
#nm:hover,
#az:hover,
#nv:hover,
#ny:hover,
#co:hover {
  fill: rgb(134, 169, 221);
}

#fl,
#wy {
  fill: rgb(211, 219, 245);
}

.message {
  display: flex;
  justify-content: center;
  margin-top: 6px;
  text-decoration: underline;
  text-underline-offset: 5px;
  font-size: 1.7vh;
  opacity: 0;
  transition: opacity 1.5s ease;
  width: 100%;
}

.overlay {
  position: fixed; /* Fixes the overlay to the viewport */
  top: 0;
  left: 0;
  width: 100%; /* Full width */
  height: 100%; /* Full height */
  background-color: rgba(0, 0, 0, 0.562); /* Semi-transparent black */
  z-index: 2; /* Ensure it sits above other content */
  opacity: 0; /* Start hidden */
  pointer-events: none; /* Prevents interaction with the overlay */
  transition: opacity 0.5s ease; /* Smooth transition for showing/hiding */
}

/* Show overlay */
.overlay.active {
  opacity: 1; /* Fully visible */
  pointer-events: all;
}

.close-button {
  position: absolute;
  right: 0;
  z-index: 1;
  cursor: pointer;
  border: none;
  outline: none;
  background: none;
  font-size: 2rem;
  font-weight: bold;
  padding: 0 15px;
  box-shadow: none;
  color: #fafafa93;
}

.close-button:focus {
  outline: none; /* Remove focus outline */
  box-shadow: none; /* Prevent focus styles like box-shadow */
}

.close-button:hover {
  color: #fafafa;
}

#carouselExampleIndicators {
  position: absolute; /* Absolute positioning for the overlap */
  top: 50%; /* Centers vertically */
  left: 50%; /* Centers horizontally */
  transform: translate(-50%, -50%); /* Adjusts for the center point */
  z-index: 2; /* Brings the carousel on top of the map */
  width: 60vh; /* Adjust as needed to fit the size of the overlap */
  /*Wont show up unless state is pressed*/
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease-in-out; /* Smooth transition for opacity */
}

.carousel-inner img {
  max-height: 100%; /* Ensure image fits within the carousel */
  object-fit: cover;
}

.videos {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: auto;
  background-image: linear-gradient(
      to top,
      rgba(19, 22, 17, 0) 60%,
      rgb(17, 19, 22) 90%
    ),
    url(imgs/IMG_1678-EDIT.jpg);
  min-height: 90vh; /* Optional minimum height to ensure it doesn’t get too short */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.title {
  color: var(--whitefont);
  padding-top: 20vh;
  padding-bottom: 2vh;
}

.title h1 {
  font-size: 2.1rem;
  font-weight: 900;
  text-align: center;
}

.card-group {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-bottom: 35px;
}

.card {
  color: var(--whitefont);
  background-color: transparent;
  width: 40vh;
  max-width: 300px;
  margin: 10px;
  border: none;
  overflow: hidden;
}

.card-title {
  margin-bottom: 5px;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.card video {
  width: 100%;
  height: auto;
  display: block;
  filter: brightness(85%);
}

.card-body {
  background-color: rgba(0, 0, 0, 0.418);
  font-size: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px;
}

@media (max-width: 768px) {
  .welcome {
    max-width: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: center;
    justify-content: center;
  }

  .welcome h1 {
    margin-bottom: 2px;
  }

  .welcome h2 {
    line-height: 0.9;
    text-align: center;
  }

  .welcome h3 {
    margin: 10px;
  }

  .map-legend {
    gap: 40px;
    font-size: 1.8vh;
    margin-bottom: 15px;
  }

  .us_map {
    padding-left: 1px;
    padding-right: 1px;
  }

  .videos {
    background-position: right center;
  }

  .videos video {
    pointer-events: none;
  }

  .message {
    font-size: 1.8vh;
    text-align: center;
  }

  .title h1 {
    font-size: 2.5vh; /* Slightly smaller font size */
    margin-top: 5vh;
  }

  .card-group {
    gap: 10px; /* Reduce space between cards */
    display: flex;
    flex-wrap: wrap; /* Allow wrapping */
    justify-content: center; /* Center cards */
    align-content: center;
  }

  .card {
    width: 60%; /* Make cards take full width */
    max-width: 100%; /* Ensure they don’t exceed screen width */
  }

  .card-body {
    font-size: 0.95rem;
  }
}

@media (max-width: 575px) {
  #carouselExampleIndicators {
    width: 100%;
  }
}
