/* ===== GLOBAL ===== */
* {
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #eef2ff, #f9fafb);
  margin: 0;
  padding: 20px;
  color: #333;
  overflow-x: hidden;
}

/* ===== CONTAINER ===== */
.container {
  max-width: 800px;
  margin: auto;
  background: white;
  padding: 30px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* ===== HEADINGS ===== */
h1 {
  text-align: center;
  color: #4a7cff;
}

/* ===== INSTRUCTION ===== */
.instruction {
  background: #f1f5ff;
  padding: 15px;
  border-radius: 10px;
  margin-bottom: 25px;
}

/* ===== QUESTIONS ===== */
.question-card {
  animation: fadeSlide 0.4s ease;
}

.question-card p {
  line-height: 1.5;
}

/* ===== ANSWERS ===== */
.answers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.answers button {
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #ddd;
  background: #f8f9ff;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  color: #2c2c2c;
  font-size: 15px;
}

.answers button:hover {
  background: #ffffff;
}

.answers button:active {
  transform: scale(0.98);
}

.answers button.active {
  background: #4a7cff;
  color: white;
}

.answers {
  margin-bottom: 24px; /* ✅ creates space before buttons */
}


/* ===== NAVIGATION (DESKTOP) ===== */
.navigation {
  display: flex;
  justify-content: space-between;
  gap: 30px;              /* bigger space between Back & Next */
  margin-top: 40px;      /* bigger distance from last question */
}

/* ===== NAV BUTTONS ===== */
.navigation button {
  min-width: 140px;
}

/* ===== MOBILE NAVIGATION ===== */
@media (max-width: 600px) {
  .navigation {
    display: flex;
    flex-direction: row;   /* ✅ ONE ROW */
    gap: 15px;             /* ✅ space between Back & Next */
    margin-top: 30px;
  }

  .navigation button {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.9rem;
    border-radius: 10px;
  }
}


/* ===== BUTTONS ===== */
button {
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  background: #4a7cff;
  color: white;
  font-size: 15px;
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover {
  background: #365fe0;
}

#finishBtn {
  margin-top: 25px;
  width: 100%;
}

/* ===== RESULTS ===== */
.result {
  margin-top: 20px;
}

.bar {
  background: #e5e7eb;
  height: 14px;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 6px;
}

.fill {
  height: 100%;
  background: linear-gradient(90deg, #4a7cff, #7bed9f);
  transition: width 0.8s ease;
}

/* ===== INTERPRETATION ===== */
.interpretation {
  margin-top: 30px;
  padding: 20px;
  background: #f1f5ff;
  border-radius: 10px;
}

.final-text {
  margin-top: 30px;
  padding: 20px;
  background: #f6f8f7;
  border-radius: 12px;
}

.final-text h3 {
  margin-bottom: 10px;
}

/* ===== LINKS ===== */
.result-link {
  display: inline-block;
  margin-top: 10px;
  padding: 12px 20px;
  background: #4caf50;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: bold;
}

.result-link:hover {
  opacity: 0.9;
}

/* ===== INPUTS (ADMIN) ===== */
textarea,
input {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;
  font-size: 15px;
}

/* ===== ANIMATION ===== */
@keyframes fadeSlide {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== MOBILE SUPPORT ===== */
@media (max-width: 600px) {

  body {
    padding: 10px;
  }

  .container {
    padding: 16px;
    border-radius: 12px;
  }

  h1 {
    font-size: 1.4rem;
    line-height: 1.3;
  }

  .instruction {
    font-size: 0.95rem;
    padding: 12px;
  }

  .question-card p {
    font-size: 1.05rem;
  }

  .answers button {
    padding: 16px;
    font-size: 1rem;
    border-radius: 14px;
  }

  button {
    width: 100%;
    font-size: 1rem;
    padding: 14px;
  }

  #finishBtn {
    margin-top: 15px;
  }

  .bar {
    height: 12px;
  }

  .interpretation,
  .final-text {
    padding: 14px;
    font-size: 0.95rem;
  }

  .result-link {
    width: 100%;
    text-align: center;
  }
}
