/* styles.css */
html {
  font-family: 'Source Sans 3', 'sans-serif';
  background-color: #f1f1f1;
}

.intro-section {
  min-height: auto;
}

.featuredimg {
  width: min(100%, 520px);
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}

.policy-link {
  color: white;
}

.flex-container {
  display: flex;
  flex-direction: row;
  font-size: 30px;
  text-align: center;
  margin-top: 45px;
  margin-left: auto;
  margin-right: auto;
  max-width: 1200px;
  padding: 0 24px;
  gap: 24px;
}

.flex-item-left {
  padding: 20px;
  flex: 40%;
}

.flex-item-right {
  flex: 60%;
  color: black;
  font-size: 0.7em;
  text-align: left;
  line-height: normal;
  margin-top: 0px;
}

.flex-item-right h1 {
  font-size: 2em;
  font-weight: 800;
  color: #1d1745;
}

.flex-item-right p {
  font-size: 0.95em;
}

.app-download {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  border: 1px solid #ccc;
  border-radius: 15px;
  background-color: #1d1745;
  margin: 0px auto; /* centers it and adds vertical spacing */
  max-width: 1200px;
  padding-left: 24px;
  padding-right: 24px;
  flex-wrap: wrap; /* allows wrapping on small screens */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#cookieBanner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #707372;
  padding: 10px 5%; /* Add horizontal padding */
  text-align: center;
  box-sizing: border-box; /* Ensures padding is included in the width */
  overflow: hidden; /* Prevents content from overflowing */
  /* font-family: Arial, sans-serif; */
  font-size: 22px;
}

#cookieBanner p {
  margin: 0;
  color: white;
  padding: 0;
  word-wrap: break-word; /* Breaks words to prevent overflow */
}

@media (max-width: 800px) {
  .flex-container {
    flex-direction: column;
  }

  #age,
  #relationship,
  #living_setting,
  #province,
  #area,
  #care_giver_age,
  #cg_province,
  #cg_area {
    font-size: 1em;
  }
}

#header {
  min-height: 120px;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background-color: #FFFFFF;
  border-bottom: #204295 7px solid;
  box-shadow: 0 6px 8px rgba(0, 0, 0, 0.2);
}

.logo {
  height: clamp(84px, 12vw, 140px);   /* controls size */
  width: auto;     /* keeps aspect ratio */
  padding-left: 0;
  transform-origin: left center;
  object-fit: contain;
  display: flex;
  align-items: center;
}

body {
  font-family: 'Source Sans 3', sans-serif;
  font-size: 20px;
  line-height: normal;
  margin: 0;
  padding: 0;
}

.resource-group {
  color: #204295;
  text-decoration: underline;
}

@media (max-width: 1048px) {
  #header {
    flex-direction: row;
    text-align: left;
  }

  .logo {
    margin-right: 20px;
  }

  .flex-item-right h1 {
    font-size: 1.75em;
  }

  .flex-item-right p {
    font-size: 0.85em;
  }

  .featuredimg {
    width: 90%;
  }

  .flex-container {
    margin-top: 50px;
    padding: 0 20px;
  }
}

@media (max-width: 800px) {
  #header {
    flex-direction: row;
    text-align: left;
    min-height: 92px;
    padding: 10px 16px;
  }

  .logo {
    height: 72px;
    margin-right: 12px;
  }

  .flex-item-right {
    text-align: center;
    margin-left: 0px;
    padding-left: 0px;
  }

  .flex-item-right h1 {
    font-size: 1.5em;
    color: #1d1745;
  }

  .flex-item-right p {
    font-size: 0.8em;
  }

  .featuredimg {
    display: none;
  }

  .flex-container {
    margin-top: 30px;
    padding: 0 16px;
    gap: 12px;
  }

  .app-download {
    margin-top: 0px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .intro-section {
    height: auto;
    min-height: auto;
  }

  #beginBtn {
    margin: 0 auto;
    width: min(100%, 320px);
  }

  .survey-page {
    padding: 20px 12px 36px;
  }

  .survey-intro {
    margin: 0 8px 16px;
    padding: 18px 16px;
  }

  .survey-form {
    margin: 8px;
    padding: 18px 16px 22px;
  }
}

@media (max-width: 550px) {
  .app-download {
    margin: 0px 10px;
    gap: 1rem;
  }

  .app-text {
    min-width: 0;
  }

  .app-text h1 {
    font-size: 1.65em;
  }

  .app-buttons {
    width: 100%;
    justify-content: flex-start;
  }

  .app-buttons img {
    height: 42px;
  }
}

/* =========================SURVEY PAGE=================================== */
.survey-form {
  margin: 25px;
  padding: 5px 35px 25px 35px;
  background-color: #f1f1f1;
  border: 1px solid #cccccc37;
  border-radius: 10px;
  box-shadow: 0 1px 10px rgba(0, 0, 0, 0.203);
  color: #1d1745;
}

.survey-likert label {
  font-weight: 500;
}

#intro {
  padding: 5px 25px;
  margin: 25px;
  border-radius: 10px;
  background-color: #cccccc70;
  color: #a5a5a5;
  font-weight: 500;
  border: 2px solid #ccc;
}

#intro p {
  text-align: center;
  font-size: 20px;
}

.survey-form p {
  font-weight: 750;
}

/* ============================================================ */

/* text section */
.app-text {
  flex: 1 1 55%; /* let it take up about half */
  min-width: 250px;
  color: white;
}

.app-text h4 {
  margin: 0 0 0.3rem 0;
  color: #1D174F;
  font-weight: 600;
}

.app-text h1 {
  margin: 0 0 0.6rem 0;
  font-size: 2em;
  color: #1D174F;
}

.app-text p {
  margin: 0;
  line-height: 1.5;
  font-size: 1rem;
  color: #1D174F;
}

/* buttons */
.app-buttons {
  display: flex;
  flex-direction: row;
  gap: 12px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0; /* keeps them from squishing */
}

.app-buttons img {
  height: 48px;
  width: auto;
}

/* ==============================DEMOGRAPHICS PAGE============================== */

.demographics {
  font-family: 'Source Sans 3', sans-serif;
  margin-bottom: 0px;
}
/* ============================================================ */

#popupOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
}

#popupContent {
  background-color: #fff;
  margin: 20% auto;
  padding: 20px;
  border: 1px solid #ccc;
  border-radius: 5px;
  width: 80%;
  max-width: 400px;
  text-align: center;
}

#continueButton {
  background-color: #1D174F;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
}

#continueButton:hover {
  background-color: #030d49;
}

.chat-intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  box-sizing: border-box;
  background: rgba(29, 23, 79, 0.72);
  backdrop-filter: blur(8px);
}

.chat-intro-overlay.hidden {
  display: none;
}

.chat-intro-card {
  position: relative;
  width: min(100%, 760px);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border-radius: 28px;
  padding: 34px 34px 30px;
  box-sizing: border-box;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  border: 1px solid rgba(32, 66, 149, 0.16);
  box-shadow: 0 28px 72px rgba(10, 18, 48, 0.34);
}

.chat-intro-card h2 {
  margin: 0 0 12px 0;
  color: #1d174f;
  font-size: clamp(1.8rem, 3.4vw, 2.55rem);
  line-height: 1.05;
}

.chat-intro-card p {
  margin: 0;
  color: #24304f;
  line-height: 1.55;
}

.chat-intro-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
  margin-bottom: 50px;
}

.chat-intro-point {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100%;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(32, 66, 149, 0.12);
  background-color: #ffffff;
  box-shadow: 0 8px 18px rgba(25, 45, 84, 0.06);
}

.chat-intro-point:nth-child(1) {
  background-color: #dcedf9;
}

.chat-intro-point:nth-child(2) {
  background-color: #c6dada;
}

.chat-intro-point:nth-child(3) {
  background-color: #fbeccd;
}

.chat-intro-point-title {
  color: #1d174f;
  font-size: 18px;
  font-weight: 800;
}

.chat-intro-point-text {
  color: #24304f;
  font-size: 16px;
  line-height: 1.45;
}

.chat-intro-footnote {
  display: block;
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: 14px;
  background-color:linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
  color: #1d174f;
  font-size: 15px;
  line-height: 1.45;
}

.chat-intro-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.chat-intro-primary,
.chat-intro-secondary {
  border-radius: 999px;
  padding: 14px 20px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

.chat-intro-primary {
  border: 2px solid #1d174f;
  background-color: #1d174f;
  color: #ffffff;
}

.chat-intro-primary:hover {
  background-color: #204295;
  border-color: #204295;
}

.chat-intro-secondary {
  border: 2px solid #204295;
  background-color: #ffffff;
  color: #204295;
}

.chat-intro-secondary:hover {
  background-color: #eef2f7;
}

.hidden {
  display: none;
}

form {
  margin: 20px;
}

.language-switcher {
  margin: 0 0 0 auto;
  padding: 8px;
  background-color: #ffffff;
  border: 2px solid #d6d9e6;
  border-radius: 8px;
  color: #1D174F;
  display: flex;
  align-items: center;
  justify-content: center;
}

.language-switcher-options {
  display: inline-flex;
  gap: 6px;
  margin-top: 0;
}

.language-option {
  border: 2px solid #1D174F;
  border-radius: 6px;
  background-color: #ffffff;
  color: #1D174F;
  cursor: pointer;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  font-weight: 800;
  min-width: 44px;
  padding: 6px 10px;
}

.language-option.active {
  background-color: #1D174F;
  color: #ffffff;
}

@media (max-width: 640px) {
  #header {
    align-items: stretch;
  }

  .chat-intro-card {
    padding: 26px 22px 22px;
    border-radius: 24px;
  }

  .chat-intro-points {
    grid-template-columns: 1fr;
  }

  .chat-intro-actions {
    flex-direction: column;
    justify-content: stretch;
  }

  .chat-intro-primary,
  .chat-intro-secondary {
    width: 100%;
  }

  #header .language-switcher {
    margin-left: auto;
  }
}

/* ============================================================ */

fieldset {
  margin-bottom: 1.5rem; /* Use rem units for consistency */
  padding: 1.25rem;
  border: 2px solid #ccc;
  border-radius: 5px;
  background-color: #f9f9f9;
}

legend {
  font-size: 1.5rem; /* Larger legend text */
  font-weight: bold;
  margin-bottom: 0px;
  color: #1d1745;
}

label {
  display: block;
  margin-top: 1rem;
  font-weight: bold;
  color: #1d1745;
}

select {
  width: 100%; /* Make the dropdown take the full width of its container */
  padding: 0.5rem; /* Padding for better touch interaction */
  font-size: 1rem; /* Base font size */
  border-radius: 10px;
  border: #ccc 2px solid;
  margin-top: 0.5rem; /* Space above the dropdown */
  background-color: #fff;
  transition: background-color 0.3s, border-color 0.3s; /* Smooth transition for background and border */
}

select:focus {
  background-color: #e6e6e6; /* Highlight color on focus */
  border-color: #666; /* Change border color on focus */
  outline: none; /* Remove default outline */
}

select:active,
select option:checked {
  background-color: #d9d9d9; /* Change background color when selected */
}

input[type='radio'],
input[type='checkbox'] {
  margin-top: 0.5rem;
  width: auto;
  margin-right: 0.5rem;
}

div {
  margin-top: 0.5rem;
}

/* Remove hover effects for mobile devices */
@media (max-width: 767px) {
  select:hover {
    background-color: #fff; /* Remove hover background color */
    border-color: #ccc; /* Remove hover border color */
  }
}

@media (min-width: 768px) {
  fieldset {
    padding: 1.5rem;
  }

  legend {
    font-size: 1.75rem;
  }

  label {
    margin-top: 1.5rem;
  }

  select {
    font-size: 1.1rem; /* Slightly larger font size for tablets */
    padding: 0.6rem; /* More padding for tablets */
  }

  select:hover {
    background-color: #f0f0f0; /* Highlight color on hover */
    border-color: #999; /* Change border color on hover */
  }

  input[type='radio'],
  input[type='checkbox'] {
    margin-right: 0.75rem;
  }
}

@media (min-width: 1024px) {
  fieldset {
    padding: 2rem;
  }

  legend {
    font-size: 2rem;
  }

  label {
    margin-top: 2rem;
  }

  select {
    font-size: 1.2rem; /* Larger font size for desktops */
    padding: 0.75rem; /* More padding for desktops */
  }

  input[type='radio'],
  input[type='checkbox'] {
    margin-right: 1rem;
  }
}

/* ==================== Buttons including: Previous, Next, Submit Buttons  ====================*/

/* General button styles */
#showPreviousButton,
button[type='submit'] {
  background-color: #f1f1f1;
  color: #1D174F;
  padding: 5px 15px;
  border: 2px solid #1D174F;
  border-radius: 7px;
  font-size: 18px;
  font-family: 'Source Sans 3', 'sans-serif';
  font-weight: 750;
  cursor: pointer;
  transition: background-color 0.3s ease, font-size 0.3s ease, padding 0.3s ease;
  margin-top: 15px;
}

#showNextButton,
button[type='submit'] {
  background-color: #1D174F;
  color: white;
  padding: 5px 15px;
  border: none;
  border-radius: 7px;
  font-size: 18px;
  font-family: 'Source Sans 3', 'sans-serif';
  font-weight: 750;
  cursor: pointer;
  transition: background-color 0.3s ease, font-size 0.3s ease, padding 0.3s ease;
  margin-top: 15px;
}

#showPreviousButton:disabled,
#showNextButton:disabled,
button[type='submit']:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#showPreviousButton.hidden,
#showNextButton.hidden {
  display: none;
}

/* Hover effects for larger screens */
@media (min-width: 768px) {
  #showNextButton:hover,
  button[type='submit']:hover {
    background-color: #1d1745;
  }

  #showPreviousButton:hover,
  button[type='submit']:hover {
    background-color: rgba(99, 199, 215, 0.438);
  }
}

/* Focus effects and larger buttons for mobile devices */
@media (max-width: 767px) {
  #showPreviousButton:focus,
  #showNextButton:focus,
  button[type='submit']:focus {
    background-color: #1d1745;
  }

  /* Make buttons bigger for smaller screens */
  #showPreviousButton,
  #showNextButton,
  button[type='submit'] {
    font-size: 20px;
    padding: 12px 24px;
  }

  /* Remove hover effects for mobile devices */
  #showPreviousButton:hover,
  #showNextButton:hover,
  button[type='submit']:hover {
    background-color: #1D174F; /* Revert to default background color */
  }
}

@media (max-width: 480px) {
  #showPreviousButton,
  #showNextButton,
  button[type='submit'] {
    font-size: 22px;
    padding: 14px 28px;
  }
}

.radio-buttons {
  display: flex;
  gap: 20px; /* Space between radio buttons */
}

.radio-buttons label {
  font-family: 'Source Sans 3', 'sans-serif';
  font-weight: 500; /* Optional: Adjust label font weight */
  color: #1d1745;
}

.likert-scale {
  display: flex;
  justify-content: space-between;
}

.likert-scale label b {
  font-family: 'Source Sans 3', 'sans-serif';
  font-weight: 500; /* Optional: Adjust label font weight */
  color: #1d1745;
}

/* ==================== Footer ==================== */

footer {
  background-color: #204295;
  padding: 20px;
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  color: white;
}

.organization-name {
  font-weight: bold;
  font-size: 18px;
  margin-bottom: 10px;
}

.terms-info {
  font-size: 14px;
  color: white;
}

#terms-of-use {
  max-width: 800px; /* Set a maximum width for the container */
  margin: auto; /* Center the container */
}

.about-us {
  font-size: 14px;
  color: white;
}

.about-link {
  color: white;
}

.support-info {
  font-size: 16px;
  color: white;
}

/* ============================================================ */

#closing p {
  text-align: justify;
  line-height: 1.5;
  max-width: 600px;
}

/* ============================================================ */

.progress-container {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
}

.circle-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 5px; /* Adjust spacing between circles if needed */
}

.circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #204295;
  margin: 0 5px;
}

.circle-fill {
  /* background-color: #000; */
  background-color: #204295;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  margin: 0 5px;
}

.page-number {
  margin-top: 5px; /* Adjust spacing between circle and page number */
  font-size: 16px; /* Adjust font size as needed */
}

/* ============================================================ */

pre {
  /* font-family: 'Courier New', monospace; */
  font-size: 14px;
  white-space: pre-wrap; /* Allow the text to wrap */
  margin: 0; /* Remove default margin for <pre> */
}

/* ============================================================ */

#redirectToSurveyButton {
  background-color: #1D174F;
  font-family: 'Source Sans 3', 'sans-serif';
  color: white;
  padding: 12px 22px;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  margin: 4px 0 0;
  transition: background-color 0.3s ease, transform 0.2s ease;
  font-weight: 700;
}

#redirectToSurveyButton:hover {
  background-color: #030d49;
  transform: translateY(-1px);
}

#redirectToSurveyButton:focus-visible {
  outline: 3px solid #9fb7ff;
  outline-offset: 3px;
}

#surveyPrompt {
  margin: 0 0 16px;
}

.survey-callout {
  margin: 24px 0 32px;
  padding: 24px;
  border: 2px solid #204295;
  border-left-width: 8px;
  border-radius: 12px;
  background-color: #f3f6ff;
  box-shadow: 0 4px 12px rgba(25, 45, 84, 0.12);
}

.survey-callout h2 {
  margin: 0 0 8px;
  color: #1d1745;
}

/* ============================================================ */

#pdf-button {
  background-color: #1D174F;
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  font-size: 18px;
  cursor: pointer;
}

#pdf-button:hover {
  background-color: #030d49;
}

@media screen and (max-width: 426px) {
  #pdf-container {
    display: none;
  }
}

/* ============================================================ */

/* Layout */
/* Default: Single-column layout */
.input-grid {
  display: grid;
  grid-template-columns: 1fr;
  margin-bottom: 1.5rem;
  gap: 6px;
}

/* Multi-column layout (optional) */
.input-grid.multi-column {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  margin-bottom: 1.5rem;
  gap: 12px;
}

/* Completely hide the native checkbox */
.input-grid input[type='checkbox'] {
  display: none;
}

/* Tile styling */
.input-tile {
  display: block;
  border: 2px solid #ccc;
  border-radius: 8px;
  padding: 14px 16px;
  cursor: pointer;
  transition: 0.2s ease;
  background-color: #fff; /* changed from #f9f9f9 */
  text-align: left;
  /* font-family: sans-serif; */
  font-size: 16px;
  user-select: none;
  font-weight: 550;
}

.input-tile:hover {
  border-color: #888;
  background-color: #f1f1f1; /* lighter hover effect, but still white-ish */
}

input[type='checkbox']:checked + .input-tile {
  border-color: #204295;
  background-color: #2042956f; /* keeps the "selected" look */
  box-shadow: 0 0 0 1px rgba(0, 123, 255, 0.25);
}

/* Optional: Focus style for accessibility */
input[type='checkbox']:focus + .input-tile {
  outline: 2px solid #0056b3;
  outline-offset: 2px;
}

/* ============================================================ */

.begin-button {
  display: block;
  margin: 1.5rem 0 0 0;
  padding: 10px;
  font-size: 1.05rem;
  font-weight: 600;
  color: white;
  background-color: #204295;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  text-align: center;
  box-sizing: border-box;
  font-family: 'Source Sans 3', 'sans-serif';
}

.begin-button:hover {
  background-color: #1d1745; /*#030d49*/
}

/* ==========================RESULTS================================== */
.results-body {
  font-family: 'Source Sans 3', 'sans-serif';
  background-color: #f1f1f1;
  margin: 45px;
}

.results-body h1 {
  color: #1d1745;
}
/* Layout container that forces them side-by-side with the H1 */
.results-header-container {
  display: flex;
  align-items: center;  
  flex-wrap: wrap;      
  gap: 16px;            
  margin-bottom: 22px;  
}

.results-body h1 {
  margin: 0;
  display: inline-block;
}

.results-help-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0 24px 0;
  padding: 14px 24px;
  background-color: #009F99; /* Solid, flat brand teal */
  border-radius: 0 0 0px 0px;
  width: 100%;
  box-sizing: border-box;
  
  /* Visual Layering: A subtle dark overlay on the bottom edge, and a 
     crisp 3px dark blue top border that frames it beautifully against the header line */
  border-top: 3px solid #1D174F; 
  border-bottom: 2px solid rgba(0, 0, 0, 0.15);
}

.results-help-banner-text::before {
  /* content: "💬"; */
  margin-right: 12px;
  font-size: 1.4rem;
  vertical-align: middle;
  
  /* Turns the element into a layout block that can safely be flipped */
  display: inline-block; 
  
  /* Flips the speech bubble horizontally so the tail points right */
  transform: scaleX(-1); 
}

.results-help-banner-text {
  display: block;
  font-family: Arial, sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.5px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.results-help-link {
  font-family: Arial, sans-serif;
  font-weight: 900;
  color: #ffffff;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  
  /* Smoothly animates the text color and underline thickness change */
  transition: all 0.2s ease-in-out; 
  display: inline-block;
}

/* Interactive Hover States for the Text Link Only */
.results-help-link:hover {
  color: #1D174F; /* Flips the link text to the dark blue site theme color */
  text-decoration-thickness: 4px; /* Thickens the underline to make it pop and feel flashy */
  text-underline-offset: 2px;     /* Snaps the line closer to the text as it grows */
  transform: scale(1.05);          /* Gives the link a subtle physical lift */
}

/* Clean up on mobile viewports so large text doesn't overflow horizontally */
@media (max-width: 767px) {
  .results-help-banner-text {
    font-size: 1.05rem;
    white-space: normal;   /* Allows text to naturally wrap only on smaller phone screens */
    text-align: center;
  }
}

.results-help-link {
  color: #ffffff;
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 2px;
}

.results-help-link:hover {
  color: #f3fffe;
}

.results-help-link:focus-visible {
  outline: 3px solid #c6dada;
  outline-offset: 3px;
  border-radius: 4px;
}

.survey-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

.survey-intro {
  margin: 0 25px 20px;
  padding: 24px 28px;
  border-radius: 14px;
  background-color: #dcecf9;
  color: #1d1745;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.survey-intro h1 {
  margin: 0 0 10px;
  font-size: clamp(1.8rem, 3.8vw, 2.6rem);
}

.survey-intro p {
  margin: 0;
  line-height: 1.5;
  font-size: 1.05rem;
}

.survey-form h2 {
  margin: 0 0 1rem;
  color: #1d1745;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.survey-form textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0.75rem;
  border-radius: 10px;
  border: 2px solid #ccc;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  resize: vertical;
}

.survey-form textarea:focus {
  outline: none;
  border-color: #666;
  background-color: #fff;
}

.chat-launcher {
  position: fixed;
  right: 34px;
  bottom: 34px;
  z-index: 1000;
  background-color: #009F99;
  color: white;
  border: none;
  border-radius: 22px 22px 6px 22px;
  padding: 16px 22px 16px 18px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 150px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 159, 153, 0.28);
  text-align: left;
}

.chat-launcher::after {
  content: "";
  position: absolute;
  right: 16px;
  bottom: -8px;
  width: 18px;
  height: 18px;
  background-color: #009F99;
  clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.chat-launcher:hover {
  background-color: #1D174F;
}

.chat-launcher:hover::after {
  background-color: #1D174F;
}


.chat-launcher:focus-visible {
  outline: 3px solid #9fb7ff;
  outline-offset: 3px;
}

.chat-launcher-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background-color: #ffffff;
  color: #009F99;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.chat-launcher-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.chat-launcher-title {
  display: block;
  line-height: 1.15;
}

.chat-launcher-title {
  font-size: 18px;
  font-weight: 800;
}

.chatbot-dialog {
  position: fixed;
  display: flex;
  flex-direction: column;
  right: 24px;
  bottom: 92px;
  width: 100%;
  max-width: 900px;
  height: auto;
  min-height: 500px;
  max-height: calc(100vh - 120px);
  z-index: 1000;
  background-color: #ffffff;
  border: 2px solid #d7dce8;
  border-radius: 18px;
  padding: 30px; /* Balanced interior breathing room */
  box-shadow: 0 18px 44px rgba(25, 45, 84, 0.18);
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
}

.chatbot-dialog.hidden {
  display: none;
}

.chatbot-panel-header {
  margin-bottom: 16px;
}

.chatbot-dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.chatbot-panel-header h2 {
  color: #1d1745;
  margin: 0 0 8px 0;
}

.chatbot-panel-header p {
  margin: 0;
}

.chat-close-button {
  background-color: transparent;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #1d1745;
  padding: 8px 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.chat-messages {
  background-color: #f8faff;
  border: 1px solid #d7dce8;
  border-radius: 10px;
  min-height: 140px;
  flex: 1 1 auto; 
  overflow-y: auto;
  padding: 16px;
  /* Reduced this slightly since the chat-examples margin now handles the spacing buffer */
  margin-bottom: 8px;
}

.chat-message {
  max-width: 100%;
  box-sizing: border-box;
  
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  
  /* Forces long URLs/links to split and wrap cleanly to a new line */
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* Add a rule specifically for links generated inside messages */
.chat-message a {
  word-break: break-all;
  overflow-wrap: break-word;
}

.chat-message:last-child {
  margin-bottom: 0;
}

.chat-message p {
  margin: 0;
}

.chat-sources {
  margin-top: 12px;
}

.chat-sources summary {
  cursor: pointer;
  color: #204295;
  font-weight: 700;
}

.chat-sources ul {
  margin: 10px 0 0 18px;
  padding: 0;
}

.chat-sources li {
  margin-bottom: 6px;
}

.chat-sources a {
  color: #204295;
}

.chat-message-user {
  background-color: #dce6ff;
  margin-left: auto;
}

.chat-message-assistant {
  background-color: #eef2f7;
}

.chat-feedback-prompt {
  border: 2px solid #204295;
}

.chat-feedback-link {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 16px;
  border-radius: 8px;
  background-color: #1d1745;
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.chat-feedback-link:hover,
.chat-feedback-link:focus-visible {
  background-color: #204295;
  color: #ffffff;
}

.chat-feedback-link:focus-visible {
  outline: 3px solid #9fb7ff;
  outline-offset: 2px;
}

.chat-form {
  margin-top: auto; 
  flex-shrink: 0;
  width: 100%;
}

.chat-examples {
  margin-top: 16px;
  margin-bottom: 24px;
}

.chat-examples-title {
  margin: 0 0 10px 0;
  color: #1d1745;
  font-size: 17px;
  font-weight: 700;
}

.chat-example-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chat-example-button {
  background-color: #eef2f7;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #1d1745;
  cursor: pointer;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  line-height: 1.3;
  padding: 10px 14px;
  text-align: left;
}

.chat-example-button:hover {
  background-color: #e2e8f0;
  border-color: #94a3b8;
}

.chat-label {
  margin-top: 0;
}

.chat-input-row {
  display: flex;
  gap: 16px; /* Increases spacing between input text field and Ask button */
  align-items: flex-start;
  width: 100%; 
  box-sizing: border-box;
}

#chatInput {
  flex: 1;
  min-height: 88px;
  padding: 12px;
  border: 2px solid #cbd5e1;
  border-radius: 10px;
  resize: vertical;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 18px;
  box-sizing: border-box;
}

#chatInput:focus {
  outline: none;
  border-color: #204295;
}

#chatSendButton {
  background-color: #1d1745;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 14px 24px; /* Added padding to the sides of the button text */
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0; /* Prevents the ask button from compressing sideways */
}

#chatSendButton:disabled,
#chatInput:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.chat-status {
  margin: 10px 0 0 0;
  color: #4b5563;
  font-size: 18px;
}

.resource-item {
  border: #ccc 2px solid;
  padding: 25px;
  margin: 15px 0px;
  border-radius: 10px;
  transition: all 0.4s ease;
}

.resource-item h2 {
  color: #1d1745;
  margin-top: 0px;
  font-size: 1.15em;
}

.results p {
  font-weight: normal;
}

.resource-item p {
  font-weight: normal;
}

.resource-link {
  text-decoration: none; /* remove underline */
  color: inherit; /* keep same text color */
  display: block; /* make it act like a div */
}

.resource-link:hover .resource-item {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
  transition: 0.2s;
  background-color: #e7e7e7;
}

/* For the video */
/* For the video */
.video-section-container {
  margin: 20px auto;
  padding: 0 24px;
  width: 100%;
  max-width: 1325px; 
  text-align: left;
  box-sizing: border-box;
}

@media (max-width: 800px) {
  .video-section-container {
    padding: 0 16px;
    text-align: center;
  }
}

.video-section-title {
  color: #1d1745;
  font-size: 35px;
  font-weight: 700;
  margin-bottom: 20px;
}

/* Widescreen 16:9 Aspect Ratio Safety Box Container */
.video-iframe-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* Forces strict 16:9 height-to-width padding geometry */
  height: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(25, 45, 84, 0.12);
  border: 1px solid #d7dce8;
}

.video-iframe-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

@media (max-width: 767px) {
  .results-body {
    margin: 20px;
  }

  .chat-launcher {
    right: 16px;
    bottom: 16px;
    left: 16px;
    border-radius: 14px;
  }

  .chatbot-dialog {
    right: 16px;
    left: 16px;
    bottom: 84px;
    width: auto;
    padding: 18px;
    max-height: calc(100vh - 112px);
  }

  .chatbot-dialog-header {
    flex-direction: column;
  }

  .chat-input-row {
    flex-direction: column;
  }

  #chatSendButton {
    width: 100%;
  }

  /* Adjust video section for mobile */
  .video-section-container {
    margin: 24px auto;
  }
  .video-section-title {
    font-size: 20px;
  }
}

.thinking-text-label {
  font-size: 0.95rem;
  color: #555555;
  font-style: italic;
  display: inline-block;
  transition: opacity 0.3s ease-in-out;
}

/* Subtle pulse effect to show active computing without messy dots */
.static-thinking {
  animation: thinkingPulse 1.8s ease-in-out infinite;
}

@keyframes thinkingPulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

/* Create the infinite pulse effect scaling up slightly and adjusting opacity */
@keyframes subtle-pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(32, 66, 149, 0.4); /* Uses Baycrest's primary brand blue color */
  }
  60% {
    transform: scale(1.20);
    box-shadow: 0 0 0 14px rgba(32, 66, 149, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(32, 66, 149, 0);
  }
}

/* Apply the animation cleanly to the launcher button when visible */
.chat-launcher:not(.hidden) {
  animation: subtle-pulse 1.5s infinite ease-in-out;
}
