  /* General Styles */
  body {
    font-family: Arial, sans-serif;
    background-color: #121212;
    color: #fff;
    padding: 20px;
  }

  #search-container {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    justify-content: center;
  }

  #club-id {
    padding: 10px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #555;
    width: 200px;
  }
    #club-info {
    display: none; /* Hide the club info initially */
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-top: 20px;
    }

  #team-name {
    font-size: 2.5em;  /* Increase the size of the team name */
    font-weight: bold;
    margin-bottom: 10px;
  }

  #club-info p {
    font-size: 1.2em;
    margin: 8px 0;  /* Add spacing between each stat */
  }

  button {
    padding: 10px 15px;
    background-color: #333;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
  }

  button:hover {
    background-color: #444;
  }

  /* Grid for player cards and stats */
  .stats-container {
    display: flex; /* Changed from grid to flex */
    flex-wrap: nowrap; /* Ensure cards are in a single row without wrapping */
    gap: 20px; /* Gap between player cards */
    justify-content: flex-start; /* Align cards to the left */
    overflow-x: auto; /* Add horizontal scroll if necessary */
    max-width: 100%; /* Prevent grid from being constrained */
  }

  .player-card ul {
    list-style-type: none;
    padding: 0;
  }

  .player-card li {
    margin: 5px 0;
  }

.player-cards-container {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: flex-start;
}

.player-card {
  border: 1px solid #ccc;
  border-radius: 10px;
  margin: 10px 0;
  padding: 15px;
  background-color: #002136;
  transition: all 0.3s ease;
  cursor: pointer;
  max-width: 100%; /* or set fixed like 800px if preferred */
  width: 300px;
}

.player-summary ul, .player-details ul {
  list-style: none;
  padding-left: 0;
}

.player-details {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
  margin-top: 10px;
  padding: 0 !important;  /* <- Prevent any residual spacing */
  display: none;          /* <- Completely remove from flow when collapsed */
}

.player-entry {
  margin-top: 8px;
}

.stats-columns {
  display: flex;
  flex-wrap: wrap; /* Enables columns to wrap on smaller screens */
  gap: 1rem;
}

.column {
  flex: 1 1 200px; /* Allows shrinking and growing, with min width */
  min-width: 200px;
}

.stats-columns .column {
  flex: 1;
  list-style-type: none;
  padding-left: 0;
}

.stats-columns ul {
  list-style: none;
  padding: 0;
  flex: 1;
  min-width: 200px;
}

.player-details .stats-columns {
  display: flex;
  gap: 30px;
  justify-content: space-between;
  flex-wrap: wrap;
}

.player-details .column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.player-card.expanded {
  width: 600px;
}

.player-card.expanded .player-details {
  display: block;
  max-height: 700px;
  opacity: 1;
  margin-top: 10px;       /* <- Restore spacing when expanded */
  padding: 10px 15px;
}


.expand-toggle {
  margin-top: 10px;
  font-size: 0.9em;
  color: #007bff;
  cursor: pointer;
  text-align: right;
}

.player-name {
  font-size: 1.5rem;        /* Larger text */
  font-weight: bold;        /* Bold text */
  border-bottom: 2px solid #ccc; /* Line underneath */
  padding-bottom: 0.5rem;   /* Space between text and line */
  margin-bottom: 1rem;      /* Space below the line */
  text-align: center;       /* Optional: center align */
}

  .team-card {
    background-color: #2e2e3f;
    color: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.25);
    margin-bottom: 30px;
    text-align: center;
  }

  .team-card h7 {
    font-size: 1.5em;
    margin-bottom: 10px;
    border-bottom: 2px solid #888;
    padding-bottom: 5px;
  }

  .team-card ul {
    list-style-type: none;
    padding: 0;
    font-size: 1.1em;
  }

  .team-card li {
    margin: 6px 0;
  }

  #stats-container {
    display: flex;
    flex-direction: column; /* Stack player cards and recent matches vertically */
    gap: 20px;
  }

  .player-card, .opponent-card {
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 10px;
  }

  .recent-matches-container {
    margin-top: 20px;
  }
  /* Prevent focus jumping issues on mobile */
    select:focus {
    outline: none;
    scroll-margin-top: 0;
    position: relative;
    }

    /* Optional: Reduce size of the dropdown in mobile view for easier interaction */
    @media (max-width: 600px) {
    #matchType {
        font-size: 14px;
        padding: 10px;
    }
    }
    .recent-matches-container {
  margin-bottom: 20px;
}

.recent-matches-header h7 {
  text-align: center;
  margin-bottom: 10px;
}

.recent-matches-row {
  display: flex;
  overflow-x: auto;
  gap: 2rem;
  padding: 1rem 0;
  scroll-snap-type: x mandatory;
}

.recent-matches-row::-webkit-scrollbar {
  height: 8px;
}

.recent-matches-row::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.recent-matches-row > div {
  min-width: 250px;
  flex: 0 0 auto;
  scroll-snap-align: start;
  background: #f9f9f9;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Adjust match card dimensions */
.match-card {
  width: 300px; /* Set a fixed width for the cards */
  height: 150px; /* Reduce the height initially */
  border: 2px solid #fff; /* Add a white border */
  border-radius: 8px; /* Keep the rounded corners */
  padding: 10px;
  background-color: #1e1e2f;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  transition: background-color 0.3s ease, transform 0.3s ease, height 0.5s ease; /* Smooth transition */
  overflow: hidden; /* Prevent content overflow */
}

/* Add hover effect to slightly enlarge the card */
.match-card:hover {
  transform: scale(1.05); /* Slightly enlarge the card */
  transition: transform 0.2s ease-in-out;
}

.player-card:hover {
  transform: scale(1.05); /* Slightly enlarge the card on hover */
}

/* Make sure cards are consistent in size */
.recent-matches-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden; /* Prevent y-scrolling conflict */
  padding: 10px;
  scroll-snap-type: x mandatory;
  touch-action: pan-x; /* Allow vertical scrolling inside cards */
  -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
}



/* Expand the card when the 'expanded' class is added */
.match-card.expanded {
  height: auto; /* Make height auto when expanded */
  /* max-height: 90vh; Fit within viewport */
  overflow-y: auto; /* Enable scroll inside card */
  -webkit-overflow-scrolling: touch; /* Smooth on iOS */
  background-color: #e90000; /* Change background color when expanded */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* More prominent shadow */
  transition: background-color 0.3s ease, transform 0.3s ease, height 0.5s ease; /* Smooth transition */
}

/* Hidden match details by default */
.match-card .match-details {
  display: none;
  margin-top: 10px;
}

.match-card .player-details {
  transition: max-height 0.4s ease, opacity 0.4s ease;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0;
}

/* Show match details when expanded */
.match-card.expanded .match-details {
  display: block;
  padding-top: 10px;
}

.match-card.expanded .player-details {
  max-height: 800px; /* large enough for full content */
  opacity: 1;
  padding: 10px 15px; /* ensure content is visible */
}

/* Match result and other styles */
.match-result {
  font-size: 1.2em;
  font-weight: bold;
}

.match-title {
  font-size: 1.5em;
}

.match-score {
  font-size: 1.2em;
}

.match-time {
  font-size: 0.9em;
  color: gray;
}

/* Adjust colors for win/loss states */
.win {
  color: rgb(0, 216, 0);
  font-weight: bold;
}

.loss {
  color: rgb(255, 27, 27);
  font-weight: bold;
}

/* Darker colors for initial state */
.match-card.win {
  background-color: #003303; /* Dark green */
}

.match-card.loss {
  background-color: #630000; /* Dark red */
}

/* Brighter colors when expanded */
.match-card.expanded.win {
  background-color: #002402; /* Brighter green */
}

.match-card.expanded.loss {
  background-color: #330000; /* Brighter red */
}
.section-divider {
  margin: 2rem 0;
  border: none;
  border-top: 2px solid #ccc;
}