/* =========================================================
   BODY FILTER — PAGE-SPECIFIC LAYOUT ONLY
   (Layout + Buttons + Responsive Behaviour)
========================================================= */


/* =========================================================
   PAGE WRAPPER
========================================================= */

body.body-filter-page {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
}

#page-wrapper {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}


/* =========================================================
   MAIN GRID LAYOUT
========================================================= */

.content.body-filter-layout {
  display: grid;
  grid-template-columns: 170px minmax(600px, auto) 170px;
  gap: 40px;
  align-items: start;
  padding-top: 10px;
}

.centre-column {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.body-center {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
}

.image-section img {
  width: 600px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}


/* =========================================================
   BUTTON SECTIONS
========================================================= */

.button-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.button-background {
  width: 150px;
  height: 150px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  cursor: pointer;
  position: relative;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

/* Label */
.button-background::after {
  content: attr(title);
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 16px);
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 12px;
  padding: 4px 6px;
  line-height: 1.2;
  text-align: center;
  border-radius: 4px;
}

/* Active state */
.button-background.button-active {
  outline: 3px solid #003087;
  outline-offset: 2px;
  background-color: #ffffff;
  box-shadow: none;
}

.button-section.site-buttons .button-background.button-active {
  background-color: #e6f0ff;
}


/* =========================================================
   REGION + SITE BUTTON STACK (STANDARD VERTICAL LAYOUT)
   Replaces old staggered grid system
========================================================= */

.left-buttons-inner,
.right-buttons-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: none;
  margin: 0;
}

/* Remove any legacy grid placement */
.left-buttons-inner .button-background,
.right-buttons-inner .button-background {
  grid-column: auto;
}

/* =========================================================
   TRIAL RESULTS TABLE — RESPONSIVE ONLY
   (NO visual restyling — canonical table lives in indexStylesNEW)
========================================================= */

.trial-results-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Default: allow shrinking */
.trial-results-table {
  width: 100%;
}

/* Only enforce large width on desktop */
@media (min-width: 992px) {
  .trial-results-table {
    min-width: 900px;
  }
}

.trial-results-table td {
  white-space: normal;
  vertical-align: top;
  word-break: break-word;
  line-height: 1.4;
}


/* =========================================================
   BODYFILTER PAGINATION
========================================================= */

#bodyfilter-pagination.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 30px auto 20px;
  flex-wrap: wrap;
}

#bodyfilter-pagination .button-59 {
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  border: 2px solid #005eb8;
  background: #ffffff;
  color: #005eb8;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

#bodyfilter-pagination .button-59:hover {
  background: #005eb8;
  color: #ffffff;
}

#bodyfilter-pagination .button-59.active {
  background: #005eb8;
  color: #ffffff;
  cursor: default;
}

#bodyfilter-pagination .button-59:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}


/* =========================================================
   WRAPPER CARD
========================================================= */

.bodyfilter-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 60px auto;
}

.bodyfilter-card {
  padding: 50px 40px;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 2px solid var(--accent-border);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}


/* =========================================================
   RESPONSIVE
========================================================= */

@media (max-width: 900px) {

  .content.body-filter-layout {
    grid-template-columns: 1fr;
  }

  .button-background {
    width: 100px;
    height: 100px;
  }

  .image-section img {
    width: 100%;
  }
}

/* Centre column layout */
.centre-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;

    padding-top: 80px;
}

/* Instruction block */
#UserInstruction {
    text-align: center;
    max-width: 560px;
    margin: 0 auto;
}

/* Title */
#UserInstruction h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 18px;
}

/* Steps */
#UserInstruction p {
    font-size: 1.25rem;
    line-height: 1.7;
    margin: 8px 0;
}

.filter-feedback {
  background: #e6f2ff;
  border: 1px solid #b3d1ff;
  color: #003078;
  padding: 10px 15px;
  border-radius: 6px;
  font-weight: 500;
  margin-bottom: 15px;
  display: none;
}

.body-center {
  display: flex;
  gap: 30px;
  align-items: flex-start;
}

.body-center-left {
  flex: 1;
  text-align: center;
}

.body-center-right {
  flex: 1;
}

.body-center-img {
  max-width: 100%;
}

.body-center-img-bottom {
  margin-bottom: 15px;
}

.has-bg-image {
  background-image: var(--bg-image);
  background-size: cover;
  background-position: center;
}

.button-background.has-bg-image {
  background-image: var(--bg-image);
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}