/* Global Styles */

*{
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
--bg-color: white;
--text-color: #151515;
--text-font: Prata, Didone, "Bodoni MT", Georgia, serif;
}

/* Header Styles */

header{
  display: block;
  text-align: center;
  margin: 4rem 0 2rem 0;
}

/* Background Styles */

#ocean{
  background-color: #73c1d7;
  position: fixed;
  bottom: 0;
  left: 0;
  height: 15vh;
  width: 100%;
  transition: height 1.2s ease-in-out, background-color 1.8s ease-in-out;
  z-index: -1;
}



.wave{
  position: absolute;
  top: -95px;
  left: 0;
  width: 200%;
  height: 100px;
  fill: #73c1d7;
  animation: rollWave 4s linear infinite;
  transition: fill 1.8s ease-in-out, height 1.2s ease-in-out, top 1.2s ease-in-out;
}

@keyframes rollWave {
  0% {
    transform: translateX(0);
  }
  100%{
    transform: translateX(-50%);
  }
}

/* Dramatic Wave */

/* Dramatic Wave - DIED */
body.drowned #ocean{
  background-color: #187d98;
}

body.drowned .wave{
  fill: #187d98;
}

/* Dramatic Wave - SURVIVED */
body.survived #ocean{
  animation-duration: 8s;
  background-color: #73d2d7;
}

body.survived .wave{
  animation-duration: 8s;
  fill: #73d2d7;
}

body.survived{
  background-color: #fff8d6;
}




/* Body Styles */

body{
  font-family: Helvetica, Arial, sans-serif;
  width: 80vw;
  margin-right: auto;
  margin-left: auto;
  background-color: white;
  transition: background-color 1.5s ease-in-out;
}

h1{
  font-family: var(--text-font);
  margin-bottom: 0.5rem;
}

h2{
  font-family: var(--text-font);
  margin-bottom: 1rem;
  font-weight: 600;
}

h3{
  font-family: var(--text-font);
  margin: 1rem 0 1.5rem 0;
  font-size: 1.8rem;
}


/* Subtitle */
.subtitle{
  font-family: var(--text-font);
  color: #73c1d7;
  font-weight: 600;
  margin-bottom: 2rem;
}

/* Title page explaination */
.explain-text, #other-explanation{
  font-size: 1.3rem;
  margin-bottom: 2rem;
}

.explain-text a{
  color: var(--text-color);
  font-family: var(--text-font);
  font-weight: bold;
  font-size: 1.1rem;
  text-decoration: none;
}


.explain-text a:hover{
  color: #73c1d7;;
  cursor: pointer;
}

/* Buttons */

.buttons{
  margin-top: auto;
}


.next-button, .back-button, .show-graphs, .new-prediction{
  margin: 1rem 0.5rem 1rem 0;
  padding: 0.6rem 1.5rem 0.6rem 1.5rem;
  border: 1px solid white;
  border-radius: 0.6rem;
  background-color: #85d8ef;
  font-size: 1.2rem;
  transition: transform 0.2s ease-in-out; /* Smoothes hover effect*/
}

.next-button:hover, .back-button:hover, .new-prediction:hover, .show-graphs:hover{
  transform: scale(1.04);
  cursor: pointer;
}


/* Colorful hover effect*/

.buttons .predictSurv {
  position: relative;
  z-index: 0;
  margin: 1rem 0.8rem 1rem 0;
  padding: 0.6rem 1.5rem;
  border: none;
  outline: none;
  border-radius: 0.6rem;
  font-family: inherit;
  font-size: 1.2rem;
  background-color: white;
  cursor: pointer;
}

.buttons .predictSurv:before {
  content: '';
  background: linear-gradient(45deg, #ff0000, #ff7300, #fffb00, #48ff00, #00ffd5, #002bff, #7a00ff, #ff00c8, #ff0000);
  position: absolute;
  top: -2px;
  left: -2px;
  background-size: 400%;
  z-index: -1;
  filter: blur(5px);
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  animation: glowing 20s linear infinite;
  opacity: 0;
  transition: opacity .3s ease-in-out;
  border-radius: 0.6rem;
}


.buttons .predictSurv:after {
  content: '';
  position: absolute;
  z-index: -1;
  width: 100%;
  height: 100%;
  background-color: white;
  left: 0;
  top: 0;
  border-radius: 0.6rem;
}

/* 3. Reveal glow on hover */
.buttons .predictSurv:hover:before {
  opacity: 1;
}


@keyframes glowing {
  0% { background-position: 0 0; }
  50% { background-position: 400% 0; }
  100% { background-position: 0 0; }
}


/* Form */

.form-step{
  display: none;
}

div.form-step.active{
  display: flex;
  padding: 2rem;
  flex-direction: column;
  margin-right: auto;
  margin-left: auto;
  min-height: clamp(550px, 50vh, 650px); /*Min height, ideal height, max*/
  width: 100%;
  max-width: 700px;
  margin-top: 10rem;
}

.form-step > div{
  display: flex;
  flex: 1;
  flex-direction: column;
}

#spch-page{
  display: 'none';
}


/* Input */

.text-input input{
  padding: 0.8rem 1rem 0.8rem 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid;
  border-radius: 0.5rem;
  font-size: 1.2rem;
}

.select-input select{
  padding: 0.8rem 1rem 0.8rem 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid;
  border-radius: 0.5rem;
  font-size: 1.2rem;
}


.number-input input{
  padding: 0.8rem 1rem 0.8rem 1rem;
  margin-bottom: 0.5rem;
  border: 1px solid #151515;
  border-radius: 0.5rem;
  font-size: 1.2rem;
}


input[type="radio"]{ /* Style radio buttons different from browser default */
  appearance: none;
  width: 1rem;
  height: 1rem;
  outline: 3px solid #151515;
  outline-offset: 2px;
  border-radius: 20%;
  cursor: pointer;
}

input[type="radio"]:checked {
  background: #151515;
}

/* Vertical and horizontal radio button styling */

.radio label{
  margin: 0 1rem 0 1rem;
}

.radio-input{
  display: flex;
  gap: 2rem;
  margin-bottom: 0.3rem;
}

.radio-input.vertical {
  flex-direction: column;
  align-items:flex-start;
  gap: 1rem;
  font-size: 1.3rem;
  
}

.radio-input.horizontal{
  flex-direction: row;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 1.3rem;
}

.radio-input input{
  margin-left: 0.5em;
}

/* Error message */
.alert{
  font-family: "Prata", serif;
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  color: #153970;
  width: 100%;         
  height: 1.5rem;
 
}

/* Prediction message */
h3#prediction-result{
  line-height: 2;
  font-size: 2rem;
}

/* Graphs section */

div.form-step.active:has(#graphs-container){ /* More space for content on graphs page */
  margin-top: 7rem;
}

#graphs-container{
  display: none;
  grid-template-columns: repeat(4, 1fr);
  width: 1300px;
  max-width: 90vw;
  margin-left: calc((100% - min(1300px, 90vw)) / 2); /* Content goes outside container */
  margin-right: calc((100% - min(1300px, 90vw)) / 2);
  gap: 1rem;
  margin-top: 2rem;
  margin-bottom: 4rem;
}

.chart-card{
  background-color: transparent;
  border: 1px solid #dcdcdc;
  min-width: 0;
  padding: 1rem;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.chart-card.show{
  opacity: 1;
  transform: translateY(0);
}

.chart-card h4{
  font-family: var(--text-font);
  text-align: center;
  font-weight: normal;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}


/* Mobile Styles */

@media (max-width: 767px) {

  h1 {
    font-size: 1.5rem;
  }

  h2 {
    font-size: 1.2rem;
  }

  h3 {
    font-size: 1.3rem;
  }

  p, .explain-text {
    font-size: 1.2rem;
  }

  .explain-text a{
    font-size: 1rem;
  }

  .alert{
    font-size: 1rem;
  }

  .next-button, .back-button, .show-graphs, .new-prediction .predictSurv{
  padding: 0.5rem 1.4rem 0.5rem 1.4rem;
  font-size: 1.1rem;

}


  div.form-step.active{
  padding: 1rem;
  margin-right: auto;
  margin-left: auto;
  min-height: clamp(600px, 50vh, 800px); /*Min height, ideal height, max*/
  width: 100%;
  max-width: 650px;
  margin-top: 8rem;
  }

  .radio-input.horizontal{
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  font-size: 1.2rem;
  }

  .radio-input.vertical {
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  font-size: 1.2rem;
  
  }

  #graphs-container{
  grid-template-columns:  1fr;
  width: 90vw;
  gap: 1rem;
  margin-top: 1rem;
  margin-bottom: 3rem;
}

}