/* ==== Toggle Switch ==== */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  border-radius: 24px;
  transition: 0.4s;
}

.slider::before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.4s;
}

input:checked+.slider {
  background-color: #2196F3;
}

input:checked+.slider::before {
  transform: translateX(26px);
}


/* ==== Table Layout & Headers ==== */
.rankingTable {
  table-layout: fixed;
  width: 100%;
  border-collapse: collapse;
}

.rankingTable thead th {
  position: sticky;
  top: 0;
  background-color: #fef200;
  z-index: 2;
  padding: 2px;
  border: 1px solid #ccc;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rankingTable thead tr:first-child th {
  top: 0;
}

.rankingTable thead tr:nth-child(2) th {
  top: 30px;
}


/* ==== Column Widths ==== */
.rankingTable .stl_th_rank {
  width: 30px;
  text-align: left;
}

.rankingTable .stl_th_Name {
  width: 40%;
  text-align: left;
}

.rankingTable .stl_th_title {
  width: 30px;
  text-align: center;
  padding-right: 10px;
}

.rankingTable .stl_th_TWZ {
  width: 40px;
  text-align: center;
}

.rankingTable .stl_th_points {
  width: 30px;
  text-align: center;
}

.rankingTable .stl_th_pointsSoB {
  width: 40px;
  text-align: center;
}


/* ==== General Cells ==== */
.rankingTable td {
  padding: 2px;
  border: 1px solid #ccc;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rankingTable td>div {
  overflow: hidden;
}

.rankingTable .stl_link_name {
  text-decoration: none;
  color: #000;
  font-weight: bold;
}


/* ==== Filter/Search Row ==== */
.rankingTable .filter-cell {
  padding: 5px 0;
  background-color: #fef200;
}

.rankingTable .filter-container {
  display: flex;
  align-items: center;
}

.rankingTable .search-input {
  flex: 1;
  margin-right: 10px;
  padding: 5px;
  font-size: 1em;
}


/* ==== Rank Cell with Toggle Icon ==== */
.rankingTable .rank-cell {
  position: relative;
  cursor: pointer;
}

.rankingTable .rank-cell::before {
  content: "";
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%) rotate(0deg);
  border: 4px solid transparent;
  border-left-color: #333;
}

.rankingTable .rank-cell.open::before {
  transform: translateY(-50%) rotate(90deg);
}


/* ==== Detail Text and Toggle Behavior ==== */
.rankingTable .stl_tl_detail {
  display: block;
  font-size: 0.9em;
  font-style: italic;
  font-weight: normal;
  color: #444;
  max-height: 100px;
  overflow: hidden;
  opacity: 1;
  transition: opacity 0.3s ease, max-height 0.3s ease;
}

.rankingTable.hide-details .stl_tl_detail {
  opacity: 0;
  max-height: 0;
}


/* ==== Inline Opponent Rows ==== */
.rankingTable .inl_opp_row {
  background-color: white;
  color: teal;
  vertical-align: middle;
  padding: 2px 4px;
}

.rankingTable .stl_inl_opp_header1 {
  font-weight: bold;
  text-align: left;
  padding-left: 10px;
}

.rankingTable .stl_inl_opp_header2 {
  font-weight: bold;
  text-align: center;
  color: black;
}

.rankingTable .stl_inl_opp_link_name {
  text-decoration: none;
  text-align: left;
  color: teal;
  font-weight: bold;
}


/* ==== Inline Table Styling ==== */
.rankingTable.inline-opponent-table {
  border-collapse: collapse;
  margin-top: 4px;
}

.rankingTable.inline-opponent-table th,
.rankingTable.inline-opponent-table td {
  border: 1px solid #ccc;
  padding: 4px 6px;
  font-size: 0.9em;
}


/* ==== Nested Result Table Inside Cell ==== */
.rankingTable .merged_result_cell,
.rankingTable .inner_result_table {
  border-collapse: collapse;
  table-layout: fixed;
  color: black;
  border: none !important;
  border-spacing: 0;
  margin: 0;
  padding: 0;
}

.rankingTable .inner_color_cell {
  width: 15px;
  min-width: 15px;
  text-align: center;
  border: 1px solid #ccc !important;
}

.rankingTable .inner_result_cell {
  width: 100%;
  text-align: center;
  border: 1px solid #ccc !important;
}


/* ==== Prevent Column Expansion ==== */
.rankingTable th:not(.stl_th_Name),
.rankingTable td:not(.stl_th_Name) {
  flex-shrink: 0;
  flex-grow: 0;
}


/* ==== Responsive Adjustments ==== */
@media (min-width: 768px) {
  .rankingTable {
    display: table;
    width: auto;
    overflow-x: visible;
  }

  .rankingTable th,
  .rankingTable td {
    font-size: 16px;
  }
}