.page-title-container {
  display: block;
  width: 100%;
  cursor: pointer;
}

.page-title {
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  font-size: 2.2rem;
}

.page-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2.5%;
  height: 3px;
  width: 0;
  background-color: var(--color-secondary);
  transition: width 0.3s ease;
}

.tournament {
  width: 100%;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  gap: 50px;
  margin: 30px 0;
}

.tournament.container {
  padding: 0;
}

.tournament-detail {
  width: 60%;
  display: flex;
  flex-direction: column;
}

.tournament-players {
  width: 40%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tournament-detail img {
  width: 100%;
  margin-bottom: 10px;
  aspect-ratio: 16/9;
}

.accordion {
  margin-bottom: 20px;
}

.accordion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-color: #000000;
  border-bottom-width: 1px;
  border-bottom-style: solid;
  cursor: pointer;
  padding: 10px 0;
}
.accordion-header h3 {
  color: var(--color-primary);
}

.accordion-header .accordion-icon {
  transition: transform 0.3s ease-out;
}

.accordion-header.active .accordion-icon {
  transform: rotate(45deg);
}

.tournament-players__input {
  flex: 1;
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.tournament-players__input:focus {
  border: 1px solid #fff;
  box-shadow: 0 0 0 2px #ccc;
}

.tournament-players__button {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-main);
  color: #fff;
  border: 1px solid transparent;
  padding: 10px 16px;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.tournament-players__button .search-icon {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
  stroke: #fff;
}

.tournament-players__button:hover {
  background-color: #000;
}

/* Phần bảng hiển thị danh sách cơ thủ */
.tournament-players__table {
  width: 100%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  white-space: nowrap;
  overflow-x: auto;
  background-color: #fff;
  min-width: 200px;
  border-collapse: collapse;
}

/* Tiêu đề cột */
.tournament-players__table thead {
  background-color: var(--color-main, #1e88e5);
  color: #fff;
  text-align: left;
  overflow: auto;
}

.tournament-players__table th {
  padding: 12px 16px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 14px;
}

/* Hàng dữ liệu */
.tournament-players__table td {
  padding: 12px 16px;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  max-width: 200px;
}

/* Hiệu ứng hover */
.tournament-players__table tr:hover {
  background-color: #ccc;
  color: #000;
  transition: background-color 0.2s ease-in-out;
}

/* Căn giữa STT */
.tournament-players__table td:first-child,
.tournament-players__table th:first-child {
  text-align: center;
  width: 60px;
}

/* Căn lề hợp lý */
.tournament-players__table th:nth-child(2),
.tournament-players__table td:nth-child(2) {
  text-align: left;
}

.tournament-players__table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.tournament-players__table tbody tr:nth-child(even):hover,
.tournament-players__table tbody tr:nth-child(odd):hover {
  background-color: #ccc;
  color: #000;
  transition: background-color 0.2s ease-in-out;
}

/* Tiêu đề bảng */
.tournament-players__title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

.players-control {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.players-control .club-filter__controls {
  flex: 2;
}

/* Ô tìm kiếm */
.tournament-players__search {
  width: 100%;
  display: flex;
  flex: 8;
  justify-content: flex-end;
  padding: 20px 0;
}

@media (max-width: 920px) {
  .players-control {
    flex-direction: column;
    gap: 0;
    align-items: start;
  }

  .players-control .club-filter__controls {
    margin-bottom: 15px;
  }

  .tournament-players__search {
    flex: 1;
  }
}

.accordion-content {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  padding: 16px;
  background-color: #fff;
  border-top: 1px solid #ddd;
  transition: 0.2s ease-out, padding 0.2s ease-out;
}

.accordion-content.open {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

.accordion-item {
  flex: 1 1 180px;
  min-width: 180px;
}

.accordion-item__title {
  display: flex;
  gap: 5px;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
  color: #222;
  margin-bottom: 4px;
}

.accordion-item__text {
  font-size: 14px;
  color: #555;
  margin: 0;
  white-space: normal;
  overflow-wrap: break-word;
  overflow: hidden;
  text-overflow: ellipsis;
}

.additional-info-desc {
  flex: 1;
  min-width: 0;
}

.additional-info-desc p {
  align-items: center;
  white-space: normal;
  overflow-wrap: break-word;
  font-size: 1rem;
}

.additional-info-desc img {
  margin: 0;
  object-fit: contain;
  max-width: fit-content;
  max-height: fit-content;
  min-width: 1rem;
  min-height: 1rem;
}

.tournament-register__button {
  background-color: var(--color-main);
  color: #fff;
  border: 2px solid transparent;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 8px rgba(106, 73, 242, 0.4);
  cursor: pointer;
  transition: all 0.3s ease;
}
.tournament-register__button:disabled {
  background-color: #888;
  color: #fff;
  box-shadow: none;
  transition: none;
}

.tournament-register__button:disabled:hover {
  background-color: #888;
  color: #fff;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
  border-color: transparent;
}

.tournament-register__button:hover {
  background-color: #fff;
  box-shadow: 0 6px 12px rgba(106, 73, 242, 0.5);
  transform: translateY(-2px);
  border: 2px solid #5735e0;
  color: #5735e0;
}

.tournament-register__button:active {
  background-color: #4a2fc0;
  transform: translateY(0);
  box-shadow: 0 3px 6px rgba(106, 73, 242, 0.3);
}

.list-category {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 0;
  background-color: gray;
}

.list-category button {
  background-color: #cb001c;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.25s ease;
  height: auto; /* 👈 đảm bảo không kéo dài */
}

.list-category button:hover {
  background-color: #a80017;
  transform: translateY(-2px);
}

.tournament-players__row > tbody {
  max-height: 150px;
  overflow-y: scroll;
}
.table-scroll {
  max-height: 100%;
  overflow-y: auto;
  overflow-x: scroll;
  width: 100%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

@media (max-width: 767px) {
  .tournament {
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
  }

  .tournament-detail,
  .tournament-players {
    width: 100%;
  }

  /* add horizontal scroll */
  .list-category {
    padding: 10px;
    justify-content: flex-start;
    overflow-x: auto; /* add horizontal scroll */
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .list-category button {
    flex-shrink: 0;
  }

  .tournament-players__title {
    font-size: 1.25rem;
  }

  .tournament-players__search {
    justify-content: stretch;
  }

  .tournament-players__input {
    flex: 1;
    width: 100%;
  }

  .accordion-content {
    padding: 10px;
    gap: 15px;
  }

  .accordion-item__title {
    font-size: 13px;
  }

  .accordion-item__text {
    font-size: 13px;
  }

  .tournament-register {
    width: 100%;
    /* display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center; */
  }
  .tournament-register {
    flex: 1;
  }

  .tournament-register__button {
    width: 100%;
  }
}

/* ==========================
   FONT RESPONSIVE SYSTEM 
========================== */

/* ----- Desktop (≥1200px) ----- */
@media (min-width: 1200px) {
  html {
    font-size: 16px;
  }

  h1 {
    font-size: 2.5rem;
  }
  h2 {
    font-size: 2rem;
  }
  h3 {
    font-size: 1.5rem;
  }
  p,
  a,
  li,
  span,
  td,
  th {
    font-size: 1rem;
  }

  .tournament-players__title {
    font-size: 1.375rem;
  }

  .accordion-item__title,
  .accordion-item__text {
    font-size: 0.875rem;
  }

  .tournament-register__button,
  .list-category button {
    font-size: 1rem;
  }
}

/* ----- Tablet (768px–1199px) ----- */
@media (max-width: 1199px) and (min-width: 768px) {
  html {
    font-size: 15px;
  }

  h1 {
    font-size: 2.2rem;
  }
  h2 {
    font-size: 1.8rem;
  }
  h3 {
    font-size: 1.4rem;
  }
  p,
  a,
  li,
  span,
  td,
  th {
    font-size: 0.95rem;
  }

  .tournament-players__title {
    font-size: 1.25rem;
  }

  .accordion-item__title,
  .accordion-item__text {
    font-size: 0.875rem;
  }

  .tournament-register__button,
  .list-category button {
    font-size: 0.95rem;
  }
}

/* ----- Mobile (<768px) ----- */
@media (max-width: 767px) {
  html {
    font-size: 14px;
  }

  h1 {
    font-size: 1.8rem;
  }
  h2 {
    font-size: 1.4rem;
  }
  h3 {
    font-size: 1.2rem;
  }
  p,
  a,
  li,
  span,
  td,
  th {
    font-size: 0.9rem;
  }

  .tournament-players__title {
    font-size: 1.125rem;
  }

  .accordion-item__title,
  .accordion-item__text {
    font-size: 0.8125rem;
  }

  .tournament-register__button,
  .list-category button {
    font-size: 0.9rem;
  }

  /* .footer {
      font-size: 0.9rem;
    } */
}
