@import url("common.css");

/* General Styles */
.track_detection_section {
  padding: 40px 20px;
  padding-bottom: 5px;
  max-width: 1200px;
  margin: 0 auto;
  background-color: #ffffff;
  margin-bottom: 9px;
  text-align: justify;
}

.track_detection_title {
  font-size: 31px;
  color: var(--color-1);
  font-weight: 600 !important;
  margin-bottom: 0px !important;
}

/* Overview Section Layout */
.track_detection_intro_content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.track_detection_text {
  width: 40%;
  min-width: 250px;
  font-size: 22px;
  text-align: justify;
}

.track_detection_image {
  width: 55%;
  min-width: 300px;
}

.track_detection_image img {
  width: 100%;
  height: auto;
}

/* Annotation List */
.annotation_list_title {
  font-size: 23px;
  color: var(--color-1);
  font-weight: 550 !important;
  margin-bottom: 0px !important;
}
.track_detection_annotation_list {
  list-style-type: disc;
  padding-left: 20px;
  margin-bottom: 30px;
  text-align: justify;
}
.track_detection_annotation_list_li {
  margin-bottom: 10px;
}

/* Annotation Slideshow — sizing only; base styles live in common.css */
.td-slideshow {
  width: 85%;
  margin: 24px auto 0;
  aspect-ratio: 16 / 9;
}

@media screen and (max-width: 900px) {
  .td-slideshow {
    width: 100%;
  }
}

/* Dataset Sections */
.track_detection_dataset_title {
  font-size: 23px;
  color: var(--color-1);
  font-weight: 550 !important;
  margin-bottom: 0px !important;
}
.track_detection_subsection_title {
  font-size: 20px;
  color: var(--color-1);
  font-weight: 550 !important;
  margin-top: 20px;
  margin-bottom: 8px;
}
.track_detection_dataset_paragraph {
  margin: 0 auto;
  font-size: 21px;
}

/* Dataset download button */
.td-download-btn-wrapper {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.td-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 26px;
  background-color: transparent;
  color: rgb(0, 150, 130) !important;
  border: 2px solid rgb(0, 150, 130);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.td-download-btn:hover {
  background-color: rgb(0, 150, 130);
  color: #ffffff !important;
  transform: translateY(-2px);
}

/* Inline links matching the download button colour */
.track_detection_dataset_paragraph a,
.track_detection_annotation_list a,
.codabench-link-eval {
  color: rgb(0, 150, 130) !important;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.track_detection_dataset_paragraph a:hover,
.track_detection_annotation_list a:hover,
.codabench-link-eval:hover {
  opacity: 0.75;
}

/* Evaluation Sections */
.track_detection_evaluation_title {
  font-size: 23px;
  color: var(--color-1);
  font-weight: 550 !important;
  margin-bottom: 0px !important;
}
.track_detection_evaluation_paragraph {
  margin: 0 auto;
  font-size: 21px;
}

/* ------------------------------------------
  Mobile / Tablet
------------------------------------------- */

/* Tablet adjustments (≤768px) */
@media (max-width: 768px) {
  .track_detection_section {
    padding: 28px 16px;
    max-width: 960px;
  }

  .track_detection_title {
    font-size: 2.5rem;
    margin-top: 20px;
  }

  .track_detection_intro_content {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: center;
  }

  .track_detection_text {
    width: 100%;
    font-size: 1.125rem;
    min-width: 0;
  }

  .track_detection_image {
    width: 100%;
    min-width: 0;
    max-width: 640px;
  }

  .track_detection_image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
  }

  .annotation_list_title,
  .track_detection_dataset_title,
  .track_detection_evaluation_title {
    font-size: 2rem;
  }

  .track_detection_annotation_list_li,
  .track_detection_dataset_paragraph,
  .track_detection_evaluation_paragraph {
    font-size: 1.8rem;
  }

  /* Image grid: 2 columns on tablet */
  .track_detection_image_grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .track_detection_image_grid img {
    max-width: 100%;
  }

  /* Table wrapper constraints for tablets */
  .table-wrapper {
    max-height: 55vh;
  }
}

/* Mobile phones (≤480px) */
@media (max-width: 480px) {
  .track_detection_section {
    padding: 18px 12px;
    max-width: 100%;
    margin: 0 6px;
  }

  .track_detection_title {
    font-size: 2.1rem;
    margin-bottom: 8px;
    text-align: left;
    margin-top: 28px;
  }

  .track_detection_intro_content {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
  }

  .track_detection_text {
    width: 100%;
    font-size: 0.98rem;
    line-height: 1.45;
    text-align: left;
    padding-right: 4px;
  }

  .track_detection_image {
    width: 100%;
    min-width: 0;
  }

  .track_detection_image img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    display: block;
  }

  .annotation_list_title,
  .track_detection_dataset_title,
  .track_detection_evaluation_title {
    font-size: 1.6rem;
    text-align: left;
  }

  .track_detection_annotation_list {
    padding-left: 18px;
  }

  .track_detection_annotation_list_li {
    font-size: 1.4rem;
    margin-bottom: 10px;
    line-height: 1.9;
  }

  .track_detection_dataset_paragraph,
  .track_detection_evaluation_paragraph {
    font-size: 0.95rem;
    text-align: left;
    text-align: justify;
  }

  /* Image grid: single column stacked, full-width images */
  .track_detection_image_grid {
    grid-template-columns: 1fr;
    gap: 12px;
    margin-top: 10px;
  }

  .track_detection_image_grid img {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
  }

  /* Phase dropdown and toolbar responsive */
  #filter-dropdown-btn,
  #sort-dropdown-btn {
    width: 100%;
    box-sizing: border-box;
  }

  .phase-container {
    width: 100%;
  }

  /* Make leaderboards/table scrollable without breaking layout */
  .table-wrapper {
    overflow-x: auto;
    max-height: 45vh;
  }

  .leaderboard-table th,
  .leaderboard-table td {
    padding: 8px;
    font-size: 0.88rem;
  }

  /* Reduce vertical spacing to fit content on small screens */
  .track_detection_section {
    padding-bottom: 12px;
    margin-bottom: 6px;
  }

  /* Accessibility / touch targets */
  .track_detection_image img,
  .track_detection_image_grid img {
    -webkit-tap-highlight-color: transparent;
  }

  /* Small screens with limited height — reduce image grid height */
  @media (max-height: 640px) {
    .track_detection_image img,
    .track_detection_image_grid img {
      max-height: 260px;
      object-fit: cover;
    }
  }
}
