html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background-color: #ffffff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    overflow: hidden;
}

.container {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 20px;
  background: linear-gradient(to bottom, #eef6f5, #a6d0cb);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.floating-buttons {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* allow clicks through the wrapper */
}
.back-button,
.menu-button {
    width: 10%;
    aspect-ratio: 1 / 1;
    position: absolute;
    border-radius: 50%;
    background-color: #ffffff92;
    border: none;
    display: flex;
    justify-content: center;
    cursor: pointer;
    pointer-events: all; /* allow these buttons to be clickable */
    z-index: 1;

  }
.back-button {
    top: 3%;
    left: 3%;
    align-items: center;
}
.back-button::before {
    content: '';
    width: 12px;
    height: 12px;
    border-top: 5px solid rgb(254, 153, 0);
    border-left: 5px solid rgb(254, 153, 0);
    transform: rotate(-45deg);
    /* move to the right 2px */
    margin-left: 3px;
}

.info-button {
    width: 8%;
    aspect-ratio: 1/1;
    position: absolute;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: all;
    top: 3%;
    right: 3%;
    background-color: #fd7e14;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
}

.info-button::before {
    content: 'i';
    font-style: italic;
}

.menu-button {
    bottom: 5%;
    right: 5%;
    align-items: center;
}

.menu-button::before {
    content: '';
    width: 20px;
    height: 3px;
    border-radius: 1px;
    background-color: rgb(254, 153, 0);
    box-shadow:
    0 8px 0 0 rgb(254, 153, 0),
    0 -8px 0 0 rgb(254, 153, 0);
}

h1 {
    color: #3c6b64;
    font-size: 1.8rem;
    margin: 0;
}

hr {
    width: 85%;
    height: 3px;
    background-color: #3c6b64;
    border: none;
    margin: 10px 0;
}

.bottom-divider {
    width: 90%;
    border: none;
    border-top: 1px solid #333;
    margin: 20px 0 0;
}

/* —— Vitals + RPE box —— */
.input-section {
    background-color: #3c6b64;
    border-radius: 20px;
    padding: 15px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

/* two columns of vitals */
.vitals-row {
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.vitals-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: none;
    width: 45%;
}

/* underlined group titles */
.section-title {
    color: white;
    font-size: 1rem;
    text-decoration: underline;
    align-self: center;
}

/* each label+input row inside vitals */
.input-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.input-line label {
    flex: 1;
    color: white;
    font-size: 0.9rem;
    text-align: right;
    margin-right: 8px;
}

.input-line input {
    width: 60px;
    padding: 5px;
    font-size: 1rem;
    border-radius: 5px;
    border: none;
    text-align: center;
}

/* BP two-box group */
.bp-group {
    display: flex;
    align-items: center;
    gap: 4px;
}

.bp-group input {
    width: 40px;
}

/* vertical white divider */
.vertical-divider {
    width: 3px;
    background-color: white;
    margin: 0 10px;
    align-self: stretch;
}

/* RPE row */
.rpe-line {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.rpe-button {
    background-color: #65b0a5;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 6px 12px;
    font-size: 1rem;
    font-weight: bold;
}

.rpe-line input {
    width: 80px;
    padding: 5px;
    font-size: 1rem;
    border-radius: 5px;
    border: none;
    text-align: center;
}

/* —— Metrics on mint background —— */
.metrics-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin-top: 20px;
}

.metrics-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 90%;
    color: #3c6b64;
    font-size: 0.95rem;
}

.metrics-line label {
    flex: 1;
    text-align: right;
    margin-right: 0.5em;
}

.metrics-line input {
    width: 80px;
    padding: 5px;
    font-size: 1rem;
    border-radius: 5px;
    border: none;
    text-align: center;
    flex: 0 0 auto;
    width: 80px;
}

/* distance + unit radios */
.distance-line {
    gap: 10px;
}

.unit-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.unit-options label {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
    gap: 4px;
}

/* Submit button */
.submit-container {
    margin-top: 10px;
}

.submit-button {
    background-color: #65b0a5;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.5rem;
    font-weight: bold;
    padding: 10px 30px;
    cursor: pointer;
}

.menu-popup {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background-color: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
}

.menu-popup-content {
  background-color: white;
  padding: 2rem;
  border-radius: 10px;
  text-align: center;
}

.menu-popup-content button {
  margin: 1rem;
  font-size: 1.2rem;
  padding: 0.5rem 1.5rem;
  cursor: pointer;
}

.menu-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 1.5rem;
  cursor: pointer;
}

.menu-list {
  list-style: none;
  padding: 0;
  margin: 1em 0;
}

.menu-list li {
  margin: 5px 0;
  font-size: 1.2em;
}

.menu-list a {
  color: #333;
  text-decoration: none;
}

popup-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  background: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 15px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.3s ease-in-out;
}

#stopwatchToggle {
  font-size: 1rem;
  border-radius: 10px;
  /*left: 100px;*/
  top: 50%;
  transform: translateY(-50%);
  width: 90px;
  height: 40px;
  border-radius: 10px;
  background-color: #3c6b64; 
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-family: sans-serif;
}

.popup-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 280px;
  background: white;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border-radius: 10px;
  padding: 15px;
  display: none;
  flex-direction: column;
  z-index: 1000;
  transition: transform 0.3s ease-in-out;
}

.popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: bold;
  /* margin-bottom: 10px; */
  color:black;
  cursor: grab;
  padding: 5px;
  border-radius: 6px 6px 0 0;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.popup-header:active {
  cursor: grabbing;
}

.popup-close {
  font-size: 1.3rem;
  cursor: pointer;
  color: #c0392b;
}

#popupStopwatch {
  font-size: 2rem;
  margin-bottom: 15px;
  text-align: center;
  color: black;
}

.popup-controls button {
  margin: 5px;
  padding: 8px 16px;
  background-color: #3c6b64;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.rpe-content img { max-width: 100%; height: auto; display: block; }

.info-popup {
    width: 350px !important;
}

.info-content {
  line-height: 1.2;
  color: #333;
}

.info-content p {
  margin: 0 0 12px 0;
}

.info-content ul {
  margin: 8px 0 12px 20px;
  padding: 0;
}

.info-content li {
  margin: 4px 0;
}