/* Creator Leaderboard - BeFreed Brand */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Manrope', sans-serif;
    background: #111;
    color: #fff;
    min-height: 100vh;
}

/* ---- Login Screen ---- */

.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 48px 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.login-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 24px;
    border-radius: 12px;
}

.login-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 32px;
    color: #fff;
}

.login-input {
    width: 100%;
    padding: 14px 16px;
    background: #232323;
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.login-input:focus {
    border-color: #9747FF;
    box-shadow: 0 0 0 3px rgba(151, 71, 255, 0.15);
}

.login-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.login-error {
    color: #ff4d4f;
    font-size: 13px;
    margin-top: 8px;
}

.login-button {
    width: 100%;
    padding: 14px;
    margin-top: 20px;
    background: #9747FF;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-button:hover {
    background: #8234e0;
}

.login-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---- Leaderboard Screen ---- */

.leaderboard-screen {
    max-width: 1160px;
    margin: 0 auto;
    padding: 32px 20px 60px;
}

/* ---- Two-Column Layout ---- */

.leaderboard-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
}

.leaderboard-main {
    flex: 1;
    min-width: 0;
}

.leaderboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 16px;
}

.leaderboard-title {
    font-size: 26px;
    font-weight: 700;
}

/* ---- Platform Toggle ---- */

.platform-toggle {
    display: flex;
    background: #1a1a1a;
    border-radius: 8px;
    padding: 4px;
    gap: 4px;
}

.toggle-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.toggle-btn.active {
    background: #9747FF;
    color: #fff;
}

.toggle-btn:hover:not(.active) {
    color: rgba(255, 255, 255, 0.8);
}

/* ---- Loading ---- */

.loading {
    text-align: center;
    padding: 60px 0;
    color: rgba(255, 255, 255, 0.5);
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #333;
    border-top-color: #9747FF;
    border-radius: 50%;
    margin: 0 auto 16px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- Leaderboard Section ---- */

.leaderboard-section {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 28px 24px;
    margin-bottom: 24px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 24px;
    color: #fff;
}

/* ---- Podium ---- */

.podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
    padding: 0 20px;
}

.podium-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #232323;
    border-radius: 12px;
    padding: 20px 16px 16px;
    width: 140px;
    position: relative;
    transition: transform 0.2s;
}

.podium-card:hover {
    transform: translateY(-4px);
}

.podium-card.rank-1 {
    order: 2;
    padding-top: 28px;
    padding-bottom: 20px;
    min-height: 200px;
}

.podium-card.rank-2 {
    order: 1;
    min-height: 170px;
}

.podium-card.rank-3 {
    order: 3;
    min-height: 150px;
}

.podium-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
}

.rank-1 .podium-avatar {
    width: 68px;
    height: 68px;
    font-size: 26px;
    box-shadow: 0 0 0 3px #FFD700, 0 0 16px rgba(255, 215, 0, 0.3);
    background: linear-gradient(135deg, #3d3000, #1a1400);
}

.rank-2 .podium-avatar {
    box-shadow: 0 0 0 3px #C0C0C0, 0 0 12px rgba(192, 192, 192, 0.2);
    background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
}

.rank-3 .podium-avatar {
    box-shadow: 0 0 0 3px #CD7F32, 0 0 12px rgba(205, 127, 50, 0.2);
    background: linear-gradient(135deg, #2a1a08, #1a1000);
}

.podium-medal {
    position: absolute;
    top: -4px;
    right: -4px;
    font-size: 18px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.podium-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
    margin-bottom: 4px;
}

.podium-views {
    font-size: 14px;
    font-weight: 700;
    color: #9747FF;
}

/* ---- Rank List (4+) ---- */

.rank-list {
    display: flex;
    flex-direction: column;
}

.rank-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-radius: 8px;
    transition: background 0.15s;
}

.rank-item:nth-child(odd) {
    background: rgba(255, 255, 255, 0.02);
}

.rank-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.rank-number {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}

.rank-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
    padding: 0 12px;
}

.rank-views {
    font-size: 14px;
    font-weight: 600;
    color: #9747FF;
    text-align: right;
    flex-shrink: 0;
}

/* ---- Empty State ---- */

.empty-state {
    text-align: center;
    padding: 32px 0;
    color: rgba(255, 255, 255, 0.4);
    font-size: 14px;
}

/* ---- Last Updated ---- */

.last-updated {
    text-align: center;
    color: rgba(255, 255, 255, 0.3);
    font-size: 13px;
    padding: 16px 0;
}

/* ---- Live Views Stream Sidebar ---- */

.live-stream-sidebar {
    width: 300px;
    flex-shrink: 0;
    background: #1a1a1a;
    border-radius: 12px;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.live-stream-header {
    padding: 16px 20px;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.live-stream-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 0;
}

.live-stream-list::-webkit-scrollbar {
    width: 4px;
}

.live-stream-list::-webkit-scrollbar-track {
    background: transparent;
}

.live-stream-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.live-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    gap: 12px;
    transition: background 0.15s;
    animation: slide-in 0.4s ease-out;
}

@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.live-item:hover {
    background: rgba(255, 255, 255, 0.04);
}

.live-item-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #232323;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.7);
    flex-shrink: 0;
    border: 2px solid #333;
}

.live-item-info {
    flex: 1;
    min-width: 0;
}

.live-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.live-item-platform {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 1px;
}

.live-item-right {
    text-align: right;
    flex-shrink: 0;
}

.live-item-views {
    font-size: 13px;
    font-weight: 700;
    color: #22c55e;
}

.live-item-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 1px;
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
    .leaderboard-layout {
        flex-direction: column;
    }

    .live-stream-sidebar {
        width: 100%;
        position: static;
        max-height: 360px;
        order: -1;
    }
}

@media (max-width: 600px) {
    .leaderboard-screen {
        padding: 20px 16px 40px;
    }

    .leaderboard-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .leaderboard-title {
        font-size: 22px;
    }

    .podium {
        gap: 10px;
        padding: 0;
    }

    .podium-card {
        width: 100px;
        padding: 14px 10px 12px;
    }

    .podium-card.rank-1 {
        min-height: 160px;
    }

    .podium-card.rank-2 {
        min-height: 140px;
    }

    .podium-card.rank-3 {
        min-height: 125px;
    }

    .podium-avatar {
        width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .rank-1 .podium-avatar {
        width: 52px;
        height: 52px;
        font-size: 20px;
    }

    .podium-name {
        font-size: 12px;
        max-width: 80px;
    }

    .podium-views {
        font-size: 12px;
    }

    .leaderboard-section {
        padding: 20px 16px;
    }
}
