/*
 * CSS for jsPsych experiments.
 *
 * This stylesheet provides minimal styling to make jsPsych
 * experiments look polished without any additional styles.
 */

@import url(https://fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,400,700);

/* Container holding jsPsych content */

.jspsych-display-element {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.jspsych-display-element:focus {
  outline: none;
}

.jspsych-content-wrapper {
  display: flex;
  margin: auto;
  flex: 1 1 100%;
  width: 100%;
}

.jspsych-content {
  max-width: 95%; /* this is mainly an IE 10-11 fix */
  text-align: center;
  margin: auto; /* this is for overflowing content */
  align-items: center; /* Forces all children (img, p, divs) to center */
}

.jspsych-top {
  align-items: flex-start;
}

.jspsych-middle {
  align-items: center;
}

/* fonts and type */

.jspsych-display-element {
  font-family: "Open Sans", "Arial", sans-serif;
  font-size: 18px;
  line-height: 1.6em;
}

/* Form elements like input fields and buttons */

.jspsych-display-element input[type="text"] {
  font-family: "Open Sans", "Arial", sans-serif;
  font-size: 14px;
}

/* borrowing Bootstrap style for btn elements, but combining styles a bit */
.jspsych-btn {
  display: inline-block;
  padding: 6px 12px;
  margin: 0px;
  font-size: 14px;
  font-weight: 400;
  font-family: "Open Sans", "Arial", sans-serif;
  cursor: pointer;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  background-image: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #333;
  background-color: #fff;
  border-color: #ccc;
  height: 100%;
  /*width: 100%;*/
  width: fit-content;
  object-fit: contain;
}

/* only apply the hover style on devices with a mouse/pointer that can hover - issue #977 */
@media (hover: hover) {
  .jspsych-btn:hover {
    background-color: #ddd;
    border-color: #aaa;
  }
}

.jspsych-btn:active {
  background-color: #ddd;
  border-color: #000000;
}

.jspsych-btn:disabled {
  background-color: #eee;
  color: #aaa;
  border-color: #ccc;
  cursor: not-allowed;
}

/* custom style for input[type="range] (slider) to improve alignment between positions and labels */

.jspsych-slider {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  background: transparent;
}
.jspsych-slider:focus {
  outline: none;
}
/* track */
.jspsych-slider::-webkit-slider-runnable-track {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  cursor: pointer;
  background: #eee;
  box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;
  border-radius: 2px;
  border: 1px solid #aaa;
}
.jspsych-slider::-moz-range-track {
  appearance: none;
  width: 100%;
  height: 8px;
  cursor: pointer;
  background: #eee;
  box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;
  border-radius: 2px;
  border: 1px solid #aaa;
}
.jspsych-slider::-ms-track {
  appearance: none;
  width: 99%;
  height: 14px;
  cursor: pointer;
  background: #eee;
  box-shadow: 0px 0px 0px #000000, 0px 0px 0px #0d0d0d;
  border-radius: 2px;
  border: 1px solid #aaa;
}
/* thumb */
.jspsych-slider::-webkit-slider-thumb {
  border: 1px solid #666;
  height: 24px;
  width: 15px;
  border-radius: 5px;
  background: #ffffff;
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -9px;
}
.jspsych-slider::-moz-range-thumb {
  border: 1px solid #666;
  height: 24px;
  width: 15px;
  border-radius: 5px;
  background: #ffffff;
  cursor: pointer;
}
.jspsych-slider::-ms-thumb {
  border: 1px solid #666;
  height: 20px;
  width: 15px;
  border-radius: 5px;
  background: #ffffff;
  cursor: pointer;
  margin-top: -2px;
}

/* jsPsych progress bar */

#jspsych-progressbar-container {
  color: #555;
  border-bottom: 1px solid #dedede;
  background-color: #f9f9f9;
  margin-bottom: 1em;
  text-align: center;
  padding: 8px 0px;
  width: 100%;
  line-height: 1em;
}
#jspsych-progressbar-container span {
  font-size: 14px;
  padding-right: 14px;
}
#jspsych-progressbar-outer {
  background-color: #eee;
  width: 50%;
  margin: auto;
  height: 14px;
  display: inline-block;
  vertical-align: middle;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}
#jspsych-progressbar-inner {
  background-color: #aaa;
  width: 0%;
  height: 100%;
}

/* Control appearance of jsPsych.data.displayData() */
#jspsych-data-display {
  text-align: left;
}


/* JC additions */

/* Images */
.image {
  border:1px solid black;
  border-radius: 5px;
  cursor: pointer;
  transition: 0.3s;
  width: 20%;
  height: 25%;
}

.image:hover {
  opacity: 0.7;
  border:3px solid black;

}

.image:disabled {
  opacity: 0.4;
  border:1px solid grey;
  cursor:not-allowed;

}

.self{
    margin: 0em;
    font-weight: bold;
    font-size: 1.4em;
    line-height: 1.5em;
    /*border-bottom: 2px solid black;*/
    border-top-style: hidden;
    border-right-style: hidden;
    border-left-style: hidden;
    display: inline-block;
}

/* borrowing Bootstrap style for btn elements, but combining styles a bit */
.jspsych-btn-big {
  display: inline-block;
  padding: 6px 12px;
  margin: 0px;
  font-weight: bold;
  font-size: 1.4em;
  line-height: 1.5em;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  background-image: none;
  border: 1px solid transparent;
  border-radius: 4px;
  color: #333;
  background-color: #fff;
  border-color: #ccc;
}

.jspsych-btn-big:hover {
  background-color: #ddd;
  border-color: #aaa;
}

.jspsych-btn-big:disabled {
  background-color: #eee;
  color: #aaa;
  border-color: #ccc;
  cursor: not-allowed;
}

.centered {
  margin-top: 0;
  width: 80%;
  padding: 0px;
  margin-left:auto;
  margin-right: auto;
}

.column {
  float: left;
  width: 48%;
  padding: 5px;
  margin: auto;
}

.row {
  margin-top: 5%;
}

/* Clearfix (clear floats) */
.row::after {
  content: "";
  clear: both;
  display: table;
}

/* CSS for picture choice added by JC*/
.image {
  display: inline-block; 
  border:thin solid grey;
  border-radius: 5px;
  cursor: pointer;
  transition: 0.3s;
  margin: 15px;
  padding: 0;
  /* INCREASED SIZE: Changed from 25% to 35% */
  width: 35%; 
  height: 35%;
  
  /* Optional: Ensure they don't get too huge on small screens */
  max-width: 400px;
  max-height: 300px;
}

.image:hover {
/*  opacity: 0.7;*/
  border:3px solid black;

}

.image:disabled {
/*  opacity: 0.4;*/
  border:1px solid grey;
  cursor:not-allowed;

}

/* --- UPDATED WORD BUTTON STYLING --- */

.button-option {
    display: inline-block;
    /* Increased padding for larger click targets and better visual weight */
    padding: 4px 8px; 
    margin: 2px; /* Added consistent spacing around buttons */
    font-size: 16px; 
    font-weight: 600;
    cursor: pointer;
    line-height: 1.4;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    background-image: none;
    
    /* Modern Button Look */
    border: 2px solid #ccc; /* Grey border */
    border-radius: 8px; /* Softer rounded corners */
    color: #333333;
    background-color: #ffffff;
    
    /* Subtle shadow for depth */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
    transition: all 0.2s ease; /* Smooth hover/disabled transitions */
}

.button-option:hover {
    background-color: #f9f9f9;
    border-color: #999; /* Darker grey on hover */
    transform: translateY(-1px); /* Slight lift effect */
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.button-option:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.button-option:disabled {
    background-color: #f5f5f5;
    color: #aaa;
    border-color: #ddd;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    opacity: 0.7;
}

/* --- UPDATED BAG OF WORDS CONTAINER --- */
/* Makes the word bank wrap nicely and center the buttons */
.bag-of-words {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Centers buttons horizontally */
    align-items: center;
    position: static;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ccc; /* Softer border color */
    border-radius: 8px;
    background-color: #fafafa; /* Very light grey background to separate from page */
    /* MAKE IT TIGHT */
    width: fit-content; /* Shrinks to fit the buttons exactly */
    /* max-width: min(90vw, 700px); independent of parent width */
    max-width: 90%;     /* Prevents overflow on small screens */
    margin: 15px auto;  /* Centers the box */
}

/* Optional: Style the construction field to match the new button look */
.construction-field {
    height: 40px; /* Taller to accommodate larger text */
    font-weight: 700;
    font-size: 22px; /* Slightly larger text in the answer box */
    display: flex; /* Use flexbox for better alignment of words */
    justify-content: center;
    align-items: center;
    gap: 0px; /* Space between words in the sentence */
    margin-top: 1em;
    margin-bottom: 1em;
    line-height: 1.2em;
    /* FORCE WIDTH */
    width: 100%; /* Take up full width of parent */
}

.words {
    font-size: 22px;
    /* border-bottom: 2px solid #333; Clear underline for empty slots */
    display: inline-block;
    min-width: 30px; /* Ensure empty slots have some width */
    text-align: center;
   /* Precise spacing: 0 top/bottom, 8px left/right */
    margin: 0 5px; 
    
    /* Ensure no extra whitespace inside the span */
    padding: 0;
    line-height: 1.2;
}

#feedback-holder {
    visibility: hidden; /* Keeps it hidden initially */
    
    /* COLLAPSE THE SPACE */
    height: 0; 
    margin: 0; 
    padding: 0;
    overflow: hidden; /* Ensures nothing spills out */
    line-height: 0;
    
    /* Styling for when it IS visible */
    font-size: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
    clear: both;
}

/* EXPAND WHEN VISIBLE */
#feedback-holder[style*="visibility: visible"] {
    height: auto;
    margin-top: 15px;
    margin-bottom: 15px;
    line-height: 1.4;
    padding: 12px 24px;
    border-radius: 8px;
    display: inline-block;
}


.center {
  display: flex;
  justify-content: center;
  align-items: center;
  /* Remove restrictive widths */
  width: auto; 
  max-width: 100%; /* Allow it to use almost the full container width */
  /* height: 200px; */
  /*border: 3px solid green; */
}

/* Ensure the image itself doesn't have weird margins */
#jspysch-bag-of-word-stimulus {
    display: block; /* Removes inline spacing quirks */
    margin: 0 auto 5px auto; /* Top 0, Left/Right Auto (centers), Bottom 20px */
}

/* Ensure the prompt is also centered and matches the image width context */
.centered p {
    text-align: center;
    margin: 10px auto;
    width: 100%; /* Match the parent width so centering is consistent */
}

/* 2. Tighten the Prompt Top Margin */
.centered p, .prompt {
    text-align: center;
    margin: 5px auto 10px auto; /* Small top margin (5px), normal bottom (10px) */
    width: 100%;
    line-height: 1.4;
}


