/* ------------------------------
   Global reset
------------------------------- */
*,
*:before,
*:after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background-color: #f8f8f8;
  font-family: sans-serif;
}

/* ------------------------------
   Heading
------------------------------- */
#heading {
  background-color: #f8f8f8;
  min-height: 14vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: clamp(360px, 65vw, 750px);
  margin: 0 auto;
}

#heading h1 {
  margin: 0;
  color: #677979;
  text-align: center;
  font-size: clamp(35px, 6vw, 65px);
}

#instruct {
  margin-left: 2%;
      min-height: 50px;
}

#instruct > h3 {
  color: #677979;
  font-size: clamp(15px, 2.5vw, 25px);
  margin: 0;
  font-family: 'Lucida Sans', Geneva, Verdana, sans-serif;
}

/* ------------------------------
   Main wrapper
------------------------------- */
main {
  display: flex;
  flex-direction: column;
  width: 85%;
  margin: auto;
  min-height: 100%; /* desktop: natural flow */
  min-width: 350px;
  box-shadow: -1px 1px 5px 1px rgb(219 219, 219);
  position: relative;
}

/* ------------------------------
   Container
------------------------------- */
.container {
  width: 80%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  row-gap: 3vw;
  padding-bottom: 20px;
  background-color: cadetblue;
  box-shadow: -1px 2px 4px 2px lightgray;
  flex-grow: 1; 
  min-height: 100dvh;
  min-height: 100vh;
}

.container > * {
  border: 2px solid #164e4f;
}

/* ------------------------------
   Form
------------------------------- */
form {
  background-color: white;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 20px 10px 10px 10px;
  width: 95%;
  flex-grow: 0.5; /* flexible height inside container */
  min-height: 300px; /* fallback if content is short */
}

/* ------------------------------
   Input Form Grid
------------------------------- */
.inputForm {
  display: grid;
  grid-template-areas:
    "day delim1 month delim2 year"
    "dayInput delim1 monthInput delim2 yearInput";
  grid-template-columns: 30% 3% 30% 3% 30%;
  /*align-items: center;*/
  justify-content: center;
  flex-grow: 0.3; 
  /*min-height: 200px;*/
}

.inputForm label {
  font-family: 'Lucida Sans', Geneva, Verdana, sans-serif;
  font-weight: bold;
  color: #5f9ea0;
  font-size: 25px;
  align-self: flex-end;
  background: #f7fbfb;
  border-bottom: 4px solid #5f9ea0;
  padding: 5px;
  box-shadow: -1px 1px 5px 1px rgb(219, 219, 219);
}

#dayLabel   { grid-area: day; }
#monthLabel { grid-area: month; }
#yearLabel  { grid-area: year; }

#delim1 { grid-area: delim1; }
#delim2 { grid-area: delim2; }
.inputForm .inputBoxDays  { grid-area: dayInput; }
.inputForm .inputBoxMonth { grid-area: monthInput; justify-content: space-around; }
.inputForm .inputBoxYear  { grid-area: yearInput; }

.inputForm .inputBox {
  margin: 0;
  width: 100%;
  padding: 0;
  border-radius: 0 0 4px 4px;
  border: 1px solid gainsboro;
  text-align: center;
  font-family: 'Lucida Sans', Geneva, Verdana, sans-serif;
  min-height: 38px;
}

/* ------------------------------
   Separator Section
------------------------------- */
#separator {
  border-radius: 2px;
  border: 1px solid gainsboro;
  font-size: 12pt;
  text-align: center;
  width: 150px;
  padding: 15px;
  flex-grow: 1;
}

#separatorSection {
  color: white;
  font-family: 'Lucida Sans', Geneva, Verdana, sans-serif;
  font-weight: bold;
  font-size: 10pt;
  border-radius: 2px;
  display: flex;
  flex-wrap: wrap;
  flex-grow: 1;
}

#separatorButtons {
  display: flex;
  column-gap: 5%;
  justify-content: space-around;
  width: 96%;
  margin: auto;
}

#separatorLabel {
  background-color: rgb(127, 154, 154);
  padding: 15px;
  flex-grow: 1;
}

.inputDelim{
    place-self: end center;
    font-size: 24px;
}

#convert-reset-btn {
  margin-left: auto;
  display: flex;
  column-gap: 1em;
  flex-wrap: wrap;
  justify-content: flex-end;
  row-gap: 5px;
  flex-grow: 1;
}

button {
  cursor: pointer;
  height: 50px;
  min-width: 120px;
  background-color: rgb(127, 154, 154);
  border: 0;
  border-radius: 3px;
  color: white;
  font-weight: bold;
  flex-grow: 1;
}


/* ------------------------------
   Output
------------------------------- */
#numeralOutput {
  display: flex;
  text-align: center;
  color: rgb(127, 154, 154);
  flex-wrap: wrap;
  gap: 5px;
  flex-grow: 1;
}

#numeralOutput > div {
  background-color: white;
  flex-grow: 1;
  min-width: 300px;
}

#numeralReturn { position: relative; }
#convertedNumber :hover { color: yellow; }

h2 {
  font-family: 'Lucida Sans', Geneva, Verdana, sans-serif;
}

#bottomSection {
  position: relative;
  justify-self: center;
  width: 100%;
}

#copyText {
  display: none;
  position: absolute;
  top: 0;
  right: 0;
  background-color: rgba(127, 154, 154, 0.5);
  padding: 3px;
  color: white;
  z-index: 3;
}

/* ------------------------------
   Mobile overrides
------------------------------- */
@media screen and (max-width: 620px) {
  main {
    min-height: 100dvh; /* full viewport on mobile */
    width: 100%;
  }
  
  

  .container {
    min-height: 100dvh;
    width: 100%;
  }

.container > * {
    border:none;
}

  form {
    row-gap: 2%;
    flex-grow:1;
    
  }

  .inputForm {
    grid-template-areas:
      "day dayInput"
      "month monthInput"
      "year yearInput";
    grid-template-columns: 1fr 2fr;
    grid-template-rows: repeat(3, auto);
    row-gap: 4px;
    padding: 10px;
    box-shadow: 1px 1px 4px 1px #8080804a;
    align-items:center;
  }

  .inputForm .inputBox {
    border-radius: 0px 4px 4px 0;
    align-self: center;
    height: auto;
  }

  .inputForm label {
    color: white;
    background-color: #5f9ea0;
    padding: 5px;
    border-radius: 4px 0 0 4px;
    font-size: 20px;
    height: auto;
    align-self:auto;
  }

  #heading {
    width: 100%;
    justify-content: center;
    min-height:8vh;
  }

  #instruct {
    margin: 0;
    display: flex;
    align-items: center;
    min-height:40px;

  }

  .inputDelim {
    display: none;
  }

  #separatorButtons { row-gap: 5px; }
  #convert-reset-btn { width: 50%; }

  #numeralOutput { flex-direction: column; }
  #numeralOutput h2 { margin: 15px 0; }
}
