:root {
  --font-size-1: 1rem;
  --font-size-2: 1.3rem;
  --font-size-3: 2.5rem;
}
html {
  height: 100%;
  overflow-y: scroll;
}
body {
  margin: 0;
  padding: 0;
  /* min-height: 100%; */
  overflow-x: hidden;
  height: 100%;
  font-family: Arial, sans-serif;
  /* font-size: 1rem; */
   font-size: 18px;
  text-align: center;
  background: linear-gradient(to bottom, #4f626b, #4f626b, #10141b);
}

.top-section {
  position: relative;
  width: 100%;
  /* height: 400px; */
  background-image: url("images/background-top2.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: scroll;
  /* padding-bottom: 2em; */
  color: white;
}

header,
footer {
  padding: 0.5em;
  color: #fff;
  font-size: var(--font-size-1);
}

main {
  padding: 4em;
}

.lettersContainerWrapper {
  overflow-x: auto; /* Enable horizontal scrolling */
  overflow-y: hidden; /* Disable vertical scrolling */
  width: 100%; /* Full width */
  white-space: nowrap; /* Prevent wrapping of child elements */
  box-sizing: border-box;
  scroll-behavior: smooth;
  padding-bottom: 12px; /* Space for scrollbar */
  /* background-color: red; */
}

#lettersContainer {
  display: inline-flex; /* Allow the content to stretch horizontally */
  gap: 20px;
  /* padding: 10px; */
  transition: justify-content 0.3s ease;
  width: max-content; /* Forces content to be wider than the container */
  flex-wrap: nowrap; /* Prevent wrapping */
  /* background-color: blue; */
}

#lettersContainerWrapper::-webkit-scrollbar {
  height: 8px; /* Scrollbar height */
}

#lettersContainerWrapper::-webkit-scrollbar-thumb {
  background: #999;
  border-radius: 4px;
}

#lettersContainerWrapper::-webkit-scrollbar-track {
  background: transparent;
}

.letter-block {
  text-align: center;
  transform-origin: center bottom;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-color: rgba(255, 255, 255, 0);
  border-radius: 10px;
  /* padding: 10px; */
  /* flex-shrink: 0; */
  gap: 15px;
  width: 400px; /* CHANGE SIZE  */
}

.image-wrapper {
  position: relative;
  display: inline-block;
  cursor: default;
}

.letter-block img {
  /* width: clamp(100px, 17vw, 300px); */
  /* width:250px; */
  height: auto;
  object-fit: cover;
  display: block;
  border-radius: 8px;
  border-radius: 8px;
  transform-origin: top center; /* Set origin for scaling */
  max-width: 400px;
}
.scrollable-wrapper {
  width: 100%; /* Take full width */
  height: 100px; /* Fixed height (adjust as necessary) */
  overflow-y: auto; /* Enable vertical scrolling when content exceeds */
  /* background-color: #eee; Light background color */
  padding: 8px;
  box-sizing: border-box;
  border-radius: 4px; /* Optional: for rounded corners */
}

/* Content inside the wrapper, which will expand based on text */
.scrollable-content {
  width: 100%; /* Full width of the container */
  height: auto; /* Let it expand with the content */
  max-height: 100%; /* Prevent exceeding the wrapper height */
  /* overflow-y: auto;     Scrollable content when it overflows vertically */
  /* background-color: transparent; Optional: transparent background */
  color: white;
  font-size: var(--font-size-1);
  /* line-height: 1.4; */
  /* word-wrap: break-word; Make sure text breaks appropriately */
  white-space: pre-wrap; /* Allow text wrapping within the div */
  /* padding: 4px; */
  text-align: left;
}
.letter-block textarea {
  /* width: clamp(100px, 17vw, 300px); */
  /* width:100%; */
  margin-top: 5px;
  height: 100%;
  font-size: 14px;
  padding: 4px;
  border: none;
  border-radius: 4px;
  resize: none;
  background: transparent;
  color: white;
  pointer-events: none;
  cursor: default;
  overflow-y: auto;
  width: 100%;
  background-color: blue;
}

.input-container {
  position: relative;
  width: 500px;
  max-width: 90%;
  margin: 20px auto;
}

#nameInput {
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  width: 100%;
  height: 70px;
  font-size: 2.8rem;
  padding: 8 50px 0 20px;
  border: 5px solid #70d08e;
  border-radius: 25px;
  text-align: center;
  line-height: 70px;
  box-sizing: border-box;
  box-shadow: rgb(38, 57, 77) 0px 20px 30px -10px;
  background: #fff;
}

#nameInput::placeholder {
  font-size: 2rem;
  color: #aaa;
}

#nameInput:focus {
  border-color: #87fdac;
  outline: none;
}

#clearBtn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: white;
  color: #70d08e;
  font-size: 1.5rem;
  font-weight: bold;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}

#clearBtn:hover {
  opacity: 1;
}

#actions {
  margin: 20px auto;
  display: flex;
  justify-content: center;
  gap: 12px;
  max-width: 500px;
  padding-bottom: 20px;
  position: relative;
  z-index: 10;
  white-space: nowrap; /* Prevent button from wrapping */
}

#saveBtn,
#shareBtn {
  font-size: 1.2rem;
  padding: 10px 24px;
  border-radius: 6px;
  border: none;
  background-color: #70d08e;
  color: black;
  cursor: pointer;
  box-shadow: rgb(38, 57, 77) 0px 4px 6px -1px;
  transition: background-color 0.3s ease;
  user-select: none;
}

#saveBtn:hover,
#shareBtn:hover {
  background-color: #87fdac;
}

.popup {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #2a373d;
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 999;
}

.popup.show {
  opacity: 1;
}

.location-map {
  margin-top: 5px;
  max-width: 150px;
  max-height: 150px;
  border-radius: 8px;
  display: block;
}
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal {
  background: #fff;
  border-radius: 10px;
  padding: 20px;
  width: 90%;
  max-width: 500px;
  position: relative;
  text-align: left;
  font-family: Nunito, sans-serif;
}

.modal h2 {
  margin-top: 0;
  color: #2a373d;
}

.modal .close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 20px;
  border: none;
  background: none;
  cursor: pointer;
}
.modal a {
  color: #70d08e; /* Green color */
  text-decoration: underline; /* Optional: add underline */
}

.modal a:hover {
  color: #58a56f; /* Darker green on hover */
}

footer .footer-links {
  margin-top: 10px;
}

footer .footer-links a {
  color: #70d08e;
  text-decoration: underline;
  cursor: pointer;
  margin: 0 5px;
  transition: color 0.2s ease;
}

footer .footer-links a:hover {
  color: #58a56f;
}
.alt-indicator {
  position: absolute;
  bottom: 4px;
  right: 4px;
  font-size: 0.8rem;
  color: #70d08e;
  background: rgba(255, 255, 255, 1);
  border-radius: 50%;
  user-select: none;
  cursor: pointer; /* Ensure cursor changes to pointer when hovering */
  z-index: 9999; /* Make sure it's above other elements */
  width: 20px;
  height: 20px;
}

.alt-indicator.open {
  font-size: 1.3rem;
}

.alternative-selector {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid #ccc;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
  padding: 6px;
  border-radius: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  z-index: 10000; /* Make sure it appears above everything else */
  margin-top: 4px;
  width:min-content;
}

.alternative-selector img {
  width: 80px;
  height: 80px;
  cursor: pointer;
  border-radius: 4px;
  border: 2px solid transparent;
  transition: border 0.2s;
  box-sizing:border-box
}

.alternative-selector img.selected {
  border: 4px solid rgb(247, 203, 59);
}

.speech-bubble {
  position: relative;
  background: #2a373d;
  color: #fff;
  padding: 1em;
  border-radius: 10px;
  max-width: 700px;
  text-align: center;
  margin: 2em auto;
  font-size: 1.2em;
}

.speech-bubble::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 20px solid transparent;
  border-bottom: 0 solid transparent;
  border-right: 20px solid #2a373d;
  clip-path: polygon(0 100%, 100% 0, 100% 100%);
}

.welcome-title {
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  font-size: var(--font-size-3);
  margin-bottom: 0.2em;
  color: #ffd350;
}

.welcome-description {
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  font-size: var(--font-size-2);
  line-height: 1.2;
}
::-webkit-scrollbar {
  background-color: rgba(79, 150, 150, 0.205);
  width: 15px;
  border-radius: 100px;
}
::-webkit-scrollbar-thumb {
  background-color: #58a56f;
  border-radius: 100px;
  border: 3px solid transparent;
  background-clip: content-box;
}
.side-identifier {
  margin-top: -10px;
  color: rgba(255, 255, 255, 0.235);
  font-size: var(--font-size-1);
}
.custom-tooltip {
  position: fixed;
  background-color: #222;
  color: #fff;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 0.9rem;
  pointer-events: none;
  white-space: nowrap;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.speech-wrapper {
  display: flex;
  align-items: center;
  margin: 0 auto;           /* ← centers the wrapper itself */
  width: fit-content;       /* ← shrink-wraps to the content width */
}

.speech-image {
  width: 150px;
  height: auto;
  margin-right: 25px; /* remove space between image and bubble */
  display: block;
}
.speech-bubble {
  margin-left: 0;
  margin-right: 70px
}