@import url('"https://fonts.googleapis.com/css2?family=Archivo+Narrow:ital,wght@0,400..700;1,400..700&display=swap');
:root {
    --main-green: #0BAA0B;
    --light-green: #98FF98;
    --gold: #FFD700;
}

body {
    background: var(--main-green);
    margin-top: 0
}

#leaderboard-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    padding-top: 0
}


/* Title Box */
.firebase-leaderboard {
    background: #0BAA0B;
    font-family: 'Archivo Narrow', sans-serif;
.title-box {
    background: var(--light-green);
    border: 3px solid white;
    border-radius: 25px;
    padding: 15px 30px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.image-box {
    display: flex;
    justify-content: center;
}

.image-box {
    img{
        max-width: 70%;
    }
}

.title-box h1 {
    color: var(--main-green);
    font-size: 24px;
    margin: 0;
}


/* Tabs */

.tab-container {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    margin-bottom: 20px;
}

.tab {
    padding: 6px 30px;
    border-radius: 60px;
    color: #48CA4A;
    font-weight: 600;
    font-size: 22px;
    /* background: rgba(255, 255, 255, 0.2); */
    color: 333;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab:hover {
    background: #FFD700;
    color: white;
}

.tab.active {
    box-shadow: 0px 4px 0px 0px #FF8C00;
    background: #FFD700;
    font-weight: 600;
    color: white;
}


/* Timer Section */
.last-updated {
    text-align: center;
    color: #D8FE4B;
    font-size: 0.9em;
    font-style: italic;
    padding-bottom: 10px;
    margin-top: -10px;
}

.timer-holder {
    display: flex;
    justify-content: center;
}

.timer-section {
    /* background: var(--light-green); */
    max-width: 550px;
    border: 3px solid #D8FE4B;
    background: #48CA4A;
    border-radius: 15px;
    padding: 12px 36px;
    margin-bottom: 20px;
    text-align: center;
}

.timer-title {
    color: #D8FE4B;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
}

.timer-display {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.timer-unit {
    text-align: center;
}

.timer-value {
    font-size: 22px;
    font-weight: bold;
    /* color: var(--main-green); */
    color: #D8FE4B;
    font-weight: bold;
    padding-right: 20px;
}

.timer-label {
    font-size: 22px;
    /* color: var(--main-   green); */
    color: white;
    font-weight: bold;
    border-right: 2px solid #D8FE4B;
    border-radius: 1px;
    padding-right: 20px;
}

.timer-label.minutes {
    border-right: none;
}


/* Search Bar */

.search-container {
    position: relative;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.search-input {
    max-width: 320px;
    width: 320px;
    padding: 12px 20px;
    border: 2px solid white;
    border-radius: 25px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 16px;
}


/* Leaderboard Items */

.leaderboard-item {
    background: white;
    border: 2px solid transparent;
    border-radius: 30px;
    padding: 15px 20px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    will-change: transform;
    z-index: 1;
}

.leaderboard-item.animating {
    position: absolute;
    width: calc(100% - 40px); /* Adjust based on padding */
    left: 20px;
    right: 20px;
}


/* Top 5 styling */

.leaderboard-item.top-five {
    border-color: var(--gold);
    border-width: 4px;
    background: white;
}

.leaderboard-item.top-ten .rank-number {
    color: white;
    margin-top: -8px;
}


/* Separator styling */

.leaderboard-item.separator {
    position: relative;
    margin-top: 30px;
}

.leaderboard-item.separator::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
}


/* Player info styling */

.player-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.player-name {
    font-weight: 700;
    color: #333;
    font-size: 16px;
}

.player-username {
    font-size: 12px;
    color: #666;
}


/* Score styling */

.score {
    font-size: 18px;
    margin-left: auto;
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.points-text {
    font-size: 12px;
    color: #999;
}


/* Rank styling for top positions */

.rank {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 15px;
    width: 30px;
}

.rank.rank-1 > .rank-number {
    margin-left: 0px;
}

.rank.rank-10 > .rank-number {
    margin-left: -4px;
}

.rank-medal {
    position: absolute;
    width: 30px;
    left: -11px;
    z-index: inherit;
    top: 60%;
    transform: translateY(-50%);
}

.rank-number {
    z-index: 100;
    font-weight: 700;
}

/* Arrow indicators */

.leaderboard-item::before {
    color: #28a745;
    margin-right: 5px;
    font-weight: bold;
}

.leaderboard-item:nth-child(2n)::before {
    color: #dc3545;
}

.leaderboard-item:nth-child(3n)::before {
    color: #6c757d;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 20px 0;
}
.pagination-number {
    color: #000000;
}

.pagination-number, .pagination-arrow {
    min-width: 44px;
    height: 44px;
    font-size: 12px;
    border: none;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-number.active {
    background: #ffd700;
    color: black;
}

.pagination-arrow {
    color: #00C40D;
    font-size: 20px;
}

.pagination-arrow.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-dots {
    color: white;
}

.loading {
    text-align: center;
    padding: 20px;
    color: white;
}

.error {
    text-align: center;
    padding: 20px;
    color: red;
}

/* POPOVER */


.popover__title {
    font-family: 'Archivo Narrow', sans-serif;
    font-size: 18px;
    font-weight: 600;
    line-height: 36px;
    text-decoration: none;
    background-color: var(--gold);
    border-radius: 20px;
    color: white;
    box-shadow: 0px 4px 0px 0px #FF8C00;
    text-align: center;
    padding: 6px 15px;
    user-select: none;
  }
  
  .prizes-section {
    font-family: 'Archivo Narrow', sans-serif;
    position: relative;
    display: inline-block;
  }
  .prizes-list {
    margin: 0;
    padding-left: 25px;
    text-align: left;
}

    .prizes-list li {
        color: #333;
        margin-bottom: 10px;
        line-height: 1.4;
    }

    .prizes-list li:last-child {
        margin-bottom: 0;
    }

    .prizes-holder{
        display: flex;
        align-items: center;
        justify-content: center;
    }
  .popover__content {
    background-color: azure;
    width: 300px !important;
    opacity: 0;
    visibility: hidden;
    position: absolute;
    left: -120px;
    transform: translate(0, 10px);
    padding: 1.5rem;
    box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.26);
    width: auto;
  }
  .popover__content:before {
    position: absolute;
    z-index: -1;
    content: "";
    right: calc(50% - 10px);
    top: -8px;
    border-style: solid;
    border-width: 0 10px 10px 10px;
    border-color: transparent transparent azure transparent;
    transition-duration: 0.3s;
    transition-property: transform;
  }
  .prizes-section:hover .popover__content {
    z-index: 999;
    opacity: 1;
    visibility: visible;
    transform: translate(30px, 0px);
    transition: all 0.5s cubic-bezier(0.75, -0.02, 0.2, 0.97);
  }
  .popover__message {
    text-align: center;
  }


}



.loading-holder {
    display: flex;
    justify-content: center;
}
.lds-ellipsis,
.lds-ellipsis div {
  box-sizing: border-box;
}
.lds-ellipsis {
  display: inline-block;
  position: relative;
  width: 80px;
  height: 80px;
}
.lds-ellipsis div {
  position: absolute;
  top: 33.33333px;
  width: 13.33333px;
  height: 13.33333px;
  border-radius: 50%;
  background: rgb(189 174 112);
  animation-timing-function: cubic-bezier(0, 1, 1, 0);
}
.lds-ellipsis div:nth-child(1) {
  left: 8px;
  animation: lds-ellipsis1 0.6s infinite;
}
.lds-ellipsis div:nth-child(2) {
  left: 8px;
  animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(3) {
  left: 32px;
  animation: lds-ellipsis2 0.6s infinite;
}
.lds-ellipsis div:nth-child(4) {
  left: 56px;
  animation: lds-ellipsis3 0.6s infinite;
}
@keyframes lds-ellipsis1 {
  0% {
    transform: scale(0);
  }
  100% {
    transform: scale(1);
  }
}
@keyframes lds-ellipsis3 {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(0);
  }
}
@keyframes lds-ellipsis2 {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(24px, 0);
  }
}




.autocomplete-items {
    position: absolute;
    border: 1px solid #d4d4d4;
    border-bottom: none;
    border-top: none;
    z-index: 99;
    /*position the autocomplete items to be the same width as the container:*/
    top: 100%;
    width: 200px;
  }
  .autocomplete-items div {
    padding: 10px;
    cursor: pointer;
    background-color: #fff;
    border-bottom: 1px solid #d4d4d4;
  }
  .autocomplete-items div:hover {
    /*when hovering an item:*/
    background-color: #e9e9e9;
  }
  .autocomplete-active {
    /*when navigating through the items using the arrow keys:*/
    background-color: DodgerBlue !important;
    color: #ffffff;
  }

.search-dropdown {
    position: absolute;
    top: 100%;
    /* left: 0; */
    /* right: 0; */
    width: 250px;
    background: white;
    border-radius: 4px;
    border-top-right-radius: 0;
    border-top-left-radius: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.search-result-item {
    padding: 10px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item:hover {
    background-color: #f5f5f5;
}

.search-username {
    font-weight: bold;
}

.search-rank {
    color: #666;
}

.autocomplete {
    position: relative;
}

.leaderboard-item.highlighted {
    background-color: #FFD324;
    border: 2px solid #000000
}

.search-result-item.no-results {
    color: #666;
    text-align: center;
    justify-content: center;
    cursor: default;
    padding: 15px;
}

.search-result-item.no-results:hover {
    background-color: transparent;
}


@media only screen and (max-width: 600px) {
    .tab {
        font-size: 14px !important;
        padding: 6px 10px !important;
    }
    .timer-section {
        padding: 12px !important;
    }
    .timer-title {
        font-size: 14px !important;
    }
    .timer-label {
        font-size: 14px !important;
        padding-right: 0 !important;
        border-right: none !important;
    }
    .timer-value {
        padding-right: 5px !important;
    }
    .popover__title{
        font-size: 14px !important;
        line-height: 26px !important;
    }
    .leaderboard-item {
        padding: 15px 5px !important;
    }
    .player-name {
        font-size: 14px !important;
    }
    .score {
        font-size: 14px !important;
    }
  }

.search-dropdown .loading-holder {
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    border-radius: 4px;
    height: 70px;
    padding: 0;
}

.search-dropdown .lds-ellipsis {
    transform: scale(0.5);
}

@keyframes scoreChange {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes moveUp {
    0% { transform: translateY(0); }
    15% { transform: translateY(-2px); }
    85% { transform: translateY(-2px); }
    100% { transform: translateY(0); }
}

@keyframes moveDown {
    0% { transform: translateY(0); }
    15% { transform: translateY(2px); }
    85% { transform: translateY(2px); }
    100% { transform: translateY(0); }
}

.score-changed {
    animation: scoreChange 1s ease;
    color: #FFD700;
}

.move-up {
    animation: moveUp 1s ease;
    background-color: rgba(0, 255, 0, 0.1);
}

.move-down {
    animation: moveDown 1s ease;
    background-color: rgba(255, 0, 0, 0.1);
}

