/* leaderboard.css */

/* Leaderboard Container */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1vw;
  margin: 2vw auto;
  max-width: 40vw;
}

/* Leaderboard Item */
.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px;
  border-radius: 10px;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 18px;
  width: 100%;
  max-width: 100%;
  margin-bottom: 10px;
  overflow: hidden;  /* Prevents text overflow */
  flex-wrap: nowrap; /* Prevents wrapping */
}

/* Profile Container */
.profile-container {
  position: relative;
  flex-shrink: 0;
  width: 4vw;
  height: 4vw;
  margin-right: 1vw;
  user-select: none;
}

.profile-pic, .color-circle {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: block;
}

/* Rank Badge */
.rank-circle {
  position: absolute;
  bottom: 0;
  right: 0.2vw;
  padding: 0.1vw;
  border-radius: 20%;
  background-color: #ccc;
  color: black;
  font-weight: bold;
  font-size: 0.9vw;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* User Info */
.user-info {
  flex-grow: 1;  /* Allow it to grow */
  min-width: 0;  /* Important: prevents flex items from overflowing */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.username {
  font-weight: bold;
  font-size: 18px;

  white-space: nowrap;
  max-width: 150px; /* Adjust this based on your design */
  display: inline-block;
}

.badges {
  margin-top: 0.5vw;
  user-select: none;
}
.badge-icon {
  width: 1.5vw;
  height: 1.5vw;
  margin-right: 0.3vw;
  margin-bottom: -0.3vw;
  cursor: help;
  user-select: none;
}

/* Stats */
.stats {
  text-align: right;
  font-size: 16px;
  min-width: 120px; /* Prevents squishing */
  flex-shrink: 0; /* Prevents stats from getting pushed out */
  overflow: hidden;
  text-wrap: nowrap;
}
.stats span {
  display: block;
}

/* Last message */
.last-message {
  margin-top: 0.5vw;
  font-style: italic;
  font-size: 1vw;
  color: #ccc;
}
.message-date {
  font-weight: normal;
  color: rgba(255, 255, 255, 0.3);
  cursor: help;
}
.message-date:hover {
  text-decoration: underline;
}



@-webkit-keyframes wiggle {
    0% { -webkit-transform: skewX(24deg); } 
    10% { -webkit-transform: skewX(-8deg); }
    20% { -webkit-transform: skewX(55deg); }
    30% { -webkit-transform: skewX(-90deg); }
    40% { -webkit-transform: skewX(29deg); }
    50% { -webkit-transform: skewX(-90deg); }
    60% { -webkit-transform: skewX(3deg); }
    70% { -webkit-transform: skewX(-2deg); }
    80% { -webkit-transform: skewX(1deg); }
    90% { -webkit-transform: skewX(10deg); }
    100% { -webkit-transform: skewX(0deg); }
}

:root {
  --color-text: #fff;
  --color-bg: #000;
  --color-link: #f9d77e;
  --color-link-hover: #fff;
  --color-info: #efc453;
}

body {
  background-color: var(--color-bg);
  margin: 0;
  padding: 0;
}






/* Top Gifters Wrapper */
.top-gifters {
  user-select: none;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 3vw; /* Enough gap so scaling won’t overlap */
  margin: 2vw 0;
  overflow: visible;
  position: relative;
  margin-top: 4.5vw;
}

/* Slight "carousel" effect:
   When hovering one, others scale down a little, but not the middle. */
.top-gifters:hover .top-gifter:not(:hover):not(.middle) {
  transform: scale(0.97);
}
/* The middle card shrinks less. */
.top-gifters:hover .top-gifter.middle:not(:hover) {
  transform: scale(1.10);
}

/* Base .top-gifter (animated gradient BORDER) */
.top-gifter {
  position: relative;
  z-index: 0;
  width: 15vw;
  padding: 1vw;
  border-radius: 1vw;
  border: 0.4vw solid transparent;
  background-color: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  background-clip: padding-box;
  text-align: center;
  color: #fff;
  transition: transform 0.4s ease;
}

/* Hover on any single gifter to scale slightly */
.top-gifter:hover {
  transform: scale(1.05) translateY(-0.2vw);
}

/* Middle gold card starts bigger */
.top-gifter.middle {
  transform: scale(1.15);
  transform-origin: bottom center;
}
.top-gifter.middle:hover {
  transform: scale(1.2) translateY(-0.2vw);
}

/* The ::before draws the symmetrical color stops & "forward/back" loop. */
/* The card or box that needs a “shimmer” border: */
.top-gifter::before {
  content: "";
  position: absolute;
  top: -0.8vw;
  left: -0.8vw;
  right: -0.8vw;
  bottom: -0.8vw;
  z-index: -1;
  border-radius: inherit;
  /* Larger background size for more obvious travel */
  background-size: 300% 300%;
  /* Slower or faster speed to your taste; 6s is a decent start */
  animation: borderShine 6s linear infinite;
}

/* "Forward and back" diagonal movement */
@keyframes borderShine {
  0% {
    background-position: 0% 0%;
  }
  50% {
    background-position: 100% 100%;
  }
  100% {
    background-position: 0% 0%;
  }
}





/* SILVER gradient with symmetrical stops (0% & 100% match) */
.top-gifter.silver::before {
  background: linear-gradient(
    45deg,        /* angle to match diagonal travel */
    #5e5e5e 0%,   
    #c0c0c0 25%,  
    #808080 50%,  
    #c0c0c0 75%,  
    #5e5e5e 100%
  );
}


/* GOLD gradient with symmetrical stops */
.top-gifter.gold::before {
  background: linear-gradient(
    130deg,
    #cf9800 0%,
    #ffd035 25%,
    #b97f00 50%,
    #ffd035 75%,
    #cf9800 100%
  );
}

/* BRONZE gradient with symmetrical stops */
.top-gifter.bronze::before {
  background: linear-gradient(
    130deg,
    #CD7F32 0%,
    #8B4513 25%,
    #CD7F32 50%,
    #8B4513 75%,
    #CD7F32 100%
  );
}

/* Rectangular glow behind the MIDDLE GOLD card */
.top-gifter.gold.middle::after {
  content: "";
  position: absolute;
  pointer-events: none;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  z-index: -2;
  transform: scale(1.05);
  transform-origin: center;
  background: rgba(255, 215, 0, 0.15);
  box-shadow: 0 0 1vw 0.5vw rgba(255,215,0,0.3);
  animation: goldBoxGlow 2s ease-in-out infinite alternate;
}

@keyframes goldBoxGlow {
  0% {
    transform: scale(1.05);
    box-shadow: 0 0 1vw 0.5vw rgba(255,215,0,0.3);
  }
  100% {
    transform: scale(1.1);
    box-shadow: 0 0 2vw 1vw rgba(255,215,0,0.6);
  }
}

/* Profile Pic in top-gifter */
.top-profile-pic,
.top-gifter .color-circle {
  width: 6vw;
  height: 6vw;
  border-radius: 50%;
  margin-bottom: 1vw;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.top-gifter h2 {
  font-size: 1.5vw;
  margin-bottom: 0.5vw;
}

/* "subs-gifted" container */
.subs-gifted {
  margin-top: 0.5vw;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.sub-gifter-icon {
  width: 2vw;
  height: auto;
  margin-bottom: 0.2vw;
}
.subs-number {
  font-size: 2vw;
  font-weight: bold;
  color: #ffd900;
}
.subs-text {
  font-size: 1vw;
  color: #ffffff;
}

/* Medal icon (numbers, etc.) */
.medal-icon {
  position: absolute;
  top: -1vw;
  left: 50%;
  transform: translateX(-50%);
  width: 3vw;
  height: auto;
}

/* Hover Effects for normal leaderboard items */
.leaderboard-item:hover {
  background-color: rgba(0, 0, 0, 0.9);
  transition: 0.3s ease-in-out;
}
.badge-icon:hover {
  transform: scale(1.2);
  transition: transform 0.2s;
}

/* Crown Icon (if used for #1) */
.crown-icon {
  position: absolute;
  top: -2vw;
  left: 50%;
  transform: translateX(-50%);
  width: 4vw;
  height: auto;
  z-index: 2;
}

/* Leaderboard Search Form */
.search-form {
  padding-top: 1vw;
  margin-top: 1vw;
  display: flex;
  justify-content: center;
  margin-bottom: 1vw;
  user-select: none;

}
.search-form input[type="text"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1vw;
  border-radius: 1vw;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.5);
  font-size: 1vw;
  width: 100%;
  height: 0.5vw;
  max-width: 40vw;
  position: relative;
  border: none;
  cursor: text;
}
.search-form button {
  cursor: pointer;
  border: none;
}
.search-form button:hover {
  border: none;
}
.search-form input[type="text"]:focus {
  outline: none;
}

/* Leaderboard & Pagination */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1vw;
  margin: 2vw auto;
  max-width: 40vw;
}
.leaderboard-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1vw;
  border-radius: 1vw;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  color: white;
  font-size: 1.2vw;
  width: 100%;
  max-width: 60vw;
  position: relative;
  margin-bottom: 1vw;
}

/* Pagination Controls */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5vw;
  width: 100%;
  max-width: 40vw;
  margin: 2vw auto;
  overflow: hidden;
}
.pagination button {
  padding: 0.5em 1em;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  color: #fff;
  border: 1px solid #333;
  border-radius: 0.6vw;
  cursor: pointer;
  font-size: 1vw;
  user-select: none;
}
.pagination button.active,
.pagination button:hover {
  background-color: #333;
}



/* MOBILE OVERRIDES */
@media only screen and (max-width: 768px) {
  /* Adjust container widths and gaps */
  .leaderboard-list {
    max-width: 90%;
    gap: 10px;
    margin: 20px auto;
  }
  .leaderboard-item {
    padding: 10px;
    border-radius: 10px;
    font-size: 18px;
    max-width: 100%;
    margin-bottom: 10px;
  }
  /* Profile pic & rank badge */
  .profile-container {
    width: 70px;
    height: 70px;
    margin-right: 10px;
  }
  .rank-circle {
    right: 4px;
    padding: 2px;
    font-size: 14px;
  }
  .username {
    max-width: 120px; /* Reduce width for smaller screens */

    font-size: 20px;
  }

  .user-info {
    flex-grow: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .badge-icon {
    width: 20px;
    height: 20px;
    margin-right: 4px;
    margin-bottom: -4px;
  }
  .stats {
    min-width: 100px; /* Ensure enough space for stats */

    font-size: 18px;
    text-wrap: nowrap;
    
  }

  .last-message {
    font-size: 16px;
  }

  /* Top Gifters adjustments */
  .top-gifters {
    gap: 20px;
    margin: 20px 0;
    margin-top: 45px;
  }
  .top-gifter {
    width: 150px;
    padding: 10px;
    border-radius: 10px;
    border: 4px solid transparent;
  }
  .top-gifter:hover {
    transform: scale(1.05) translateY(-2px);
  }
  .top-gifter.middle {
    transform: scale(1.15);
  }
  .top-gifter.middle:hover {
    transform: scale(1.2) translateY(-2px);
  }
  .top-gifter::before {
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    background-size: 300% 300%;
  }
  .top-profile-pic,
  .top-gifter .color-circle {
    width: 60px;
    height: 60px;
    margin-bottom: 10px;
  }
  .top-gifter h2 {
    font-size: 20px;
    margin-bottom: 5px;
  }
  .subs-gifted {
    margin-top: 5px;
  }
  .sub-gifter-icon {
    width: 20px;
    margin-bottom: 2px;
  }
  .subs-number {
    font-size: 20px;
  }
  .subs-text {
    font-size: 14px;
  }
  .medal-icon {
    top: -10px;
    width: 30px;
  }
  .crown-icon {
    top: -20px;
    width: 40px;
  }
  /* Search Form */
  .search-form input[type="text"] {
    padding: 10px;
    border-radius: 10px;
    font-size: 18px;
    height: 40px;
    max-width: 90%;
  }
  /* Pagination */
  .pagination {
    display: flex;
    justify-content: center;
    gap: 0.5vw;
    width: 100%;
    max-width: 40vw;
    margin: 2vw auto;
    overflow: visible;
  }
  .pagination button {
    padding: 0.5em 1em;
    font-size: 18px;
    border-radius: 10px;
  }
}

