/* ========================================
   DASHBOARD RANKING - DEEP BLUE THEME
======================================== */

:root {
    /* Color Palette */
    --bg-dark: #0f1020;
    --bg-card: #15162c;
    --bg-card-hover: #1e1f3a;
    --text-primary: #ffffff;
    --text-secondary: #a0a0b0;

    /* Accents */
    --accent-blue: #4d49ff;
    --accent-blue-light: #6c69ff;
    --accent-purple: #7f5aff;
    --accent-pink: #ff4b8b;
    --accent-gold: #ffb800;
    /* 1st Place */
    --accent-silver: #e0e0e0;
    /* 2nd Place */
    --accent-bronze: #cd7f32;
    /* 3rd Place */

    /* Gradients */
    --gradient-bg: linear-gradient(135deg, #0f1020 0%, #090a15 100%);
    --gradient-card: linear-gradient(145deg, #1a1b35 0%, #15162c 100%);
    --gradient-blue-bar: linear-gradient(90deg, #5e5aff 0%, #4d49ff 100%);
    --gradient-podium-1: linear-gradient(to top, #ffb800, #ffdb58);
    --gradient-podium-2: linear-gradient(to bottom, #15162c, #2a2b4e);

    /* Stats Colors */
    --stat-blue: #5e5aff;
    --stat-green: #00d2a0;
    --stat-cyan: #00e0ff;

    /* Spacing */
    --sidebar-width: 80px;

    /* Fonts */
    --font-primary: 'Poppins', sans-serif;
    --font-secondary: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-secondary);
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    /* App-like feel */
    height: 100vh;
}

.app-container {
    display: flex;
    height: 100vh;
}

.is-hidden {
    display: none !important;
}

/* Auth Overlay */
.auth-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top right, rgba(31, 33, 64, 0.9), rgba(15, 16, 32, 0.95));
    z-index: 1100;
    padding: 24px;
}

.auth-card {
    width: min(420px, 92vw);
    background: var(--bg-card);
    border-radius: 20px;
    padding: 32px 28px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.auth-header {
    margin-bottom: 20px;
}

.auth-kicker {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-secondary);
    display: inline-block;
    margin-bottom: 10px;
}

.auth-header h2 {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-input {
    background: #0f1020;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: var(--font-secondary);
}

.auth-input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 2px rgba(77, 73, 255, 0.25);
}

.auth-button {
    margin-top: 6px;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #4d49ff, #7f5aff);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(77, 73, 255, 0.35);
}

.auth-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.auth-message {
    min-height: 18px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.auth-message.is-error {
    color: #ff6b6b;
}

.auth-message.is-success {
    color: #6fe7b7;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 16, 32, 0.78);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 1000;
}

.loading-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.loading-card {
    background: transparent;
    border-radius: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 0;
    box-shadow: none;
    width: 100%;
    height: 100%;
}

.loading-animation {
    width: min(70vh, 90vw);
    height: min(70vh, 90vw);
}

.loading-text {
    font-family: var(--font-primary);
    font-size: 0.78rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

/* ========================================
   SIDEBAR
======================================== */
.sidebar {
    width: var(--sidebar-width);
    background: #111224;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    z-index: 10;
}

.sidebar-top,
.sidebar-bottom {
    margin-bottom: auto;
}

.sidebar-bottom {
    margin-bottom: 0;
    margin-top: auto;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 10px;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 40px;
    position: relative;
}

.nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px;
    border-radius: 12px;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-item:hover,
.nav-item.active {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.1);
}

.nav-item.active {
    background: linear-gradient(135deg, #4d49ff 0%, #2a26ff 100%);
    box-shadow: 0 4px 15px rgba(77, 73, 255, 0.4);
}

.material-icons-round {
    font-size: 24px;
}

/* ========================================
   MAIN CONTENT
======================================== */
.main-content {
    flex: 1;
    padding: 30px 50px;
    overflow-y: auto;
    background: radial-gradient(circle at top right, #1f2140 0%, #0f1020 60%);
}

/* Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 30px;
}

.header-title h1 {
    font-family: var(--font-primary);
    font-weight: 700;
    letter-spacing: 1px;
    font-size: 1.8rem;
    text-transform: uppercase;
    background: linear-gradient(to right, #fff, #a0a0b0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.best-perfomer-card {
    background: linear-gradient(90deg, #5e5aff, #9b5aff);
    padding: 20px 30px;
    border-radius: 16px;
    color: white;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(94, 90, 255, 0.3);
    position: relative;
    overflow: hidden;
}

.best-text {
    font-size: 1.1rem;
    line-height: 1.5;
}

.best-text strong {
    font-weight: 700;
    color: #ffd700;
    /* Gold highlight */
}

/* Top Stats */
.top-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr) 200px;
    /* 3 cards + illustration space */
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: #1a1b32;
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-card:hover {
    transform: translateY(-5px);
    background: #20213d;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.stat-card.blue .stat-icon {
    background: var(--stat-blue);
    box-shadow: 0 4px 15px rgba(94, 90, 255, 0.3);
}

.stat-card.green .stat-icon {
    background: var(--stat-green);
    box-shadow: 0 4px 15px rgba(0, 210, 160, 0.3);
}

.stat-card.cyan .stat-icon {
    background: var(--stat-cyan);
    box-shadow: 0 4px 15px rgba(0, 224, 255, 0.3);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: var(--font-primary);
}

.illustration-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.illustration {
    width: 150px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
}

/* ========================================
   DASHBOARD GRID (Ranking)
======================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 4fr 5fr;
    /* Podium width vs Table width */
    gap: 40px;
    align-items: flex-end;
    /* Align bottom of podium and table */
}

/* Podium Section */
.podium-section {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 20px;
    position: relative;
}

.podium-container {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    width: 100%;
}

.podium-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.podium-item.first {
    order: 2;
    z-index: 3;
}

.podium-item.second {
    order: 1;
    z-index: 2;
}

.podium-item.third {
    order: 3;
    z-index: 1;
}

.avatar-container {
    position: relative;
    margin-bottom: 15px;
}

.podium-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid transparent;
}

.podium-avatar.lg {
    width: 110px;
    height: 110px;
}

.avatar-ring {
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 2px solid;
}

.first .avatar-ring {
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(255, 184, 0, 0.4);
}

.second .avatar-ring {
    border-color: var(--accent-silver);
}

.third .avatar-ring {
    border-color: var(--accent-bronze);
}

.crown-icon {
    position: absolute;
    top: -30px;
    font-size: 2rem;
    animation: bounce 2s infinite;
}

.rank-badge {
    position: absolute;
    bottom: -10px;
    background: #1a1b32;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
}

.rank-badge.lg {
    font-size: 1.2rem;
    padding: 4px 16px;
    bottom: -15px;
}

/* Pedestals */
.podium-base {
    width: 100%;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    position: relative;
    transition: height 0.5s ease;
}

/* Heights and Colors */
.first-base {
    height: 280px;
    background: linear-gradient(180deg, #ffb800 0%, #d49800 100%);
    box-shadow: 0 0 30px rgba(255, 184, 0, 0.2);
}

.second-base {
    height: 180px;
    background: linear-gradient(180deg, #5e5aff 0%, #3d39db 100%);
    box-shadow: 0 0 20px rgba(94, 90, 255, 0.2);
}

.third-base {
    height: 120px;
    background: linear-gradient(180deg, #6c69ff 0%, #4d49ff 100%);
    opacity: 0.9;
}

.podium-info {
    text-align: center;
    padding: 10px;
}

.podium-info h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
}

.first-base h3 {
    font-size: 1.1rem;
}

.podium-value {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 2px;
}

.podium-percent {
    font-size: 0.8rem;
    opacity: 0.8;
}

.medal-icon,
.trophy-icon {
    font-size: 3rem;
    margin-top: auto;
    margin-bottom: 20px;
    opacity: 0.5;
}

.trophy-icon {
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
}

/* ========================================
   LEADERBOARD TABLE
======================================== */
.leaderboard-section {
    background: #121325;
    border-radius: 16px;
    overflow: hidden;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.table-header {
    display: flex;
    padding: 15px 20px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.th-rank {
    width: 40px;
    text-align: center;
}

.th-pic {
    width: 60px;
    text-align: center;
}

.th-name {
    flex: 1;
    padding-left: 20px;
}

.th-rev {
    width: 150px;
    text-align: right;
}

.th-pct {
    width: 80px;
    text-align: right;
}

.table-body {
    max-height: 480px;
    overflow-y: auto;
}

.table-row {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    margin: 5px 0;
    border-radius: 8px;
    transition: 0.2s;
    cursor: default;
}

.table-row:hover {
    background: #1a1b32;
}

.td-rank {
    width: 40px;
    text-align: center;
    font-weight: 600;
    color: var(--text-secondary);
}

.td-pic {
    width: 60px;
    display: flex;
    justify-content: center;
}

.table-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.td-name {
    flex: 1;
    padding-left: 20px;
    font-weight: 500;
    color: white;
}

.td-rev {
    width: 150px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.rev-bar-container {
    width: 100%;
    height: 25px;
    /* height of the bar container */
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
}

.rev-val-text {
    position: absolute;
    right: 5px;
    z-index: 2;
    font-size: 0.85rem;
    font-weight: 600;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.rev-bar {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 4px;
    opacity: 0.8;
}

.td-pct {
    width: 80px;
    text-align: right;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Scrollbar Style */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}
