@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600&display=swap");

:root {
  --primary-color: #111;
  --secondary-color: #fff;
  --accent-color: #ff6a00;
  --font-family: 'Montserrat', sans-serif;
  --radius: 6px;
}

/* Base Layout */
body {
  font-family: var(--font-family);
  background-color: var(--secondary-color);
  color: var(--primary-color);
  margin: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px;
  min-height: 100vh;
}

/* Containers */
.content,
.form-container,
.result-container {
  width: 100%;
  max-width: 350px;
  text-align: center;
  padding: 2rem;
  border-radius: 20px;
  margin: 0 auto;
}

/* Headings and text */
h1,
.headline {
  font-weight: 600;
  font-size: 1.8rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.headline {
  font-size: clamp(22px, 5vw, 26px);
}

p {
  color: #555;
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

/* Buttons */
.btn-fat,
.btn-dark,
.btn-outline-fat,
.btn-solid-fat {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  border: 2px solid transparent;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius);
}

.btn-solid-fat,
.btn-dark {
  background: #000;
  color: var(--secondary-color);
  border-color: #000;
}

.btn-outline-fat,
.btn-outline-dark {
  background: var(--secondary-color);
  color: var(--primary-color);
  border-color: #000;
  padding: 0.75rem 1rem;
}

.back-link {
  padding: 0.75rem;
  text-decoration: none;
  color: #000;
  display: inline-block;
}

/* Forms */
.form-label {
  text-align: left;
  display: block;
  font-weight: 500;
}

.form-control,
.form-select {
  padding: 0.75rem;
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 1.2rem;
}

.field-errors {
  color: #b00020;
  font-size: 0.9rem;
  margin-top: 0.25rem;
  text-align: left;
}

/* Layout Grids */
.grid-row {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.grid-panel {
  flex: 1 1 0;
  text-align: left;
}

.grid-panel h5 {
  font-weight: 600;
  margin-bottom: 10px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.grid button {
  border: 1px solid #ccc;
  border-radius: 8px;
  padding: 10px;
  background: var(--secondary-color);
  font-weight: 600;
  width: 100%;
}

.grid button.active {
  background: #000;
  color: var(--secondary-color);
}

.measurement-guide {
  width: 100%;
  min-height: 210px; 
  background-image: url("/static/images/adult_seat.0acc02b7bca0.png");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center; /* horizontal + vertical center */
}

/* Body type selection */
.body-options {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
}

.body-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
}

.body-image {
  width: 80px;
  height: 120px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  margin-bottom: 0.5rem;
  transition: transform 0.2s ease;
}

.body-option input[type="radio"]:checked + .body-image,
.body-option:hover .body-image {
  transform: scale(1.05);
}

/* Female body types */
.body-option.body-plum .body-image {
  background-image: url("/static/images/plum.6c673c48d82f.png");
}

.body-option.body-pear .body-image {
  background-image: url("/static/images/pear.87056b32d111.png");
}

.body-option.body-avocado .body-image {
  background-image: url("/static/images/avocado.384daae3a5a6.png");
}

/* Junior body type images */
.body-option.body-slim .body-image {
  background-image: url("/static/images/junior_slim.8c761ac7562b.png");
}

.body-option.body-regular .body-image {
  background-image: url("/static/images/junior_regular.152de764336c.png");
}

.body-option.body-round .body-image {
  background-image: url("/static/images/junior_round.394cb8919330.png");
}

/* Male body type images */
.body-option.body-papaya .body-image {
  background-image: url("/static/images/papaya.b5941217f7e4.png");
}

.body-option.body-banana .body-image {
  background-image: url("/static/images/banana.7fa5b7d609c1.png");
}

.body-option.body-avocado-male .body-image {
  background-image: url("/static/images/avocado_male.6d2e7b199c6e.png");
}

/* Size result view */
.highlight-text {
  font-weight: 600;
}

.secondary {
  font-size: 0.9rem;
  color: #777;
  margin-top: 0.75rem;
  text-align: left;
}

.size-scale {
  position: relative;
  max-width: 300px;
  margin: 20px auto 1.25rem;
}

/* Labels row layout */
.labels-row {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
  text-align: center;
}

/* Side labels positioned over track edges */
.labels-row .side-size {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  font-size: 1.2rem;
  color: #666;
}

.labels-row .side-size:first-child {
  left: 0%; /* same as start of track */
}

.labels-row .side-size:last-child {
  left: 100%; /* same as end of track */
}

/* Recommended (center) label stays normal */
.labels-row .rec-size {
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

/* Track + pointer */
.size-scale .track {
  position: relative;
  height: 2px;
  background: #000;
  margin-top: 10px;
}

.size-scale .pointer {
  position: absolute;
  top: 100%;
  margin-top: 6px;
  left: clamp(10%, var(--offset, 50%), 90%);
  transform: translateX(-50%) rotate(180deg);
  transition: left 0.25s ease;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 12px solid #000;
}

/* Loader */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: 100vw;
  background: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.d-none { display: none !important; }

.spinner-container {
  position: relative;
  text-align: center;
  color: var(--secondary-color);
}

.spinner-logo img {
  max-width: 200px;
  margin: 0 auto;
}

.orbit-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  transform: translate(-50%, -50%);
  animation: spin 2s linear infinite;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.orbiting-dot {
  width: 12px;
  height: 12px;
  background-color: var(--primary-color, #94e6ed);
  border-radius: 50%;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

/* Logo */
.logo {
  width: 60px;
  height: 60px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  margin: 1rem auto 1rem;
  background-image: url("/static/images/logo_icon_blk.2c8bbd2b5073.png");
}

.feedback-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.7rem;   /* larger thumbs */
  color: #d8ddd8;         /* white thumbs */
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.feedback-btn:hover {
  transform: scale(1.15);
  opacity: 0.9;
}

.feedback-btn.active#thumbs-up {
  color: #4caf50;  /* soft green highlight when clicked */
}

.feedback-btn.active#thumbs-down {
  color: #f44336;  /* soft red highlight when clicked */
}

/* Responsive */
@media (max-width: 576px) {
  .form-container { max-width: 100%; border-radius: 0; min-height: 100vh; }
  .grid-row { flex-direction: column; gap: 24px; }
  .grid-panel { width: 100%; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .d-flex.justify-content-between {
    flex-direction: column;
    align-items: stretch;
  }
  .d-flex.justify-content-between .btn {
    width: 100%;
  }
}
