/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  background-color: #FFFFFF;
  padding-top: 10px;
  line-height: 1.5;
}

ul li {
  color: #1144db;
  font-family: Arial, sans-serif;
  font-size: 20px;
  text-decoration: none;
}

ul li a {
  color: #1144db;
  font-family: Arial, sans-serif;
  font-size: 20px;
  text-decoration: none;
}

ul li a:hover {
  text-decoration: underline;
}

.centered-list {
  text-align: left;
  margin-left: 100px;
  list-style-position: inside;
  padding: 0;
}

/* Static Banner with Logo */
.static-banner {
  margin: 80px auto 0 auto;
  background-color: #1467db;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  padding: 15px 30px;
  font-family: Arial, sans-serif;
}

.static-banner .logo-text-container {
  margin: 10px auto 0 auto;
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: nowrap;
}

.static-banner img {
  height: 50px;
  margin-right: 0px;
}

.static-banner .banner-text {
  font-size: 40px;
  white-space: nowrap;
  font-weight: bold;
}

/* Top Scrolling Banner */
.banner {
  width: 100%;
  height: 100px;
  background: #ffffff;
  overflow: hidden;
  position: relative;
  border-bottom: 1px solid #FFFFFF;
}

.banner-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
}

.scrolling-track {
  width: 200%;
  height: 100px;
}

.scrolling-images {
  display: flex;
  align-items: center;
  height: 100px;
  animation: scroll-left 20s linear infinite;
}

.scrolling-images img {
  height: 60px;
  margin: 0 1.5rem;
  object-fit: contain;
  filter: brightness(1);
  transition: transform 0.3s;
}

.scrolling-images img:hover {
  transform: scale(1.1);
  filter: brightness(1.2);
}

@keyframes scroll-left {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-40%);
  }
}

/* Info Banner */
.info-banner {
  background: url('./images/Logo_en.6e39841b.png') left bottom no-repeat;
  background-size: 165px 100px;
  text-align: center;
  color: #4c74ef;
  font-size: 1.7em;
  position: center;
  width: 700px;
  min-height: 100px;
  margin: 0 auto;
  padding: 100px 5px 0 1px;
}

.info-banner h2 {
  margin: 0;
  font-size: 2rem;
  font-weight: 600;
}

/* Main Content */
.content {
  padding: 2rem;
  text-align: center;
}

/* Existing page tables */
.session-table,
.results-links {
  margin: 15px auto;
  border-collapse: collapse;
}

.session-table td,
.results-links td {
  padding: 8px 15px;
  border: 1px solid #ccc;
}

/* ============================================================
   RANKING SECTION
   ============================================================ */

.page-content {
  padding-bottom: 60px;
}

/* Main ranking area */
.ranking-section {
  width: 92%;
  max-width: 1000px;
  margin: 40px auto 60px auto;
  text-align: left;
}

/* Section title */
.ranking-section > h2 {
  text-align: center;
  color: #1467db;
  font-size: 30px;
  margin-bottom: 5px;
}

.ranking-description {
  text-align: center;
  color: #777;
  font-size: 16px;
  margin-bottom: 25px;
}

/* Database status */
.database-status {
  text-align: center;
  font-size: 13px;
  color: #777;
  margin-bottom: 18px;
}

.database-status.success {
  color: #16833b;
}

.database-status.error {
  color: #cc2222;
  font-weight: bold;
}

/* ============================================================
   CATEGORY SELECTOR
   ============================================================ */

.category-selector {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 0 auto 25px auto;
}

.category-selector label {
  font-weight: bold;
  color: #333;
  font-size: 16px;
}

.category-selector select {
  width: 320px;
  padding: 11px 14px;
  font-family: Arial, sans-serif;
  font-size: 16px;
  color: #333;
  background: #fff;
  border: 1px solid #bbb;
  border-radius: 6px;
  cursor: pointer;
}

.category-selector select:hover {
  border-color: #1467db;
}

.category-selector select:focus {
  outline: none;
  border-color: #1467db;
  box-shadow: 0 0 0 2px rgba(20, 103, 219, 0.12);
}

/* ============================================================
   RANKING TABLE
   ============================================================ */

.ranking-container {
  width: 100%;
  overflow-x: auto;
}

.ranking-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 7px;
  overflow: hidden;
  font-size: 17px;
}

/* Header */
.ranking-table th {
  background: #1467db;
  color: #fff;
  padding: 13px 15px;
  font-weight: bold;
  text-align: left;
  border: none;
}

.ranking-table th:first-child {
  width: 70px;
  text-align: center;
}

.ranking-table th:last-child {
  width: 150px;
  text-align: right;
}

/* Rows */
.ranking-table td {
  padding: 13px 15px;
  border-bottom: 1px solid #e5e5e5;
  background: #fff;
}

/* Alternating rows */
.ranking-table tbody tr:nth-child(even) td {
  background: #f8faff;
}

/* Remove border from final row */
.ranking-table tbody tr:last-child td {
  border-bottom: none;
}

/* Rank */
.ranking-table td:first-child {
  width: 70px;
  text-align: center;
  font-weight: bold;
  color: #555;
}

/* Points */
.ranking-table td:last-child {
  width: 150px;
  text-align: right;
  font-weight: bold;
  font-family: Arial, sans-serif;
  color: #1467db;
}

/* Hover */
.ranking-table tbody tr:hover td {
  background: #edf4ff;
}

/* ============================================================
   TEAM LINK
   ============================================================ */

.team-link {
  border: none;
  background: none;
  padding: 0;
  margin: 0;

  color: #1144db;
  font-family: Arial, sans-serif;
  font-size: 17px;
  font-weight: 600;

  cursor: pointer;
  text-align: left;
}

.team-link:hover {
  color: #0d50ad;
  text-decoration: underline;
}

/* ============================================================
   EMPTY MESSAGE
   ============================================================ */

.empty-message {
  background: #f8f8f8;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 30px 15px;
  text-align: center;
  color: #777;
  font-size: 16px;
}

/* ============================================================
   TEAM DETAILS
   ============================================================ */

.team-detail-container {
  width: 100%;
  margin-top: 10px;
}

/* Back button */
.back-button {
  border: 1px solid #1467db;
  background: #fff;
  color: #1467db;

  padding: 8px 14px;
  border-radius: 5px;

  font-family: Arial, sans-serif;
  font-size: 14px;
  font-weight: bold;

  cursor: pointer;
  margin-bottom: 20px;
}

.back-button:hover {
  background: #1467db;
  color: #fff;
}

/* Team name */
.team-detail-container h2 {
  text-align: left;
  color: #1467db;
  font-size: 30px;
  margin: 0 0 2px 0;
}

/* Category */
.team-category {
  color: #777;
  font-size: 15px;
  margin-bottom: 20px;
}

/* Team results */
.team-results-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 7px;
  overflow: hidden;
  font-size: 16px;
}

.team-results-table th {
  background: #1467db;
  color: #fff;
  padding: 12px 14px;
  font-weight: bold;
  text-align: left;
}

.team-results-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #e5e5e5;
}

.team-results-table tbody tr:nth-child(even) td {
  background: #f8faff;
}

.team-results-table tbody tr:last-child td {
  border-bottom: none;
}

.team-results-table tbody tr:hover td {
  background: #edf4ff;
}

/* Result column */
.team-results-table td:nth-child(2) {
  font-weight: bold;
  color: #1467db;
  white-space: nowrap;
}

/* ============================================================
   MOBILE
   ============================================================ */

@media (max-width: 768px) {

  .ranking-section {
    width: 96%;
    margin-top: 30px;
  }

  .ranking-section > h2 {
    font-size: 25px;
  }

  .ranking-description {
    font-size: 15px;
  }

  .category-selector {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .category-selector label {
    font-size: 15px;
  }

  .category-selector select {
    width: 100%;
    font-size: 16px;
  }

  .ranking-table {
    font-size: 15px;
  }

  .ranking-table th,
  .ranking-table td {
    padding: 11px 9px;
  }

  .ranking-table th:first-child,
  .ranking-table td:first-child {
    width: 50px;
  }

  .ranking-table th:last-child,
  .ranking-table td:last-child {
    width: 100px;
  }

  .team-link {
    font-size: 15px;
  }

  .team-detail-container h2 {
    font-size: 25px;
  }

  .team-results-table {
    font-size: 14px;
    min-width: 600px;
  }

  .team-results-table th,
  .team-results-table td {
    padding: 10px 8px;
  }

  #teamResultsContainer {
    overflow-x: auto;
  }
}