/* Forces the line break in header in mobile */
@media (max-width: 1023px) {
  #sticky-nav-container .nav span {
    display: block;
  }
}

* {
  margin: 0;
}

h1 {
  color: var(--theme-ui-colors-secondary);
  font-weight: 800;
  font-size: 2.5rem;
}

h2 {
  text-align: center;
  color: var(--theme-ui-colors-black);
  padding: 1em 0 0.5em 0;
  font-weight: 800;
}

h4 {
  font-size: 1.5rem;
  margin: 0;
  text-align: center;
}

h5 {
  font-size: 1.1rem;
  line-height: 2rem;
}

p {
  padding: 10px;
  margin: 0;
}

#main-wrapper,
#results-wrapper {
  background-repeat: no-repeat;
  background-position: bottom;
  background-size: cover;
  background-attachment: fixed;
}

.container {
  max-width: 100%;
  padding: 0;
  text-align: center;
}

#main-wrapper {
  background-image: url(../img/singapore-cbd.jpg);
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#results-wrapper {
  background-image: linear-gradient(rgba(0, 0, 0, 0.1), rgba(255, 255, 255, 0.5)), url(../img/singapore-cbd.jpg);
}

.hero-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4em;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 0.75rem;
  max-width: 1000px;
  width: 100%;
  padding: 2em 4em;
  margin: 3em;
}

.hero-content p {
  padding: 0;
}

form {
  border-radius: 12px;
  width: 100%;
  max-width: 450px;
}

.age {
  width: 100%;
}

input {
  text-wrap: wrap;
}

label {
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--theme-ui-colors-primary);
  width: 150px;
}

input[type="number"],
input[type="text"] {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--theme-ui-colors-light-grey);
  border-radius: 8px;
  box-sizing: border-box;
  font-size: 1rem;
  font-family: inherit;
}

input[type="number"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--theme-ui-colors-secondary);
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

/* Hide the arrows on number inputs for Chrome, Safari, Edge */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Hide the arrows on number inputs for Firefox */
input[type="number"] {
  -moz-appearance: textfield;
}

/* --- Dropdown Styling --- */
.dropdown {
  position: relative;
  width: 100%;
}

.input-wrapper,
.dropdown-button {
  position: relative;
}

.input-icon {
  position: absolute;
  right: 12px;
  top: 45%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--theme-ui-colors-grey);
}

.dropdown-button {
  width: 100%;
  padding: 5px 20px 5px 5px;
  padding-right: 35px;
  border: 1px solid var(--theme-ui-colors-light-grey);
  border-radius: 8px;
  background-color: var(--theme-ui-colors-white);
  text-align: left;
  cursor: pointer;
  font-size: 1rem;
  color: var(--theme-ui-colors-grey);
  font-family: inherit;
  display: flex;
  align-items: center;
}

.dropdown-button span {
  flex-grow: 1;
}

#occupationInput {
  min-height: 30px;
  height: auto;
  field-sizing: content;
  resize: none;
  overflow: hidden;
  width: 100%;
  padding: 5px 20px 5px 5px;
  border: 1px solid var(--theme-ui-colors-light-grey);
  border-radius: 0.5rem;
  align-content: center;
  white-space: pre-line;
  cursor: pointer;
  font-size: 1rem;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: var(--theme-ui-colors-white);
  width: 100%;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--theme-ui-colors-light-grey);
  border-radius: 8px;
  z-index: 10;
  margin-top: 5px;
  padding: 0;
  list-style: none;
  font-size: 1rem;
}

.vscroller {
  max-height: 220px;
  overflow-y: auto;
}
.dropdown-content::-webkit-scrollbar {
  -webkit-appearance: none;
  width: 7px;
  height: 7px;
}
.dropdown-content::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background-color: var(--theme-ui-colors-submain);
  -webkit-overflow-scrolling: auto;
}
.dropdown-content.show {
  display: block; /* Show when needed */
  overflow-x: clip;
}
.dropdown-content li {
  padding: 6px 16px;
  cursor: pointer;
}
.dropdown-content li:hover {
  background-color: #f1f1f1;
}
.dropdown-content li .zh {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
}
.dropdown-content li .en {
  display: block;
  font-size: 0.75rem;
  color: var(--theme-ui-colors-primary);
}

.error-message {
  display: none;
  color: #ef4444;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.error-message.visible {
  display: block;
}

input.invalid {
  border-color: #ef4444;
}

/* --- Utility Class --- */
.hidden {
  display: none;
}

/* --- Submit & Back Buttons --- */
button[type="submit"],
#backButton {
  width: 20%;
  padding: 0.8rem;
  border: none;
  border-radius: 8px;
  background-color: var(--theme-ui-colors-main);
  color: var(--theme-ui-colors-white);
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#backButton {
  margin: 2em 0 4em 0;
}

button[type="submit"]:hover,
#backButton:hover {
  background-color: var(--theme-ui-colors-submain);
}

/* Style for the disabled button */
button[type="submit"]:disabled {
  background-color: var(--theme-ui-colors-primary);
  cursor: not-allowed;
}
button[type="submit"]:disabled:hover {
  background-color: var(--theme-ui-colors-grey);
}

/* Specific style for back button if needed */
.back-button {
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  background-color: var(--theme-ui-colors-primary);
  color: var(--theme-ui-colors-white);
  font-weight: 500;
  cursor: pointer;
  margin-top: 1.5rem;
  border: none;
}
.back-button:hover {
  background-color: var(--theme-ui-colors-grey);
}

.no-results {
  text-align: center;
  padding: 1em;
  font-weight: 500;
}

/* Results */
#resultsContainer {
  margin: auto;
  width: 60%;
  display: flex;
  flex-direction: column;
  gap: 2em;
  padding: 5em 0 2em 0;
}

#resultsContainer p {
  text-align: left;
  line-height: 2.2rem;
}

.sectionOne,
.sectionTwo {
  padding: 0 2em 1em 2em;
  border-radius: 20px;
  text-align: center;
}

.sectionOne {
  background-color: var(--theme-ui-colors-white);
  border: 2px solid var(--theme-ui-colors-secondary);
}

.sectionTwo {
  background-color: var(--theme-ui-colors-muted);
  border: 2px solid var(--theme-ui-colors-black);
}

.job-title,
.range,
.jobs {
  padding: 5px;
  margin: 5px;
  font-weight: 600;
}

.job-title,
.range {
  background-color: var(--theme-ui-colors-focus);
}

.salary,
.text {
  padding: 5px;
  margin: 5px;
  color: var(--theme-ui-colors-white);
}

.salary {
  background-color: var(--theme-ui-colors-main);
}

.text {
  background-color: var(--theme-ui-colors-secondary);
}

.jobs {
  background-color: var(--theme-ui-colors-secondary);
  color: var(--theme-ui-colors-white);
}

.dist-chart-container {
  text-align: left;
}

/* Charts Content */
.article-header {
  color: var(--theme-ui-colors-secondary);
  padding: 40px 0 10px 0;
}

.article-subhead {
  color: var(--theme-ui-colors-secondary);
  font-size: 2rem;
  padding-top: 2em;
}

.article-header,
.article-text,
.flourish-chart,
#skill-set {
  width: 60%;
  margin: auto;
  text-align: left;
}

#skill-set p {
  text-align: center;
}

.skills-grid p {
  margin: auto;
}

.indicator {
  width: 30px;
  animation: rotate 0.5s linear infinite;
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(15deg);
  }
}

.arrow {
  animation: bounce 2s infinite;
  width: 40px;
  margin: auto;
  padding-top: 1.5em;
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    -moz-transform: translateY(0);
    -ms-transform: translateY(0);
    -webkit-transform: translateY(0);
    transform: translateY(0);
  }

  40% {
    -moz-transform: translateY(-30px);
    -ms-transform: translateY(-30px);
    -webkit-transform: translateY(-30px);
    transform: translateY(-30px);
  }
  60% {
    -moz-transform: translateY(-15px);
    -ms-transform: translateY(-15px);
    -webkit-transform: translateY(-15px);
    transform: translateY(-15px);
  }
}

.credits {
  color: var(--theme-ui-colors-grey);
  font-size: 0.95rem;
}

/* Flourish  */
.flourish-chart {
  padding: 2em 0 2em 0;
}
.flourish-credit {
  display: none !important;
}
.flourish-chart em {
}
.flourish-chart .fl-scrolly-section .fl-scrolly-step {
  width: 60% !important;
  padding: 2em !important;
  font-weight: 400;
  color: var(--theme-ui-colors-light-grey);
  border-radius: 0.4em !important;
  background: rgba(255, 255, 255, 0.6) !important;
  backdrop-filter: blur(0.2em);
  -webkit-backdrop-filter: blur(0.2em);
  -webkit-box-shadow: 0 0 1em rgba(0, 0, 0, 0.08) !important;
  box-shadow: 0 0 1em rgba(0, 0, 0, 0.08) !important;
  border: 1px solid rgba(0, 0, 0, 0.3);
}
.flourish-embed iframe {
  width: 100% !important;
}

@media (min-width: 200px) and (max-width: 768px) {
  .flourish-chart .fl-scrolly-section .fl-scrolly-step {
    width: 80% !important;
    padding: 1.4em 1em 1.4em 1.4em !important;
  }
}

/* Poll */
.poll-avg {
  border: 2px solid var(--theme-ui-colors-main);
  border-radius: 12px;
  padding: 1em;
}

.tag {
  margin: 0;
}

.poll-text {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.poll-results {
  text-align: right;
  width: 180px;
}

#salaryComparison .title-wrap {
  width: 30%;
}

#nextStep .title-wrap {
  width: 50%;
}

.bar-results {
  display: flex;
  width: 50%;
  align-items: flex-start;
}

.poll-bar-wrapper {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  gap: 7px;
}

.poll-bar {
  height: 20px;
}

.poll-set .bar-chart span {
  font-size: 0.9rem;
}

.poll-set .bar-chart:first-of-type span {
  font-weight: 600;
}

.readers-poll {
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  background-color: rgba(0, 56, 102, 0.2);
  padding: 2em 0;
}

#salary-comparison {
  margin-top: 2em;
}

.quiz-set,
.answer {
  display: flex;
  flex-direction: column;
  max-width: 500px;
  width: 100%;
  background: var(--theme-ui-colors-white);
  border-radius: 12px;
  padding-bottom: 1em;
}

.quiz-set {
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
  width: 60%;
  padding: 1em;
}

#salaryComparison .quiz-set,
#nextStep .quiz-set {
  margin: 2em 0;
}

.answer {
  gap: 1em;
}

.answer button {
  background: var(--theme-ui-colors-white);
  border: 2px solid var(--theme-ui-colors-light-grey);
  border-radius: 5px;
  font-size: 1rem;
  text-align: left;
  padding: 10px;
}

.answer button:hover,
.answer button.selected {
  background-color: var(--theme-ui-colors-main);
  color: var(--theme-ui-colors-white);
  border: 2px solid var(--theme-ui-colors-main);
  cursor: pointer;
}

.answer button.disabled:hover {
  background: var(--theme-ui-colors-white);
  color: rgba(16, 16, 16, 0.3);
  border: 2px solid var(--theme-ui-colors-light-grey);
  cursor: not-allowed;
}

/* Nav */
.sticky-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #f2f2f2;
  padding: 10px;
  margin-bottom: 2em;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease-in-out;
  width: 100%;
}

.sticky-nav .nav-wrapper {
  display: flex;
  justify-content: center;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.sticky-nav .nav-wrapper::-webkit-scrollbar {
  display: none;
}

.sticky-nav .nav {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
  gap: 10px;
}

.sticky-nav .nav li a {
  display: block;
  padding: 1em;
  text-decoration: none;
  background: var(--theme-ui-colors-white);
  color: var(--theme-ui-colors-black);
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.2;
  border: 1px solid var(--theme-ui-colors-light-grey);
  border-radius: 7px;
  text-wrap: wrap;
}

.sticky-nav .nav li.active a {
  font-weight: bold;
  color: var(--theme-ui-colors-white);
  background-color: var(--theme-ui-colors-secondary);
  border: 1px solid var(--theme-ui-colors-secondary);
  border-radius: 7px;
}
/* .sticky-nav .nav li.active a,
.sticky-nav .nav li:hover a {
  font-weight: bold;
  color: var(--theme-ui-colors-white);
  background-color: var(--theme-ui-colors-secondary);
  border: 1px solid var(--theme-ui-colors-secondary);
  border-radius: 7px;
} */

.skills-container {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: #f9fafb;
  border-radius: 8px;
}

.skills-container h4 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.25rem;
  color: #111827;
}

.skills {
  border: 1px solid #ddd;
  padding: 1em;
  width: 70%;
  margin: 1em auto;
}

.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-tag-wrapper {
  position: relative;
  border-radius: 2em;
  padding: 8px 12px;
  font-size: 1rem;
  line-height: 1.2rem;
  cursor: default;
  transition: background-color 0.2s;
  background-color: var(--theme-ui-colors-highlight-bg);
}

.skill-tag-wrapper:hover {
  background-color: #ffc9d6;
}
/* 
.skill-tag .en {
  font-size: 0.875rem;
  line-height: 1rem;
} */

/* --- Tooltip Styles --- */
.tooltip {
  position: absolute;
  bottom: 125%; /* Position above the tag */
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--theme-ui-colors-secondary);
  color: var(--theme-ui-colors-white);
  padding: 10px 15px;
  border-radius: 6px;
  font-size: 0.85rem;
  width: max-content;
  max-width: 250px;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  pointer-events: none;
  z-index: 10;
}

.tooltip.js-align-left {
  left: 0;
  transform: translateX(0);
}

.tooltip.js-align-right {
  left: auto;
  right: 0;
  transform: translateX(0);
}

.tooltip.visible {
  opacity: 1;
  visibility: visible;
}

/* Tooltip Arrow */
.tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%); /* Center the arrow */
  border-width: 5px;
  border-style: solid;
  border-color: #1f2937 transparent transparent transparent;
}

/* Adjust arrow for left-aligned tooltip */
.tooltip.js-align-left::after {
  left: 25px; /* Position arrow near the left side */
  transform: translateX(0);
}

/* Adjust arrow for right-aligned tooltip */
.tooltip.js-align-right::after {
  left: auto; /* Unset the left property */
  right: 25px; /* Position arrow near the right side */
  transform: translateX(0);
}

.toggle-btn {
  height: 26px !important;
}

span.copy-link-icon:before,
span.copy-link-icon:after {
  height: 27px !important;
}

.publish {
  padding: 0;
}

.publish .date {
  margin: 0;
}

@media (min-width: 768px) and (max-width: 1200px) {
  #resultsContainer,
  .quiz-set,
  .article-header,
  .article-text,
  .flourish-chart,
  #skill-set {
    width: 85%;
  }

  button[type="submit"],
  #backButton {
    width: 50%;
  }
}

@media (max-width: 980px) {
  h1 {
    font-size: 2.2rem;
  }

  .hero-container {
    padding: 2em;
    gap: 2em;
  }

  .hero-content {
    width: 50%;
  }

  #userInfoForm {
    width: 50%;
  }
}

@media (max-width: 768px) {
  .hero-container {
    flex-direction: column;
  }

  .hero-content,
  #userInfoForm {
    width: 100%;
  }

  #results-wrapper {
    height: auto;
    background-image: none;
    /* overflow: hidden; */
  }

  .results-bg {
    width: auto;
    height: 100dvh;
    position: fixed;
    z-index: -1;
    opacity: 0.4;
  }

  .wrapper {
    background-color: var(--theme-ui-colors-white);
  }

  #resultsContainer,
  .quiz-set,
  .article-header,
  .article-text,
  .flourish-chart,
  #skill-set {
    width: 85%;
  }

  button[type="submit"],
  #backButton {
    width: 50%;
  }

  .skills-grid {
    justify-content: center;
  }

  .skill-tag-wrapper {
    width: 150px;
    border-radius: 1rem;
    font-size: 0.875rem;
  }

  form {
    padding-top: 2em;
  }
}

@media (max-width: 600px) {
  h1 {
    font-size: 1.8rem;
  }

  h4 {
    font-size: 1.3rem;
  }

  .hero-container {
    margin: 70px 20px;
    gap: 10px;
    padding: 30px;
  }

  #main-wrapper {
    height: auto;
  }

  .dropdown-content.show {
    overflow: hidden;
    overflow-y: scroll;
  }

  .article-subhead {
    font-size: 1.7rem;
  }

  .sticky-nav {
    top: 0.5em;
    will-change: transform;
    transform: translateZ(0);
  }

  .sticky-nav .nav-wrapper {
    width: 100%;
  }

  .sticky-nav .nav {
    flex-wrap: nowrap;
    gap: 5px;
  }

  .sticky-nav .nav li a {
    padding: 7px;
    font-size: 0.95rem;
  }

  #resultsContainer,
  .quiz-set,
  .article-header,
  .article-text,
  .flourish-chart,
  #skill-set {
    width: 90%;
  }

  #userInfoForm fieldset {
    margin: 0;
  }

  .sectionOne,
  .sectionTwo {
    padding: 10px;
  }

  button[type="submit"],
  #backButton {
    width: 80%;
  }

  .skills-grid {
    justify-content: center;
  }

  .poll-bar-wrapper {
    align-items: flex-start;
  }

  .flex-row {
    flex-direction: column !important;
  }

  .poll-results {
    width: 100%;
    text-align: left;
  }

  #nextStep .title-wrap,
  .bar-results {
    width: 100%;
  }

  .inside-label,
  .outside-label {
    text-align: right;
  }

  .skills {
    width: 90%;
  }

  .skill-tag-wrapper {
    width: 150px;
  }
}

@media (max-width: 480px) {
  .sticky-nav .nav {
    justify-content: flex-start;
  }

  #percentileChart g {
    transform: translate(10px, 40px);
  }
}

@media (max-width: 410px) {
  .skills {
    width: 100%;
  }
  .skill-tag-wrapper {
    width: 125px;
  }
}

@media (max-width: 320px) {
  .skills {
    width: 100%;
  }
  .skill-tag-wrapper {
    width: 115px;
  }
}
