@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@500;600;700&display=swap');

:root {
    --bg-color: #0b0d12;
    --sidebar-bg: #11131a;
    --accent-color: #d32f2f; /* Degen Red */
    --accent-gradient: linear-gradient(135deg, #c62828 0%, #b71c1c 100%);
    --text-color: #ffffff;
    --text-secondary: #9ca3af;
    --border-color: #2a2d3e;
    --card-bg: #161922;
    --card-hover: #1c202b;
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
    --glow: 0 0 15px rgba(211, 47, 47, 0.4);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
    /* Subtle noise/texture overlay could be added here */
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.logo-area {
    margin-bottom: 50px;
    text-align: center;
}

.logo-placeholder {
    width: 70px;
    height: 70px;
    background: var(--accent-gradient);
    border-radius: 16px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 28px;
    color: #fff;
    box-shadow: var(--glow);
    transform: rotate(-3deg); /* Slight playfulness */
}

.logo-area h2 {
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1.4rem;
    margin: 0;
    background: linear-gradient(to right, #fff, #ccc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Sidebar Navigation */
nav {
    margin-top: 20px;
    flex-grow: 1;
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

nav li {
    margin-bottom: 5px;
}

nav a {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.95rem;
}

nav a:hover, nav li.active a {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(5px);
}

nav li.active a {
    background: linear-gradient(90deg, rgba(211, 47, 47, 0.1), transparent);
    border-left: 3px solid var(--accent-color);
    color: #fff;
}

.nav-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
    transition: all 0.2s;
}

nav a:hover .nav-icon, nav li.active .nav-icon {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 0 10px rgba(211, 47, 47, 0.4);
}

.sidebar-divider {
    height: 1px;
    background: rgba(255,255,255,0.05);
    margin: 20px 15px;
}

.sidebar-section-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    opacity: 0.5;
    padding: 0 15px;
    margin-bottom: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.footer-links {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.footer-links .btn-primary {
    width: 100%;
    padding: 10px;
    font-size: 0.9em;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85em;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--accent-color);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 50px;
    overflow-y: auto;
    background: radial-gradient(circle at top right, rgba(255, 152, 0, 0.03), transparent 40%);
}

.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
}

.top-bar h1 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0;
}

.btn-primary {
    background: var(--accent-gradient);
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 152, 0, 0.4);
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 60px;
    position: relative;
}

.hero-content h2 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 3.5em;
    font-weight: 700;
    margin: 0 0 15px;
    background: linear-gradient(to right, #fff 20%, #ccc 80%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-transform: uppercase;
    letter-spacing: -1px;
}

.hero-content p {
    font-size: 1.1em;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 40px;
}

.total-rewards {
    display: inline-block;
    background: rgba(255, 255, 255, 0.03);
    padding: 30px 60px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.total-rewards span {
    display: block;
    font-size: 0.85em;
    color: var(--accent-color);
    letter-spacing: 2px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.total-rewards h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 4em;
    line-height: 1;
    color: #fff;
    margin: 0;
    text-shadow: 0 0 30px rgba(255, 152, 0, 0.2);
}

/* Leaderboard Table */
.leaderboard-section {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.leaderboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-header h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    text-transform: uppercase;
    margin: 0;
}

.filters .filter-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: 8px;
    margin-left: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9em;
    transition: all 0.2s;
}

.filters .filter-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.filters .filter-btn.active {
    background-color: var(--accent-color);
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.3);
}

.leaderboard-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 8px; /* Space between rows */
}

.leaderboard-table th {
    padding: 15px 25px;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75em;
    letter-spacing: 1px;
}

.leaderboard-table td {
    padding: 20px 25px;
    background-color: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}

.leaderboard-table tr td:first-child {
    border-top-left-radius: 10px;
    border-bottom-left-radius: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.02);
}

.leaderboard-table tr td:last-child {
    border-top-right-radius: 10px;
    border-bottom-right-radius: 10px;
    border-right: 1px solid rgba(255, 255, 255, 0.02);
}

.leaderboard-table tr {
    transition: transform 0.2s;
}

.leaderboard-table tr:hover td {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.05);
}

.rank-1 { color: var(--gold); font-size: 1.2em; text-shadow: 0 0 10px rgba(255, 215, 0, 0.5); }
.rank-2 { color: var(--silver); font-size: 1.1em; }
.rank-3 { color: var(--bronze); font-size: 1.1em; }

/* Modal styling upgrade */
.modal {
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.form-group input {
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 12px;
}

.form-group input:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(255, 152, 0, 0.2);
}

/* Sidebar Submenu - Hidden for new design but kept for legacy support if needed */
.submenu {
    display: none !important; 
}

/* Top 3 Cards */
.top-three-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
    align-items: end;
}

.top-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.top-card.rank-1 {
    order: 2;
    border-color: var(--gold);
    background: linear-gradient(to bottom, rgba(255, 215, 0, 0.05), var(--card-bg));
    transform: scale(1.1);
    z-index: 2;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.15);
}

.top-card.rank-2 {
    order: 1;
    border-color: var(--silver);
    background: linear-gradient(to bottom, rgba(192, 192, 192, 0.05), var(--card-bg));
}

.top-card.rank-3 {
    order: 3;
    border-color: var(--bronze);
    background: linear-gradient(to bottom, rgba(205, 127, 50, 0.05), var(--card-bg));
}

.top-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.rank-1 .top-icon { color: var(--gold); text-shadow: 0 0 20px var(--gold); }
.rank-2 .top-icon { color: var(--silver); text-shadow: 0 0 20px var(--silver); }
.rank-3 .top-icon { color: var(--bronze); text-shadow: 0 0 20px var(--bronze); }

.top-rank-num {
    font-family: 'Rajdhani', sans-serif;
    font-size: 4rem;
    font-weight: 800;
    position: absolute;
    top: 10px;
    right: 20px;
    opacity: 0.1;
    line-height: 1;
}

.top-user {
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #fff;
}

.top-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 15px;
}

.top-stat-val {
    display: block;
    color: #fff;
    font-weight: 600;
    margin-top: 5px;
}

.rank-1 .top-stat-val { color: var(--gold); }
.rank-2 .top-stat-val { color: var(--silver); }
.rank-3 .top-stat-val { color: var(--bronze); }

/* Casino & Challenges Specifics */
.game-card, .challenge-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 20px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.game-card:hover, .challenge-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(211, 47, 47, 0.15);
}
