/* Base Variables */
:root {
  --primary-color: #0055A5;
  --primary-color-hsl: 285 90 30;
  --secondary-color: #ffffff;
  --secondary-color-hsl : 0 0 100;
  --text-color: #333333;
  --background-color: #f9f9f9;
  --font-sans: "Helvetica Neue", Arial, sans-serif;
  --radius: 6px;
  --spacing: 1rem;
}

/* Global Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  color: var(--text-color);
  background-color: var(--background-color);
  line-height: 1.6;
  padding: var(--spacing);
  padding-top:0;
}

/* Make header span edge-to-edge, counteracting container padding */
header.main-header {
  width: calc(100% + 2 * var(--spacing));
  margin-left: calc(-1 * var(--spacing));
  margin-right: calc(-1 * var(--spacing));
  position: sticky;
  top: 0;
  z-index: 1000;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  /*padding: var(--spacing);*/
}

h1, h2, h3 {
  color: hsl(var(--primary-color-hsl));
  margin-bottom: calc(var(--spacing) / 2);
}

p {
  margin-bottom: var(--spacing);
}

header{
    background-color:hsl(var(--primary-color-hsl));
    color: var(--secondary-color);
}

header a{
    color: var(--secondary-color); 
}

.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="text"]{
    font-size:1.25em;
}



/* Buttons */
button,
input[type="submit"] {
  background-color: hsl(var(--primary-color-hsl));
  color: var(--secondary-color);
  border: 1px solid hsl(var(--primary-color-hsl));
  padding: 0.75em 1.5em;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s ease;
  margin:0.5em 0;
}

button.secondary,
input[type="submit"].secondary{
    background-color: var(--background-color);
    color: hsl(var(--primary-color-hsl));
}

button:hover,
input[type="submit"]:hover {
  background-color:  hsl(from var(--primary-color-hsl) h s calc(l + 20%));
  color: hsl(var(--primary-color-hsl));
}

button.secondary:hover,
input[type="submit"].secondary:hover{
    background-color: var(--background-color);
    color: hsl(var(--primary-color-hsl));
}

/* Question Block */
.question-block {
  background-color: var(--secondary-color);
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
  padding: var(--spacing);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  margin-bottom: var(--spacing);
}

.question-block button{
    width:46%;
    margin:0 2%;
}

@media only screen and (max-width: 600px) {
    .question-block button{
        width:100%;
        margin:2% 0;
    }
}

.story,
.story-only {
  font-style: italic;
  margin-bottom: var(--spacing);
}

.prompt {
  font-weight: bold;
  margin-bottom: var(--spacing);
}

.option {
  margin-bottom: 0.5rem;
}

.option label {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.option input[type="radio"] {
  margin-right: 0.5rem;
}

.hint {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: var(--spacing);
  display:none;
}

/* Form Layout */
form {
  margin-top: var(--spacing);
}

/* Grid Display (Word Search) */
.grid {
  display: block;
  line-height: 1.4;
  font-family: monospace;
  font-weight:600;
  text-align: center;
  font-size:2em;
  white-space: pre;
  letter-spacing:.5em;
  font-style: normal;
  margin-bottom: var(--spacing);
}

/* Show Debug info */
.debug{
    display:none;
}

body.debug_on .debug{
    display:block;
}

.debug .notes-field,
.debug .info{
    width:46%;
    padding:2%;
    display:inline-block
}

@media only screen and (max-width: 600px) {
    .debug .notes-field,
    .debug .info{
        width:100%;
        padding:0;
        display:block
    }

}

.debug .notes-field textarea{
    width:100%;
    height:100px;
}

/* Horizontal layout for SVG answer options */
.options-container {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing);
  margin-bottom: var(--spacing);
}

.options-container .option {
  /* allow each option to grow but maintain a minimum width */
  flex: 1 1 120px;
  text-align: center;
  white-space: nowrap; /* prevent multi-word options from wrapping */
  padding: 0.5em;      /* add some inner spacing */
}

/* Text-only options: full-width and normal wrapping */
.options-container .option:not(:has(svg)) {
  flex: 1 1 100%;
}
.options-container .option:not(:has(svg)) label {
  white-space: normal; /* allow multi-word options to wrap naturally */
}

/* For text-based options (outside of options-container), keep vertical flow */
.options-container:not(:has(svg)) {
  display: block;
}

.nav-left img {
  max-height: 40px;
}

.nav-center .answered {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--secondary-color);
}

.nav-right .user-dropdown {
  position: relative;
  display: inline-block;
}

.nav-right .dropbtn {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  background-color: transparent;
  border: none;
  color: var(--secondary-color);
  font-size: 1rem;
  cursor: pointer;
}

.nav-right .dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: var(--secondary-color);
  min-width: 150px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 10;
  border-radius: var(--radius);
}

.nav-right .dropdown-content a {
  color: #333;
  padding: 0.5em 1em;
  text-decoration: none;
  display: block;
}

.nav-right .dropdown-content a:hover {
  background-color: #f1f1f1;
}

.nav-right .user-dropdown:hover .dropdown-content {
  display: block;
}
/* Also show dropdown when .open class is toggled via JavaScript */
.nav-right .user-dropdown.open .dropdown-content {
  display: block;
}

/* Header progress bar styling */
.progress-wrapper {
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
  text-align: center;
}
.progress-bar {
  position: relative;
  background: #ffffff15;
  height: 20px;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 0.5rem;
  border:1px solid #ffffff60;
}
.progress-fill {
  background: var(--secondary-color);
  height: 100%;
  transition: width 0.3s ease;
}
.progress-marker {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 28px;
  background: rgba(0,0,0,0.3);
  z-index: 1;
}
.progress-marker.marker-50 { left: 50%; }
.progress-marker.marker-75 { left: 75%; }
.progress-text {
  font-size: 0.75em;
  color: var(--secondary-color);
  opacity: .75;
}

/* Header layout: logo and user on top row, progress bar below */
.main-header .nav-container {
  display: flex;
  flex-direction: column;
  padding: var(--spacing);

}
.main-header .nav-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
    position:relative;
  z-index: 1000;
}
.main-header .nav-center {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: -40px;
}

@media only screen and (max-width: 600px) {
    .main-header .nav-center {
         margin-top: var(--spacing);
    }
}

/* Progress info popup: hidden by default, shown when .open */
.progress-info-box {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 1000;
  max-width: 300px;
  text-align: center;
  margin-top: 0.5rem;
  width: 80%;
}
.progress-info-box.open {
  display: block;
}
/* Anchor progress-info to nav-center */
.nav-center {
  position: relative;
}

/* Skip button with info icon */
.skip-container {
  display: inline-flex;
  align-items: center;
  position: relative;
  gap: 0.5rem;
  width: 46%;
  margin: 0 2%;
}

.skip-container .secondary {
  flex: 1 1 auto;
}

.skip-container .info-icon {
    flex: 0 0 auto;
    cursor: pointer;
    font-style: normal;
    line-height: 1;
    font-size:1.5em;
}

.skip-container .info-box {
  display: none;
  position: absolute;
  background: #fff;
  color: #333;
  border: 1px solid #ccc;
  padding: 0.5rem;
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  z-index: 1000;
  max-width: 200px;
  text-align: center;
}
.skip-container .info-box.open {
  display: block;
}

/* Desktop: info-box to the right of skip button */
@media (min-width: 601px) {
  .skip-container .info-box {
    top: 0;
    left: 100%;
    margin-left: 0.5rem;
    transform: none;
  }
}

/* Mobile: skip button fills available width, icon beside it; info-box centered in viewport */
@media (max-width: 600px) {
  .skip-container {
    display: flex;
    width: 100%;
  }
  .skip-container .secondary {
    flex: 1 1 auto;
  }
  .skip-container .info-icon {
    flex: 0 0 auto;
  }
  .skip-container .info-box {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: auto;
    max-width: 90%;
    margin: 0;
  }
}



/* SPECIFIC QUESTION FORMATTING */

.type-sequence .option svg{
  border: 1px solid #555;
}