/**
 * Lingo2 Leaderboard Styles
 * Beautiful, modern design with animations
 */

/* Container */
.lingo2-leaderboard-container {
    max-width: 900px;
    margin: 2em auto;
    padding: 2em;
    background: linear-gradient(135deg, #11A7FF 0%, #0065CF 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: white;
}

/* Header */
.lingo2-leaderboard-header {
    text-align: center;
    margin-bottom: 2em;
}

.lingo2-leaderboard-title {
    font-size: 2.5em;
    font-weight: bold;
    margin: 0 0 0.3em 0;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    animation: titleFadeIn 0.8s ease-out;
}

.lingo2-leaderboard-subtitle {
    font-size: 1.1em;
    opacity: 0.9;
    margin: 0;
    animation: titleFadeIn 1s ease-out;
}

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

/* Podium */
.lingo2-leaderboard-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1em;
    margin-bottom: 3em;
    flex-wrap: wrap;
}

.lingo2-podium-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5em 1em;
    min-width: 180px;
    text-align: center;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
    animation: podiumSlideUp 0.6s ease-out;
}

@keyframes podiumSlideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.lingo2-podium-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: all 0.3s ease;
}

.lingo2-podium-first {
    order: 2;
    min-height: 280px;
    animation-delay: 0.2s;
}

.lingo2-podium-first::before {
    background: linear-gradient(90deg, #FFD700, #FFA500);
}

.lingo2-podium-second {
    order: 1;
    min-height: 240px;
    animation-delay: 0.1s;
}

.lingo2-podium-second::before {
    background: linear-gradient(90deg, #C0C0C0, #A8A8A8);
}

.lingo2-podium-third {
    order: 3;
    min-height: 220px;
    animation-delay: 0.3s;
}

.lingo2-podium-third::before {
    background: linear-gradient(90deg, #CD7F32, #B87333);
}

.lingo2-podium-item:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.4);
}

.lingo2-podium-medal {
    font-size: 4em;
    margin-bottom: 0.2em;
    animation: medalBounce 1s ease-out;
}

@keyframes medalBounce {
    0% {
        transform: scale(0) rotate(-180deg);
    }
    60% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
    }
}

.lingo2-podium-rank {
    font-size: 1em;
    opacity: 0.7;
    margin-bottom: 0.5em;
}

.lingo2-podium-username {
    font-size: 1.4em;
    font-weight: bold;
    margin-bottom: 0.5em;
    word-break: break-word;
}

.lingo2-podium-score {
    font-size: 2.2em;
    font-weight: bold;
    color: #FFE84E;
    text-shadow: 0 0 20px rgba(255, 228, 78, 0.6),
                 0 4px 10px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.2em;
    animation: scorePulse 2s ease-in-out infinite;
}

@keyframes scorePulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.lingo2-podium-label {
    font-size: 0.9em;
    opacity: 0.8;
}

/* Leaderboard List */
.lingo2-leaderboard-list {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5em;
    margin-bottom: 2em;
    animation: listFadeIn 0.8s ease-out 0.5s both;
}

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

.lingo2-leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.lingo2-leaderboard-table thead {
    background: rgba(255, 255, 255, 0.15);
}

.lingo2-leaderboard-table th {
    padding: 1em;
    text-align: left;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
}

.lingo2-th-rank {
    width: 80px;
    text-align: center;
}

.lingo2-th-score {
    width: 150px;
    text-align: right;
}

.lingo2-player-row {
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.lingo2-player-row:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(10px);
}

.lingo2-leaderboard-table td {
    padding: 1em;
}

.lingo2-td-rank {
    text-align: center;
    font-weight: bold;
    font-size: 1.2em;
}

.lingo2-td-username {
    font-size: 1.1em;
    font-weight: 500;
}

.lingo2-td-score {
    text-align: right;
    font-size: 1.2em;
    font-weight: bold;
    color: #FFE84E;
    text-shadow: 0 2px 8px rgba(255, 228, 78, 0.4);
}

/* Footer */
.lingo2-leaderboard-footer {
    text-align: center;
    margin-top: 2em;
    animation: footerFadeIn 1s ease-out 0.8s both;
}

@keyframes footerFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.lingo2-play-button {
    display: inline-block;
    padding: 1em 3em;
    font-size: 1.2em;
    font-weight: bold;
    background: linear-gradient(135deg, #FFE84E 0%, #FFD400 100%);
    color: #2d2d2d;
    text-decoration: none;
    border-radius: 50px;
    box-shadow: 0 6px 20px rgba(255, 228, 78, 0.4);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.lingo2-play-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 10px 30px rgba(255, 228, 78, 0.6);
    background: linear-gradient(135deg, #FFD400 0%, #FFE84E 100%);
    color: #2d2d2d;
    text-decoration: none;
}

.lingo2-play-button:active {
    transform: translateY(-1px);
}

/* Error State */
.lingo2-leaderboard-error {
    text-align: center;
    padding: 3em 2em;
    background: rgba(255, 59, 48, 0.2);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 2px solid rgba(255, 59, 48, 0.4);
}

.lingo2-leaderboard-error p {
    margin: 0.5em 0;
}

.lingo2-leaderboard-error p:first-child {
    font-size: 1.3em;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .lingo2-leaderboard-container {
        padding: 1.5em 1em;
    }

    .lingo2-leaderboard-title {
        font-size: 2em;
    }

    .lingo2-leaderboard-podium {
        flex-direction: column;
        align-items: center;
    }

    .lingo2-podium-item {
        width: 100%;
        max-width: 300px;
        min-height: auto !important;
    }

    .lingo2-podium-first {
        order: 1;
    }

    .lingo2-podium-second {
        order: 2;
    }

    .lingo2-podium-third {
        order: 3;
    }

    .lingo2-podium-medal {
        font-size: 3em;
    }

    .lingo2-podium-username {
        font-size: 1.2em;
    }

    .lingo2-podium-score {
        font-size: 1.8em;
    }

    .lingo2-leaderboard-list {
        padding: 1em;
        overflow-x: auto;
    }

    .lingo2-leaderboard-table th,
    .lingo2-leaderboard-table td {
        padding: 0.7em 0.5em;
    }

    .lingo2-th-rank,
    .lingo2-td-rank {
        width: 60px;
        font-size: 1em;
    }

    .lingo2-td-username {
        font-size: 1em;
    }

    .lingo2-td-score {
        font-size: 1.1em;
    }

    .lingo2-play-button {
        padding: 0.8em 2em;
        font-size: 1em;
    }
}

@media (max-width: 480px) {
    .lingo2-leaderboard-container {
        padding: 1em 0.5em;
        border-radius: 12px;
    }

    .lingo2-leaderboard-title {
        font-size: 1.6em;
    }

    .lingo2-leaderboard-subtitle {
        font-size: 0.95em;
    }

    .lingo2-podium-item {
        padding: 1em 0.5em;
    }

    .lingo2-leaderboard-table {
        font-size: 0.9em;
    }

    .lingo2-th-username {
        min-width: 120px;
    }
}

/* Print Styles */
@media print {
    .lingo2-leaderboard-container {
        box-shadow: none;
        background: white;
        color: black;
    }

    .lingo2-play-button {
        display: none;
    }

    .lingo2-podium-item:hover,
    .lingo2-player-row:hover {
        transform: none;
    }
}

/* Loading Animation (optional, for JS enhancement) */
.lingo2-leaderboard-loading {
    text-align: center;
    padding: 3em;
}

.lingo2-loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #FFE84E;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1em;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Tabs Navigation */
.lingo2-tabs {
    display: flex;
    justify-content: center;
    gap: 1em;
    margin-bottom: 2em;
    flex-wrap: wrap;
}

.lingo2-tab-button {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.8em 2em;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.lingo2-tab-button:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.lingo2-tab-button.active {
    background: linear-gradient(135deg, #FFE84E 0%, #FFD400 100%);
    color: #2d2d2d;
    border-color: #FFE84E;
    box-shadow: 0 6px 20px rgba(255, 228, 78, 0.4);
}

.lingo2-tab-button.active:hover {
    background: linear-gradient(135deg, #FFD400 0%, #FFE84E 100%);
}

/* Tab Content */
.lingo2-tab-content {
    display: none;
    animation: tabFadeIn 0.5s ease-out;
}

.lingo2-tab-content.active {
    display: block;
}

@keyframes tabFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Monthly Champions */
.lingo2-champions-container {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 0.5em;
}

.lingo2-champions-container::-webkit-scrollbar {
    width: 8px;
}

.lingo2-champions-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.lingo2-champions-container::-webkit-scrollbar-thumb {
    background: rgba(255, 228, 78, 0.5);
    border-radius: 10px;
}

.lingo2-champions-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 228, 78, 0.7);
}

.lingo2-month-champions {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5em;
    margin-bottom: 2em;
    border: 2px solid rgba(255, 255, 255, 0.15);
    animation: monthFadeIn 0.6s ease-out;
}

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

.lingo2-month-title {
    text-align: center;
    font-size: 1.8em;
    margin: 0 0 1.5em 0;
    color: #FFE84E;
    text-shadow: 0 2px 10px rgba(255, 228, 78, 0.4);
}

.lingo2-champions-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1em;
    flex-wrap: wrap;
}

.lingo2-champions-podium .lingo2-podium-item {
    min-height: 200px;
}

.lingo2-podium-level {
    font-size: 0.85em;
    opacity: 0.85;
    margin-top: 0.5em;
    font-style: italic;
}

/* Responsive - Tabs */
@media (max-width: 768px) {
    .lingo2-tabs {
        gap: 0.5em;
    }

    .lingo2-tab-button {
        padding: 0.7em 1.5em;
        font-size: 1em;
    }

    .lingo2-month-title {
        font-size: 1.4em;
    }

    .lingo2-champions-container {
        max-height: 500px;
    }
}

@media (max-width: 480px) {
    .lingo2-tab-button {
        padding: 0.6em 1.2em;
        font-size: 0.95em;
    }

    .lingo2-month-title {
        font-size: 1.2em;
    }

    .lingo2-champions-podium {
        flex-direction: column;
        align-items: center;
    }

    .lingo2-champions-podium .lingo2-podium-item {
        width: 100%;
        max-width: 300px;
        min-height: auto !important;
    }
}
