/* ===========================================================
   Implicit Testing Platform - shared stylesheet
   Consolidates the inline styles used throughout the original
   experiment.js into reusable classes.
   =========================================================== */

:root {
  --color-green: rgb(32, 150, 11);
  --color-blue: rgb(105, 135, 236);
  --color-red: rgb(237, 80, 80);
  --color-yellow: rgb(236, 221, 57);
  --color-accent: rgba(62, 126, 245, 0.91);
  --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Two-button row for mobile jsPsych-html-button-response trials */
.jspsych-html-button-response-btngroup {
  display: flex !important;
  justify-content: center;
  gap: 5vw;
}

/* Generic full-height centered column, used for nearly every trial */
.screen-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 70vh;
  text-align: center;
}

/* Light grey "stimulus" card - used for category labels and images */
.stim-card {
  background: #ddd;
  border-radius: 12px;
  padding: 3vh 4vw;
  margin-bottom: 4vh;
  text-align: center;
}

.stim-card img {
  max-height: 40vh;
  object-fit: contain;
}

.stim-card__label {
  font-size: 1.5rem;
  color: #666;
  margin: 0 0 0.5rem 0;
}

.stim-card__value {
  font-size: 2rem;
  font-weight: 600;
  color: #222;
  margin: 0;
}

/* White attribute card */
.attr-card {
  background: #fff;
  border-radius: 12px;
  padding: 3vh 4vw;
  margin-bottom: 4vh;
  text-align: center;
  box-shadow: var(--card-shadow);
}

.attr-card__text {
  font-size: 2rem;
  font-weight: 700;
  color: #111;
  margin: 0;
}

.attr-card__text--mobile {
  font-size: 3.5rem;
}

/* Desktop two-choice row (Fits / Does not fit, key-mapped E/I) */
.choice-row {
  display: flex;
  justify-content: center;
  gap: 120px;
  font-size: 20px;
}

.choice-box {
  border-radius: 12px;
  padding: 15px 25px;
  width: 200px;
  text-align: center;
  box-shadow: var(--card-shadow);
}

.choice-box__key {
  font-weight: bold;
}

.choice-box--fits { background: var(--color-green); color: #fff; }
.choice-box--notfits { background: var(--color-blue); color: #fff; }

/* Generic colour variants, used by attention-check option boxes */
.choice-box--green { background: var(--color-green); color: #fff; }
.choice-box--blue { background: var(--color-blue); color: #fff; }
.choice-box--red { background: var(--color-red); color: #fff; }
.choice-box--yellow { background: var(--color-yellow); color: #222; }

.choice-box__value {
  font-size: 2rem;
  font-weight: bold;
}

/* Grid layout for 4-option attention checks */
.attn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 40px;
  justify-items: center;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
}

.attn-grid .choice-box {
  padding: 20px;
}

/* Mobile big buttons (used via button_html callbacks) */
.mobile-btn {
  font-size: clamp(2rem, 6vw, 6rem);
  font-weight: 600;
  padding: 3vh 2vw;
  border-radius: 2vw;
  border: none;
  color: #fff;
  width: 40vw;
  box-shadow: 0 0.5vw 1.5vw rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

.mobile-btn--wide {
  width: 80vw;
  max-width: 500px;
  font-size: clamp(1.5rem, 5vw, 3rem);
}

.mobile-btn--green { background-color: var(--color-green); }
.mobile-btn--blue { background-color: var(--color-blue); }
.mobile-btn--red { background-color: var(--color-red); }
.mobile-btn--yellow { background-color: var(--color-yellow); color: #222; }
.mobile-btn--accent { background-color: var(--color-accent); }

/* Multi-brand image grid (desktop) */
.brand-grid {
  display: grid;
  grid-template-columns: repeat(4, clamp(180px, 22vw, 240px));
  gap: clamp(20px, 3vw, 48px);
  margin-inline: auto;
  justify-content: center;
}

.brand-card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  width: clamp(180px, 22vw, 240px);
  text-align: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.brand-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.brand-card__name {
  font-size: 1rem;
  font-weight: 600;
  color: #333;
}

.brand-key {
  border-radius: 8px;
  padding: 8px 10px;
  font-weight: bold;
  font-family: "Courier New", monospace;
  font-size: 18px;
  color: #fff;
}

.brand-key--a { background: var(--color-green); }
.brand-key--s { background: var(--color-blue); }
.brand-key--k { background: var(--color-red); }
.brand-key--l { background: var(--color-yellow); color: #222; }

/* Mobile brand picker */
.brand-prompt {
  text-align: center;
  padding: 4vh 5vw;
}

.brand-prompt__label {
  font-size: 1.5rem;
  color: #999;
  margin: 0;
}

.brand-prompt__attr {
  font-size: 3.4rem;
  font-weight: 700;
  color: #111;
  margin-bottom: 4vh;
}

.brand-mobile-btn {
  background: #fff;
  border: none;
  width: 47%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  gap: 6px;
  cursor: pointer;
}

.brand-mobile-btn img {
  width: 100%;
  flex: 1;
  object-fit: contain;
  min-height: 0;
}

.brand-mobile-btn__name {
  font-size: clamp(0.7rem, 2.5vw, 0.9rem);
  font-weight: 600;
  color: #333;
}

/* Feedback / instruction text */
.feedback {
  font-size: 2rem;
  font-weight: 500;
  text-align: center;
}

.feedback--warn {
  font-size: 2rem;
  color: red;
}

.credit-line {
  color: #888;
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  margin-top: 5vh;
}
