html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  width: 100%;
  box-sizing: border-box;
  background-image: url('/static/images/almonds.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
}

body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* Stacks content from the top */
  align-items: center;
}

#pwrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

#main-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%; /* Ensures it fills the space */
  max-width: 100%;
  box-sizing: border-box;
}
#findForm {
  display: flex;
  align-items: center;
  gap: 10px;
}



#controls {
  z-index: 10;
  display: flex;
  gap: 15px;
  align-items: center;
}

#formattedText {
  width: 100%;
  max-width: 500px;
  height: auto;
  min-height: 300px;
  max-height: 80vh;
  overflow-wrap: break-word;
  word-wrap: break-word;
  color: white;
  background-color: rgba(4, 105, 91, 0.6);
  text-align: left;
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  padding: 20px;
  overflow-y: auto;
  box-sizing: border-box;
  border: 1px solid #ccc;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  backdrop-filter: blur(4px);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#inspire {
  background-color: rgba(4, 105, 91, 0.6);
  color: white;
  padding: 20px;
  border-radius: 12px;
  max-width: 600px;
  text-align: center;
  font-style: italic;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  overflow-wrap: break-word;
  word-wrap: break-word;
}

*, *::before, *::after {
  box-sizing: border-box;
}

/* ------------------- Mobile-specific overrides ------------------- */
@media (max-width: 768px) {
  #pwrapper,
  #main-container {
    padding-left: 15px;
    padding-right: 15px;
    margin: 0;
  }

  #formattedText,
  #inspire {
    width: 100%;
    max-width: 100%;
    /* Use padding and margin from parent container to avoid conflicts */
    padding: 0;
    margin: 0;
  }

  .text-container,
  #formattedText h2 {
    font-size: clamp(1rem, 3vw, 1.2rem);
  }

  .text-container {
    padding-left: 15px;
    padding-right: 15px;
  }

  #controls {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding: 0 15px;
  }

}