/* -------------------------------------------
Bench Overview
-------------------------------------------- */

/* General container */
.benchmark-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 7rem);
  text-align: center;
  font-family: Arial, sans-serif;
  background-color: #ffffff;
  width: 63%;
  margin: 0 auto;
  padding: 40px 0;
  padding-top: 8rem;
}

/* Title */
.benchmark-title {
  font-size: 3rem;
  font-weight: 500;
  color: var(--color-1);
  margin-bottom: 29px;
  margin-top: 34px;
}

/* Grid layout — 6 virtual columns so both rows centre symmetrically */
.benchmark-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  justify-items: center;
  justify-content: center;
  align-items: start;
  margin: 0 auto;
  padding-top: 17px;
  column-gap: 48px;
  row-gap: 40px;
}

/* Row 1: 3 cards each spanning 2 columns */
.benchmark-item:nth-child(1) { grid-column: 1 / 3; }
.benchmark-item:nth-child(2) { grid-column: 3 / 5; }
.benchmark-item:nth-child(3) { grid-column: 5 / 7; }

/* Row 2: 2 cards centred — columns 2-4 and 4-6 */
.benchmark-item:nth-child(4) { grid-column: 2 / 4; }
.benchmark-item:nth-child(5) { grid-column: 4 / 6; }

/* Individual item */
.benchmark-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  width: 100%;
}

/* Images */
.benchmark-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  margin: 0;
  border-radius: 8px;
  display: block;
}

/* Captions */
.benchmark-caption {
  font-weight: 500;
  font-size: 1.7rem;
  margin: 0px;
  color: var(--color-1);
}

/* Responsive */
@media (max-width: 768px) {
  .benchmark-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  /* Row 1: first 3 cards — items 1 & 2 get 2 cols each, item 3 centres */
  .benchmark-item:nth-child(1) { grid-column: 1 / 3; }
  .benchmark-item:nth-child(2) { grid-column: 3 / 5; }
  .benchmark-item:nth-child(3) { grid-column: 2 / 4; }
  /* Row 2: 2 cards centred */
  .benchmark-item:nth-child(4) { grid-column: 1 / 3; }
  .benchmark-item:nth-child(5) { grid-column: 3 / 5; }
}

@media (max-width: 480px) {
  .benchmark-grid {
    grid-template-columns: 1fr;
  }
  .benchmark-item:nth-child(1),
  .benchmark-item:nth-child(2),
  .benchmark-item:nth-child(3),
  .benchmark-item:nth-child(4),
  .benchmark-item:nth-child(5) {
    grid-column: auto;
    width: 100%;
    margin: 0;
    justify-self: center;
  }
}

/* -------------------------------------------
Bench mark detail section 
-------------------------------------------- */
.benchmark-leaderboard-text {
  font-weight: 500;
}

.benchmark-detail {
  margin-top: 10rem;
  position: relative;
}

@media screen and (max-width: 480px) {
  .benchmark-container {
    width: 95%;
    margin-top: 8rem;
  }
}

.benchmark-container-title {
  font-size: 23px;
  font-family: var(--font-1);
  margin-bottom: 5px;
  color: var(--color-1);
  font-weight: 700;
}

.benchmark-overview img {
  width: 100%;
  max-height: 300px;
  border-radius: 15px;
  object-fit: cover;
  margin-bottom: 20px;
}

.benchmark-detail p {
  margin: 10px 0;
  line-height: 1.9;
  text-align: justify;
}

.benchmark-detail a {
  color: blue;
  text-decoration: none;
}

.example-image-gallery img {
  width: 200px;
  margin: 10px;
  border-radius: 10px;
  transition: transform 0.3s ease-in-out;
}

.example-image-gallery img:hover {
  transform: scale(1.1);
}

/* Phase selection */
.benchmark-phase {
  margin-top: 12px;
}

.phase-container {
  position: relative;
  display: inline-block;
  width: 100%;
}

.phase-container::after {
  content: ""; /* remove the text arrow */
  position: absolute;
  right: 17px;
  top: 30%;
  transform: translateY(-50%);
  pointer-events: none;
  width: 10px; /* arrow width */
  height: 10px; /* arrow height */

  /* background SVG */
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10' fill='none'><path d='M1 3L5 7L9 3' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
}

.phase-dropdown {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  width: 100%;
  padding: 7px 40px 11px 10px;
  font-size: 16px;
  background-color: #e9e9e9;
  color: var(--color-1);
  border: 1px solid #555;
  border-radius: 10px;
  position: relative;
  cursor: pointer;
  height: 50px;
}

.phase-dropdown option {
  background-color: #e9e9e9;
  color: var(--color-1);
  border-radius: 10px;
}

.phase-dropdown:hover,
.phase-dropdown:focus {
  border-color: var(--color-2);
  background-color: #eeeaea;
  color: var(--color-1);
}

#phase-select,
select {
  outline: none;
  box-shadow: none !important;
  font-weight: 600;
}

/* Benchmark Access / Restricted Download */

.benchmark-access {
  margin-top: 24px;
}

.benchmark-access p {
  margin: 10px 0;
  line-height: 1.9;
  text-align: justify;
}

.benchmark-access a[href^="mailto:"],
.benchmark-access a.benchmark-access-link {
  color: var(--color-2);
  font-weight: 400;
}

.benchmark-access-faq {
  margin-top: 16px;
  padding-top: 10px;
}

.benchmark-access-faq p {
  margin: 8px 0;
}

@media (max-width: 480px) {
  .benchmark-access p {
    font-size: 0.95rem;
    line-height: 1.6;
  }
}

/* Leaderboard table */

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  color: #000000;
}

.table-wrapper {
  overflow-x: auto;
  max-height: 605px;
  overflow: auto;
  margin-bottom: 61px;
}

.table-wrapper table {
  width: 100%;
}

.leaderboard-table th,
td {
  padding: 4px;
  border: 1px solid #444;
  text-align: center;
}

.leaderboard-table th {
  background-color: var(--color-1);
  color: #ffffff;
  position: sticky;
  top: -1px;
  z-index: 2;
  cursor: pointer;
  font-size: medium;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.leaderboard-table th:hover {
  background-color: rgb(49, 80, 129);
}

.leaderboard-table tr:hover {
  background-color: #e3e3e3;
}

.benchmark-button {
  display: inline-block;
  padding: 5px;
  background: linear-gradient(135deg, rgb(85, 165, 86), rgb(0, 150, 130));
  color: #ffffff !important;
  border-radius: 5px;
  margin: 10px;
  transition: background-color 0.3s ease, transform 0.2s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.lb_sort_arrw {
  color: rgb(189, 187, 187) !important;
  margin-left: 2px;
}

/* -------------------------------------------
Sorting + Filter Toolbar
-------------------------------------------- */
#leaderboard-toolbar {
  display: none;
  justify-content: end;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

#filter-dropdown-container,
#sort-dropdown-container {
  position: relative;
  display: block; /* changed from none */
}

#filter-dropdown-btn,
#sort-dropdown-btn {
  /* background: linear-gradient(135deg, rgb(85, 165, 86), rgb(0, 150, 130)); */
  display: flex;
  justify-content: space-between; /* pushes text left, arrow right */
  align-items: center;
  background: #e9e9e9;
  color: #3d3b3b;
  font-size: 14px;
  border: none;
  cursor: pointer;
  border-radius: 10px;
  transition: background-color 0.3s ease;
  text-transform: capitalize !important;
  letter-spacing: 0 !important;
  height: 40px; /* adjusted from 5rem */
  margin: 0px;
  border: 0.2px solid #00000061;
  width: 300px;
  padding-left: 10px;
}

.filter-dropdown-btn-svg,
.sort-dropdown-btn-svg {
  padding-right: 8px;
  padding-left: 5px;
}

.column-filter-dropdown,
.column-sort-dropdown {
  position: absolute;
  top: 40px;
  display: none;
  max-height: 47vh;
  background-color: white;
  border: 1px solid #ccc;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  overflow: auto;
  padding: 10px;
  z-index: 3;
  border-radius: 4px;
  width: 100%;
}

#filter-dropdown-container.show .column-filter-dropdown,
#sort-dropdown-container.show .column-sort-dropdown {
  display: block;
  z-index: 100;
  background-color: #e9e9e9;
  border-radius: 10px;
  border: 0.5px solid #0000004f;
}

/* Custom small scrollbar only inside dropdown */
#filter-dropdown-container.show .column-filter-dropdown::-webkit-scrollbar,
#sort-dropdown-container.show .column-sort-dropdown::-webkit-scrollbar {
  width: 6px; /* thinner scrollbar */
}

#filter-dropdown-container.show
  .column-filter-dropdown::-webkit-scrollbar-track,
#sort-dropdown-container.show .column-sort-dropdown::-webkit-scrollbar-track {
  background: #dcdcdc; /* scrollbar track color */
  border-radius: 4px;
}

#filter-dropdown-container.show
  .column-filter-dropdown::-webkit-scrollbar-thumb,
#sort-dropdown-container.show .column-sort-dropdown::-webkit-scrollbar-thumb {
  background: #888; /* scrollbar thumb color */
  border-radius: 4px;
}

#filter-dropdown-container.show
  .column-filter-dropdown::-webkit-scrollbar-thumb:hover,
#sort-dropdown-container.show
  .column-sort-dropdown::-webkit-scrollbar-thumb:hover {
  background: #555; /* darker on hover */
}

.column-filter-container,
#column-sort-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  overflow-y: auto;
}

.column-filter-container label,
#column-sort-container label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #000;
  font-weight: 300;
  font-size: small;
  line-height: 0;
}

.colum-sort-div {
  padding-left: 5px;
  font-weight: 300;
  color: #000;
}

.colum-sort-div:hover {
  cursor: pointer;
  background: #dcdcdc;
}

.sort-arrow {
  color: var(--color-1);
  font-weight: 600;
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn 1s forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile screen adjustments */
@media screen and (max-width: 480px) {
  #filter-dropdown-btn,
  #sort-dropdown-btn {
    width: 100%;
  }
  .phase-container::after {
    top: 29% !important;
  }
  .phase-dropdown {
    padding: 10px 40px 11px 10px;
  }
}

/* --------------------------
  Mobile / Tablet overrides for Bench Overview
--------------------------- */

/* Tablet: up to 768px */
@media (max-width: 768px) {
  .benchmark-container {
    width: 90%;
    padding: 30px 12px;
    min-height: calc(100vh - 6.5rem);
    margin-top: 8rem;
  }

  .benchmark-title {
    font-size: 2rem;
    margin-bottom: 22px;
    margin-top: 22px;
  }

  .benchmark-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px;
    padding-top: 12px;
  }

  .benchmark-item {
    max-width: 220px;
    padding: 8px;
  }

  .benchmark-image {
    max-width: 100%;
    height: auto;
    max-height: 180px;
    border-radius: 10px;
  }

  .benchmark-caption {
    font-size: 1.4rem;
  }
  .benchmark-detail p {
    font-size: 1.8rem !important;
  }
}

/* Mobile phones: up to 480px */
@media (max-width: 480px) {
  .benchmark-container {
    width: 96%;
    padding: 18px 12px;
    min-height: auto;
    margin: 0 auto;
    justify-content: flex-start;
    margin-top: 8rem;
  }

  .benchmark-title {
    font-size: 2rem;
    margin-bottom: 16px;
    margin-top: 18px;
    line-height: 1.15;
  }

  .benchmark-grid {
    grid-template-columns: 1fr;
    gap: 18px;
    width: 100%;
    padding-top: 8px;
  }

  .benchmark-item {
    width: 100%;
    max-width: none;
    align-items: center;
    padding: 12px;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
    transition: transform 160ms ease, box-shadow 160ms ease;
  }

  .benchmark-item:active,
  .benchmark-item:focus {
    transform: translateY(1px);
  }

  .benchmark-image {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
    display: block;
  }

  .benchmark-caption {
    font-size: 1.8rem;
    margin-top: 10px;
    padding: 0 6px;
    text-align: center;
    font-weight: 600;
  }

  .benchmark-item {
    touch-action: manipulation;
  }
  .benchmark-item:focus-visible {
    outline: 3px solid rgba(0, 120, 210, 0.16);
  }

  #filter-dropdown-btn,
  #sort-dropdown-btn {
    width: 100%;
  }

  .benchmark-detail {
    margin-top: 6vh;
  }

  .benchmark-detail p {
    font-size: 1.4rem !important;
  }

  .table-wrapper {
    max-height: 45vh;
  }

  @media (max-height: 640px) {
    .benchmark-container {
      padding-top: 12px;
      padding-bottom: 12px;
      margin-top: 8rem;
    }
    .benchmark-title {
      margin-top: 12px;
    }
  }
}

/* ============================================================================
 * Reusable Annotation Slideshow
 * Use the  .slideshow  class on the container, then configure width/aspect-ratio
 * in the page-specific stylesheet.
 * ========================================================================== */
.slideshow {
  position: relative;
  overflow: hidden;
  background-color: #0000001a;
  border-radius: 6px;
}

.slideshow__layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: opacity 0.8s ease-in-out;
}

.slideshow__dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}

.slideshow__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: background 0.3s;
}

.slideshow__dot--active {
  background: rgba(255, 255, 255, 0.95);
}
