.ranking-section {
    padding: 0rem 0rem 4rem 0rem;
    background-color: #141414;
    overflow: hidden;
}

.ranking-title {
    background-color: rgba(75, 75, 75, 0.3);
    text-align: center;
    color: white;
    font-size: 2rem;
    font-weight: 300;
    margin-bottom: 7rem;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.8s ease;
    padding: 1rem;
}

.ranking-title.visible {
    opacity: 1;
    transform: translateY(0);
}

.ranking-cards {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* .rank-card {
    position: relative;
    width: 280px;
    border: 1px solid var(--button-border-color);
    background-color: var(--primary-bg-transparent);
    border-radius: 1rem;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
} */

.rank-card {
    position: relative;
    width: 280px;
    border: 1px solid var(--button-border-color);
    background-color: var(--primary-bg-transparent);
    border-radius: 1rem;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
    box-sizing: border-box;
}


.rank-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.gold-card {
    height: 520px;
    animation: fadeInUp 0.8s ease 0.2s forwards;
}

.silver-card {
    height: 480px;
    animation: fadeInUp 0.8s ease forwards;
}

.bronze-card {
    height: 480px;
    animation: fadeInUp 0.8s ease 0.4s forwards;
}

.rank-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.rank-card:hover .contestant-image {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.2);
}

.rank-card:hover .crown-image {
    transform: rotate(-10deg);
}

.gold-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.3),
                0 0 45px rgba(255, 215, 0, 0.2),
                0 0 65px rgba(255, 215, 0, 0.1);
}

.silver-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 25px rgba(192, 192, 192, 0.3),
                0 0 45px rgba(192, 192, 192, 0.2),
                0 0 65px rgba(192, 192, 192, 0.1);
}

.bronze-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 25px rgba(205, 127, 50, 0.3),
                0 0 45px rgba(205, 127, 50, 0.2),
                0 0 65px rgba(205, 127, 50, 0.1);
}

/* Component transitions */
.crown-image {
    position: absolute;
    top: -60px;
    width: 60px;
    height: 60px;
    transition: all 0.5s ease;
    transform-origin: center bottom;
}

.rank-card:hover .crown-image {
    animation: crownWiggle 1s ease-in-out infinite;
}

@keyframes crownWiggle {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg) scale(1.1); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(8deg) scale(1.1); }
    100% { transform: rotate(0deg); }
}

.contestant-image {
    width: 200px;
    height: 200px;
    border-radius: 1rem;
    border: 3px solid white;
    object-fit: cover;
    margin-top: 1rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.medal-container {
    position: relative;
    margin-top: -30px;
    margin-bottom: 1rem;
}

.medal-image {
    width: 45px;
    height: 60px;
}

/* .contestant-info {
    text-align: center;
    color: white;
    margin-top: 0.5rem;
} */

.contestant-info {
    text-align: center;
    color: white;
    margin-top: 0.5rem;
    width: 100%;
    padding: 0 0.5rem;
}

.contestant-name, .contestant-number {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.vote-count {
    font-weight: 700;
}

/* .vote-button {
    width: 100%;
    margin-top: auto;
    transition: transform 0.2s ease;
} */

.vote-button {
    width: calc(100% - 1rem);
    margin-top: auto;
    margin-bottom: 0.5rem;
    transition: transform 0.2s ease;
}

.vote-button:hover {
    transform: scale(1.05);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive styles */
@media screen and (max-width: 1024px) {
    .ranking-cards {
        gap: 1rem;
    }

    .rank-card {
        width: 220px;
    }

    .contestant-image {
        width: 160px;
        height: 160px;
    }

    .gold-card {
        height: 460px;
    }

    .silver-card, .bronze-card {
        height: 420px;
    }
}

@media screen and (max-width: 768px) {
    .ranking-title {
        font-size: 1.75rem;
        margin-bottom: 5rem;
    }

    .ranking-cards {
        gap: 0.75rem;
    }

    .rank-card {
        width: 180px;
    }

    .contestant-image {
        width: 140px;
        height: 140px;
    }

    .crown-image {
        width: 40px;
        height: 40px;
        top: -40px;
    }

    .medal-image {
        width: 35px;
        height: 45px;
    }

    .contestant-name {
        font-size: 1rem;
    }

    .contestant-number {
        font-size: 0.875rem;
    }

    .vote-count {
        font-size: 1rem;
        font-weight: 700;
    }

    .gold-card {
        height: 470px;
    }

    .silver-card, .bronze-card {
        height: 430px;
    }
}

@media screen and (max-width: 480px) {
    .ranking-title {
        font-size: 1.5rem;
        margin-bottom: 4rem;
    }

    .ranking-cards {
        gap: 0.5rem;
    }

    .rank-card {
        width: 140px;
        padding: 0.5rem;
        height: auto;
        min-height: 380px;
    }

    .contestant-info {
        padding: 0 0.25rem;
    }

    .contestant-name, .contestant-number {
        font-size: 0.85rem;
    }

    .contestant-image {
        width: 110px;
        height: 110px;
        margin-top: 0rem;
    }

    .gold-card {
        height: 410px;
    }

    .silver-card, .bronze-card {
        height: 380px;
    }

    .medal-container {
        margin-bottom: 0.5rem;
    }

    .vote-button {
        padding: 0.5rem 0.25rem;
        font-size: 0.7rem;
        width: calc(100% - 0.5rem);
    }
}

/* ranking list */
.ranking-list {
    max-width: 1200px;
    margin: 3rem auto 0;
    padding: 0 10rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    background: var(--primary-bg-transparent);
    border-radius: 10px;
    margin-bottom: 1rem;
    padding: 1rem;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.ranking-item:hover {
    transform: translateY(-5px);
    border-color: var(--button-border-color);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.1);
    background: var(--primary-bg-transparent);
}

.ranking-item:hover .contestant-small-image {
    transform: scale(1.05);
    border-color: var(--button-border-color);
}

.ranking-item:hover .rank-number {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.ranking-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.rank-number {
    width: 60px;
    height: 60px;
    border: 2px solid var(--button-border-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    margin-right: 1rem;
    transition: all 0.3s ease;
}

.contestant-small-image {
    width: 60px;
    height: 60px;
    border-radius: 10px;
    border: 2px solid white;
    object-fit: cover;
    margin-right: 1rem;
    transition: all 0.3s ease;
}

.contestant-details {
    flex-grow: 1;
    color: white;
}

.contestant-name-list {
    font-weight: bold;
    margin-bottom: 0.25rem;
}

.contestant-city {
    font-size: 0.875rem;
    opacity: 0.8;
}

.vote-count-list {
    color: white;
    font-weight: bold;
    margin-left: 1rem;
    text-align: right;
    min-width: 100px;
}

.vote-list-button {
    background-color: var(--primary-bg);
    color: white;
    border: none;
    border-radius: 15px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.vote-list-button:hover {
    background-color: var(--primary-bg);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px var(--primary-bg-transparent);
}

.vote-list-button:disabled {
    background-color: #8FA3D7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* responsive styles */
@media screen and (max-width: 768px) {
    .ranking-list {
        padding: 0 6.5rem;
    }

    .ranking-item {
        padding: 0.75rem;
    }

    .rank-number {
        width: 40px;
        height: 40px;
        margin-right: 0.75rem;
        font-size: 0.875rem;
    }

    .contestant-small-image {
        width: 40px;
        height: 40px;
        margin-right: 0.75rem;
    }

    .contestant-name-list {
        font-size: 0.875rem;
    }

    .contestant-city {
        font-size: 0.75rem;
    }

    .vote-count-list {
        font-size: 0.875rem;
        min-width: 80px;
    }

    .vote-list-button {
        padding: 0.4rem 0.75rem;
        font-size: 0.75rem;
        margin-right: 0.75rem;
    }
}

@media screen and (max-width: 480px) {
    .ranking-list {
        padding: 0 0.5rem;
    }

    .ranking-item {
        padding: 0.5rem;
    }

    .rank-number {
        width: 32px;
        height: 32px;
        margin-right: 0.5rem;
        font-size: 0.75rem;
    }

    .contestant-small-image {
        width: 32px;
        height: 32px;
        margin-right: 0.5rem;
    }

    .contestant-name-list {
        font-size: 0.75rem;
    }

    .contestant-city {
        font-size: 0.675rem;
    }

    .vote-count-list {
        font-size: 0.75rem;
        min-width: 60px;
    }

    .vote-list-button {
        padding: 0.3rem 0.6rem;
        font-size: 0.7rem;
        margin-right: 0.5rem;
    }
}
