/* Scrollable Dropdown Menu */
#scrollable-dropdown-menu .tt-menu {
  max-height: 150px;
  overflow-y: scroll;
}

/* Filter Styles */
.btn-custom-filter {
  background-color: #ffffff;
}

.bs-select-all {
  display: none;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
  width: 9px;
}

::-webkit-scrollbar-track {
  -webkit-border-radius: 5px;
  border-radius: 5px;
  background: rgba(0,0,0,0.1);
}

::-webkit-scrollbar-thumb {
  -webkit-border-radius: 5px;
  border-radius: 5px;
  background: rgba(0,0,0,0.2);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.4);
}

::-webkit-scrollbar-thumb:window-inactive {
  background: rgba(0,0,0,0.05);
}

/* Anchor Links */
a.anchor {
  display: block;
  position: relative;
  top: -84px;
  visibility: hidden;
}

/* Tablesorter Styles */
.tablesorter .filtered {
  display: none;
}

.tablesorter .tablesorter-errorRow td {
  text-align: center;
  cursor: pointer;
  background-color: #e6bf99;
}

/* Loader Spinner */
.loaderspinner {
  position: relative;
  top: 0.5%;
  left: 43%;
  border: 16px solid #f3f3f3;
  border-radius: 50%;
  border-top: 16px solid #c5d1ed;
  width: 120px;
  height: 120px;
  -webkit-animation: spin 2s linear infinite;
  animation: spin 2s linear infinite;
}

@-webkit-keyframes spin {
  0% { -webkit-transform: rotate(0deg); }
  100% { -webkit-transform: rotate(360deg); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Performance List Container */
.performance-list {
  width: 100%;
  margin-bottom: 1rem;
  border: 1px solid #dee2e6;
  font-size: 0.875rem;
}

/* Header Styles */
.performance-list-header {
  background-color: #C5D1ED;
  margin: 0;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #dee2e6;
  padding: 0;
}

.performance-list-header > div,
.performance-list-row > div {
  padding: 0.25rem 0.5rem;
  border-right: 1px solid #dee2e6;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

/* Row Styles */
.performance-list-row {
  display: flex;
  align-items: stretch;
  margin: 0;
  border-bottom: 1px solid #dee2e6;
  transition: background-color 0.15s ease-in-out;
  content-visibility: auto;
  contain-intrinsic-size: auto auto; /* Typical row height */
}

.performance-list-row:hover {
  background-color: rgba(0, 0, 0, 0.03);
}

.performance-list-row:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Column width classes */
.col-place {
  width: 50px;
  min-width: 50px;
  flex: 0 0 50px;
  text-align: right;
  padding-right: 8px !important;
}

.col-narrow {
  width: 50px;
  min-width: 50px;
  flex: 0 0 50px;
  white-space: nowrap;
}

[data-label="Time"],
[data-label="Mark"],
[data-label="Points"],
[data-label="Conv"] {
  width: 70px;
  min-width: 70px;
  flex: 0 0 70px;
}

[data-label="Meet Date"] {
  width: 85px;
  min-width: 85px;
  flex: 0 0 85px;
}

[data-label="Wind"] {
  width: 40px;
  min-width: 40px;
  flex: 0 0 40px;
  padding-left: 4px;
  padding-right: 4px;
}

.col-athlete {
  width: 16.66%;
  min-width: 120px;
  flex: 0 0 16.66%;
}

.col-team {
  width: 16.66%;
  min-width: 100px;
  flex: 0 0 16.66%;
}

.col-athletes {
  width: 25%;
  min-width: 150px;
  flex: 0 0 25%;
}

.col-meet {
  width: 33.33%;
  min-width: 150px;
  flex: 0 0 33.33%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Extra columns adjustments */
.has-extra-columns .col-narrow {
  width: 45px;
  min-width: 45px;
  flex: 0 0 45px;
}

.has-extra-columns [data-label="Time"],
.has-extra-columns [data-label="Mark"],
.has-extra-columns [data-label="Points"],
.has-extra-columns [data-label="Conv"] {
  width: 70px;
  min-width: 70px;
  flex: 0 0 70px;
}

.has-extra-columns [data-label="Meet Date"] {
  width: 95px;
  min-width: 95px;
  flex: 0 0 95px;
}

.has-extra-columns .col-meet {
  width: 30%;
  flex: 0 0 30%;
}

/* Remove border from last column */
.performance-list-header > div:last-child,
.performance-list-row > div:last-child {
  border-right: none;
}

/* Quick Links */
.quick-links {
  font-size: 15px;
  padding-top: 5px;
}

.inline-list {
  list-style: none;
  padding-left: 0;
}

.inline-list li {
  display: inline-block;
  margin-right: 0.5rem;
  margin-left: 0.5rem;
}

/* Mobile Styles */
@media (max-width: 767.98px) {
  .performance-list {
    border: none;
  }

  .performance-list-header {
    display: flex !important;
    margin-bottom: 0.5rem;
    background-color: #C5D1ED;
  }

  .performance-list-header > div {
    padding: 0.15rem 0.25rem;
    font-size: 0.875rem;
    border-right: 1px solid #dee2e6;
    display: none !important;  /* Hide all by default */
  }

  /* Show essential headers for all events */
  .performance-list-header > [data-label="Place"],
  .performance-list-header > [data-label="Team"],
  .performance-list-header > [data-label="Time"],
  .performance-list-header > [data-label="Mark"],
  .performance-list-header > [data-label="Points"] {
    display: flex !important;
  }

  /* Show athlete header for individual events */
  .performance-list-header:not(.is-relay) > [data-label="Athlete"] {
    display: flex !important;
  }

  /* Show athletes header for relay events */
  .performance-list-header.is-relay > [data-label="Athletes"] {
    display: flex !important;
  }

  .performance-list-row {
    display: flex !important;
    padding: 0.15rem;
    border: none;
    border-bottom: 1px solid #dee2e6;
    margin: 0;
  }

  .performance-list-row > div {
    padding: 0.15rem 0.25rem;
    border-right: 1px solid #dee2e6;
  }

  .performance-list-row > div:last-child {
    border-right: none;
  }

  /* Hide non-essential columns */
  [data-label="Year"],
  [data-label="Meet"],
  [data-label="Meet Date"],
  [data-label="Wind"],
  [data-label="Conv"] {
    display: none !important;
  }

  /* Essential columns */
  [data-label="Place"] {
    display: flex !important;
    flex: 0 0 15px;
    justify-content: flex-end;
    padding-right: 2px;
  }

  [data-label="Team"] {
    display: flex !important;
    flex: 2.5;
  }

  [data-label="Athlete"] {
    display: flex !important;
    flex: 4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  [data-label="Athletes"] {
    display: flex !important;
    flex: 5;
    white-space: normal;
  }

  [data-label="Time"],
  [data-label="Mark"],
  [data-label="Points"] {
    display: flex !important;
    flex: 0 0 30px;
  }

  /* Special handling for relays */
  .is-relay [data-label="Athlete"] {
    display: none !important;
  }

  .is-relay [data-label="Team"] {
    flex: 1.5 !important;
    padding-left: 0.1rem !important;
    padding-right: 0.1rem !important;
  }

  .is-relay [data-label="Athletes"] {
    display: flex !important;
    flex: 6 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }
}

/* Medium device styles (tablets) */
@media (min-width: 768px) and (max-width: 991.98px) {
  /* Hide date and wind columns */
  [data-label="Meet Date"],
  [data-label="Wind"] {
    display: none !important;
  }

  /* Allow meet name to use available space but prevent overflow */
  .col-meet {
    min-width: 120px !important;
    flex: 1 1 auto !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    border-right: none !important;
  }

  /* Prevent relay athletes from extending past column */
  .is-relay .col-athletes {
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
  }

  /* Fix field events layout */
  .performance-list-header,
  .performance-list-row {
    display: flex !important;
    flex-wrap: nowrap !important;
  }

  .has-extra-columns .col-meet {
    flex: 1 1 auto !important;
  }
}

/* Ensure parent container uses containment for better performance */
.performance-list-body {
  contain: content;
} 
