/* Search and platform section */
.search-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.search-bar input {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  width: 250px;
  outline: none;
}

.search-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

#username {
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 2px solid transparent;
  width: 250px;
  font-size: 1rem;
  outline: none;
  transition: border 0.3s ease;
}

#username:focus {
  border-color: #00aaff;
}

#searchBtn {
  padding: 0.5rem 2rem;
  font-family: 'Oswald', sans-serif;
  font-size: large;
  width: 12rem;
  background: #Fbff00 ;
  color: #000000;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: 0.3s ease;
}

#searchBtn:hover {
  background: #fbff009c;
  transform: scale(1.05);
}

.search-bar button {
  padding: 0.6rem 1.2rem;
  background: #00aaff;
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s ease;
}

.search-bar button:hover {
  background: #0090dd;
  transform: scale(1.05);
}

#current-season {
  text-align: center;
}

#modeFilter {
  display: block;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  border-radius: 10px;
  border: 2px solid transparent;
  background: rgba(0, 170, 255, 0.1);
  color: #fff;
  font-size: 1rem;
  outline: none;
  cursor: pointer;
  transition: border 0.3s ease, background 0.3s ease;
  align-content: center;
}

#modeFilter:focus {
  border-color: #00aaff;
  background: rgba(0, 170, 255, 0.2);
}

#modeFilter option {
  background: #1c1c1c; /* dark background for dropdown options */
  color: #fff;
}

/* Container for the input and dropdown */
.search-row {
  display: flex;
  justify-content: center;
  align-items: center;
  
  gap: 1rem;
  margin-bottom: 1rem;
}

.search-row input,
.search-row select {
  padding: 0.6rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  outline: none;
}

/* Dropdown specific width if needed */
.search-row select {
  width: 150px; 
}

/* Row for the search button */
.search-button-row {
  display: flex;
  justify-content: center;
  margin-top: 0.5rem;
}

.search-button-row button {
  padding: 0.6rem 1.5rem;
  background: #00aaff;
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s ease;
}


.search-button-row button:hover {
  background: #0090dd;
  transform: scale(1.05);
}


/* === Platform Buttons === */
.platform-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 1.5rem 0;
}

.platform-btn {
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 2px solid transparent;
  border-radius: 10px;
  box-sizing: border-box;
  cursor: pointer;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden; /* prevents image from "pushing" outside container */
}

.platform-btn img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0.7) grayscale(100%);
  transition: transform 0.3s ease, filter 0.3s ease;
  transform-origin: center center;
}

.platform-btn:hover img {
  transform: scale(1.05);
  filter: brightness(1) grayscale(0);
}

.platform-btn.active img {
  transform: scale(1.1);
  filter: brightness(1.1) grayscale(0);
}

.platform-btn.active {
  border-color: #00aaff;
  box-shadow: 0 0 10px #00aaff;
}

/* Stats display */
.stats-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  background: rgba(255, 255, 255, 0.05);
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 0 15px rgba(0, 170, 255, 0.2);
  width: 80%;
  max-width: 900px;
  text-align: left; /* change from center to left */
  margin: 2rem auto;
}

.stats-container h2 {
  color: #00aaff;
  margin-bottom: 1rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.stat-box {
  background: rgba(255, 255, 255, 0.1);
  padding: 1rem;
  border-radius: 15px;
  transition: 0.3s ease;
}

.stat-box:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-3px);
}

.stat-title {
  font-size: 1rem;
  opacity: 0.8;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #00aaff;
  text-shadow: 0 0 10px #00aaff;
}

/* Random skin image */
.skin-display {
  margin-top: 2rem;
}

.skin-display img {
  width: 150px;
  height: 150px;
  border-radius: 20px;
  box-shadow: 0 0 15px #00aaff;
  animation: float 4s ease-in-out infinite;
}

/* Floating animation for skin image */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* Fade-in animation for stats display */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.stats-container {
  animation: fadeIn 0.6s ease-in-out;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.stat-icon {
  width: 24px;
  height: 24px;
  filter: brightness(0.7) grayscale(100%);
  transition: 0.3s ease;
}

.wins-icon {
  width: 40px;
  height: 28px;
}

.matches-icon {
  width: 35px;
  height: 35px;
}

.stat-item:hover .stat-icon {
  filter: brightness(1) grayscale(0);
  transform: scale(1.2);
}

.player-stats-container {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.skin-display {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.skin-display img {
  width: 400px;
  height: 400px;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: 0 0 15px #00aaff;
  animation: float 4s ease-in-out infinite;
}

.leaderboard-container {
  margin: 3rem auto;
  background: rgba(255,255,255,0.05);
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 0 15px rgba(0,170,255,0.2);
  width: 80%;
  max-width: 800px;
  text-align: center;
  
}

.leaderboard-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 10px;
  background: rgba(255,255,255,0.1);
  transition: 0.3s ease;
}

.leaderboard-item:hover {
  background: rgba(255,255,255,0.2);
}

#leaderboard-list {
  max-height: 400px;      /* fix height */
  overflow-y: auto;       /* vertical scroll */
  padding-right: 10px;    /* scrollbar space */
}

.leaderboard-item {
  opacity: 0;         
  transform: translateY(20px);
}

.rank {
  font-weight: 700;
  color: #00aaff;
  width: 30px;
}

.name {
  flex: 1;
  text-align: left;
}

.wins, .kd, .matches {
  width: 80px;
  text-align: right;
}

@media (max-width: 900px) {
  .stats-container {
    flex-direction: column; /* stack image above stats */
    text-align: center; /* center text for smaller screens */
  }

  .skin-display {
    margin-bottom: 1.5rem;
  }

  .skin-display img {
    width: 160px;
    height: 160px;
  }

  .stats-details {
    width: 100%;
  }

  .stat-item {
    justify-content: center; /* center icons and text */
  }

  #leaderboard-list {
    font-size: small;
  }

  .leaderboard-container {
    margin: auto;
  }

  #stats-container {
    width: 70%;
  }
 
  .search-row {
    width: 60%;
  }
  
  .stats-container {
    width: 60%;
  }
}

@media (max-width: 600px) {
  .stats-container {
    width: 95%;
    padding: 1.5rem;
  }

  .skin-display img {
    width: 130px;
    height: 130px;
  }

  .stat-icon {
    width: 20px;
    height: 20px;
  }

  .stat-value {
    font-size: 1.2rem;
  }

  h2 {
    font-size: 1.3rem;
  }
}