/* === WRAPPERS ==== */
.mainWrapper {
  height: calc(100dvh - 75px);
  min-height: calc(100vh - 75px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  max-width: 1200px;
  gap: var(--space-l);
}

.frontpageWrapper {
  height: calc(100dvh - 165px);
  padding-bottom: env(safe-area-inset-bottom); /* iPhone notch padding */
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  max-width: 1200px;
}

/* Only for center both way! */
.centerWrapper {
  height: 90dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  max-width: 1200px;
}

.statsWrapper {
  height: 70dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  max-width: 1200px;
}

/* === LOGIN === */
.login {
  background-color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--padding-card);
  max-width: 400px;
  margin: var(--space-xl) auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  gap: var(--space-l);
}

@media (max-width: 500px) {
  .login {
    padding: var(--space-l) var(--space-s);
    margin: var(--space-l) var(--space-s);
  }
}

.user-box {
  width: 100%;
  margin-bottom: calc(var(--space-m) + var(--space-xs));
  position: relative;
}

.user-box input {
  all: unset;
  width: 100%;
  text-align: left;
  padding: var(--space-s) 0;
  font-size: 16px;
  color: var(--color-fg);
  border: none;
  border-bottom: 1px solid var(--color-fg);
  background: transparent;
  outline: none !important;
  border-radius: 0;
  box-sizing: border-box;
}

.user-box label {
  position: absolute;
  top: 0;
  left: 0;
  padding: var(--space-s) 0;
  font-size: 16px;
  color: var(--grey);
  pointer-events: none;
  transition: 0.3s ease;
}

.user-box input:focus ~ label,
.user-box input:valid ~ label {
  top: -20px;
  font-size: 12px;
  color: var(--grey);
}

.centerLogo {
  display: flex;
  justify-content: center;
}
.logo {
  height: 100px;
  width: 100px;
  margin: 0 auto;
  animation: pulse 1.5s ease-in-out infinite both;
}

@keyframes pulse {
  from {
    transform: scale(1);
  }
  10% {
    transform: scale(0.91);
  }
  17% {
    transform: scale(0.98);
  }
  33% {
    transform: scale(0.87);
  }
  45% {
    transform: scale(1);
  }
}

/* === Home page === */
.inputWrapper {
  display: flex;
  gap: var(--space-m);
  justify-content: space-between;
  flex-wrap: wrap;
  padding: var(--space-m);
  align-items: center;
  margin-top: 35px;
}

/* Graph */
.graphContainer {
  overflow-x: auto;
  position: relative;
  width: 100%;
  margin: 0 auto;
  border: none;
  margin-top: auto;
  padding-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 380px) {
  .graphContainer {
    padding: 0 var(--space-m);
    margin-bottom: 30px;
  }
}

.graphInner {
  width: 1200px;
}

.graphInner canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  margin-bottom: 20px;
} 

#workoutBarChart {
  height: 300px !important; /* eller det du vil have */
}

 @media (max-width: 500px) {
  #workoutBarChart {
    height: 220px !important;
  }
}

/* === IMPORT FIELD === */
.headerText {
  font-size: 1.8rem;
  font-weight: bold;
  text-align: center;
}

.lastStats {
  padding-bottom: var(--space-l);
  font-family: "Segoe UI", sans-serif;
  font-size: 0.95rem;
  color: #333;
}

.lastStats p {
  margin: var(--space-xs) 0;
  line-height: 1.4;
}

/* Fade-in animation */
.fade-in {
  opacity: 0;
  transform: translateY(10px);
  animation: fadeInMove 0.6s ease-out forwards;
}
@keyframes fadeInMove {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Workout Form */
.workoutForm {
  background-color: var(--white);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--padding-card);
  max-width: 400px;
  margin: var(--space-xl) auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  gap: var(--space-l);
}
@media (max-width: 500px) {
  .workoutForm {
    margin: var(--space-xs);
  }
}

.workoutForm label {
  font-family: "Montserrat", sans-serif;
}

.workoutlabel {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  padding: var(--space-s);
  width: 100%;
}

.workoutlabel input[type="text"],
.workoutlabel input[type="number"] {
  flex: 1 1 40%;
  min-width: 140px;
  padding: 0.6rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  background-color: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
}

.workoutlabel textarea {
  flex: 1 1 80%;
  min-width: 280px;
  min-height: 80px;
  padding: 0.6rem 1rem;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 1rem;
  font-family: "Montserrat", sans-serif;
  background-color: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  resize: vertical;
}

.workoutlabel input {
  margin-right: var(--space-xs);
}

/* Daily Section */
.dailySection {
  background-color: var(--white);
  padding: var(--space-l);
  margin: var(--space-m) auto;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  align-items: center;
}

@media (max-width: 500px) {
  .dailySection {
    margin: var(--space-xs);
    margin-bottom: var(--space-l);
  }
}

.formGroup {
  width: 100%;
  margin-bottom: var(--space-l);
  padding-bottom: var(--space-m);
  border-bottom: 1px solid #f0f0f0;
}

.dailySection h3 {
  align-self: flex-start;
  font-size: 1.2rem;
}

.dailySection input[type="text"],
.dailySection input[type="number"],
.workoutForm input[type="text"],
.workoutForm input[type="number"],
.goals input[type="text"],
.goals input[type="number"] {
  appearance: none;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  background-color: #fff;
  width: 100%;
  max-width: 300px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.05);
  outline: none;
}

.formGroup h4 {
  margin: var(--space-xs) 0;
  font-family: var(--font-main);
}

/* Radio Groups */
.radioGroup {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-m);
}
.radioGroup.center {
  justify-content: center;
}
.radioGroup.grid5 {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-s);
}
.radioGroup.grid7 {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--space-xs);
}
.radioGroup label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  font-size: 1rem;
  padding: var(--space-s) var(--space-xs);
  border-radius: 8px;
  cursor: pointer;
  font-family: var(--font-main);
}
.radioGroup input[type="radio"] {
  width: 1.4rem;
  height: 1.4rem;
}

/* Goals container */
.goals {
  margin: 0 auto;
  max-width: 800px;
  padding: var(--space-s);
  display: flex;
  flex-direction: column;
  gap: var(--space-l);
}

/* Progress bar */
.progress {
  height: 18px;
  background: var(--lightgrey);
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--color-red) 85%, white),
    var(--color-red)
  );
  text-align: center;
  font-size: 0.8rem;
  font-weight: bold;
  color: var(--white);
  line-height: 18px;
  transition: width 0.4s ease;
}

/* Toggle button */
.toggleFormBtn {
  margin-top: var(--space-m);
  background: var(--light-bg);
  border: 1px solid var(--border-color);
  color: var(--color-fg);
  font-weight: 500;
  transition: all 0.2s ease;
}
.toggleFormBtn:hover {
  background: var(--color-fg);
  color: white;
  border-color: var(--color-fg);
}

/* Hidden utility */
.hidden {
  display: none;
}

/* Update/Delete form accordion */
.updateDeleteForm {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
  padding-top: var(--space-m);
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  background: var(--light-bg);
  border-radius: var(--radius);
  transition: all 0.4s ease;
}
.updateDeleteForm.show {
  opacity: 1;
  max-height: 500px;
  padding: var(--space-m);
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}
