/* =========================================
   OTC Survey Search (minimal overrides only)
   Scope: #SearchPageWrapper + #otc_survey_data_results
   ========================================= */

:where(#SearchPageWrapper, #otc_survey_data_results) * {
  box-sizing: border-box;
}

/* -----------------------------
   Search form layout (2 columns)
----------------------------- */
#SearchPageWrapper .form.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#SearchPageWrapper .form.col {
  width: calc(50% - 5px);
  margin: 0 0 20px 0 !important;
  padding: 0 5px;
}

#SearchPageWrapper .alignRight {
  text-align: right;
}

#SearchPageWrapper label.searchInput {
  display: block;
  width: 100%;
}

/* Prevent input overflow (legacy CSS used 150%) */
#SearchPageWrapper input[type="text"],
#SearchPageWrapper .text_field {
  width: 100%;
  max-width: 100%;
}

/* -----------------------------
   Primary search button
----------------------------- */
#SearchPageWrapper .searchBtn.button.btn {
  background-color: var(--ozarks-blue, #164578);
  border-radius: 5px;
  color: #ffffff;
  text-align: center;
  margin-top: 15px;
  margin-bottom: 20px;
  transition: background-color 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}

#SearchPageWrapper .searchBtn.button.btn:hover,
#SearchPageWrapper .searchBtn.button.btn:focus,
#SearchPageWrapper .searchBtn.button.btn:focus-visible {
  background-color: var(--silver, #c0c0c0);
  border-color: var(--ozarks-blue, #164578);
  color: #000000;
}

/* -----------------------------
   Search results table behavior
----------------------------- */
#SearchPageWrapper #result_table {
  width: 100%;
}

#SearchPageWrapper .result_row {
  cursor: pointer;
}

#SearchPageWrapper .result_row:hover {
  background-color: var(--silver, #c0c0c0);
}

#SearchPageWrapper .result_row:focus-visible {
  outline: 2px solid var(--ozarks-blue, #164578);
  outline-offset: -2px;
}

/* -----------------------------
   Survey view header + controls
----------------------------- */
#otc_survey_data_results #form_content {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 10px;
  align-items: center;
}

#otc_survey_data_results #instructor_link {
  color: #000;
  text-decoration: none;
  font-weight: 700;
  font-size: 2rem;
  line-height: 1.2;
}

#otc_survey_data_results #instructor_link .instructor_name {
  text-decoration: underline;
  color: var(--ozarks-blue, #164578);
}

/* Remove theme focus-visible outline on the whole link */
#otc_survey_data_results #instructor_link:focus,
#otc_survey_data_results #instructor_link:focus-visible {
  outline: none !important;
}

/* Keep an accessible focus indicator on the name text */
#otc_survey_data_results #instructor_link:focus-visible .instructor_name {
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
  box-shadow: 0 0 0 2px var(--ozarks-blue, #164578);
  border-radius: 3px;
}

#otc_survey_data_results #searchBtn {
  background-color: var(--ozarks-blue, #164578);
  color: #ffffff;
  width: 100%;
  min-width: 210px;
  max-width: 250px;
  margin: 0 auto;
  padding: 15px 0;
  border: 3px solid var(--ozarks-blue, #164578);
  font-weight: 700;
  transition: background-color 0.5s ease, color 0.5s ease;
}

#otc_survey_data_results #searchBtn:hover,
#otc_survey_data_results #searchBtn:focus,
#otc_survey_data_results #searchBtn:focus-visible {
  background-color: #ffffff;
  color: var(--ozarks-blue, #164578);
  outline: 2px solid var(--ozarks-blue, #164578);
  outline-offset: 2px;
}

/* -----------------------------
   Survey bars
----------------------------- */
#otc_survey_data_results .data_bar {
  position: relative;
  height: 40px;
  background-color: #ddd;
  overflow: hidden;
}

#otc_survey_data_results .background_bar {
  position: absolute;
  inset: 0;
  background-color: #ddd;
}

#otc_survey_data_results .yes_color_bar {
  position: absolute;
  inset: 0 auto 0 0;
  height: 100%;
  padding-left: 4px;
  color: #fff;
  background-color: #2c65a7;
  width: 0;
  animation: growBar 1s ease-in-out forwards;
}

@keyframes growBar {
  0% { width: 0; }
  100% { width: var(--yes-width); }
}

/* -----------------------------
   Responsive
----------------------------- */
@media (max-width: 654px) {
  #SearchPageWrapper .form.col {
    width: 100%;
  }
}

@media (max-width: 576px) {
  #otc_survey_data_results #instructor_link {
    grid-column: span 2;
    font-size: 1.8rem;
  }
}
