/* ========================================
   VALSTATS - DESIGN PREMIUM VIOLET
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --violet-50: #f5f3ff;
    --violet-100: #ede9fe;
    --violet-200: #ddd6fe;
    --violet-300: #c4b5fd;
    --violet-400: #a78bfa;
    --violet-500: #8b5cf6;
    --violet-600: #7c3aed;
    --violet-700: #6d28d9;
    --violet-800: #5b21b6;
    --violet-900: #4c1d95;
    --violet-950: #2e1065;
    
    --dark-100: #1a1a2e;
    --dark-200: #16213e;
    --dark-300: #0f0f1a;
    --dark-400: #0a0a0f;
    --dark-500: #050508;
    
    --gray-100: #f5f5f5;
    --gray-200: #e5e5e5;
    --gray-300: #d4d4d4;
    --gray-400: #a3a3a3;
    --gray-500: #737373;
    --gray-600: #525252;
    --gray-700: #404040;
    --gray-800: #262626;
    --gray-900: #171717;
    
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    
    --glow-violet: 0 0 20px rgba(139, 92, 246, 0.4);
    --glow-violet-strong: 0 0 30px rgba(139, 92, 246, 0.6);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: radial-gradient(ellipse at top, var(--dark-200), var(--dark-500));
    color: var(--gray-200);
    min-height: 100vh;
    scroll-behavior: smooth;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== HEADER PREMIUM ========== */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-img {
    height: 48px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}

.logo-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--violet-400), var(--violet-600));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
}

.nav {
    display: none;
    gap: 8px;
}

@media (min-width: 768px) {
    .nav {
        display: flex;
    }
}

.nav-link {
    text-decoration: none;
    color: var(--gray-400);
    font-weight: 500;
    padding: 10px 18px;
    border-radius: 12px;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link:hover {
    color: var(--violet-400);
    background: rgba(139, 92, 246, 0.1);
}

.nav-link.active {
    color: var(--violet-400);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(124, 58, 237, 0.08));
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.credit {
    font-size: 13px;
    color: var(--gray-600);
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 14px;
    border-radius: 40px;
    letter-spacing: 0.5px;
}

/* ========== MAIN CONTENT ========== */
.main {
    padding: 48px 0 64px;
    min-height: calc(100vh - 160px);
}

/* ========== GLASS CARDS ========== */
.glass-card {
    background: linear-gradient(135deg, rgba(23, 23, 35, 0.7), rgba(15, 15, 26, 0.6));
    backdrop-filter: blur(16px);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 28px;
    padding: 28px;
    transition: all var(--transition-normal);
}

.glass-card:hover {
    border-color: rgba(139, 92, 246, 0.35);
    transform: translateY(-2px);
    box-shadow: var(--glow-violet);
}

/* ========== TYPOGRAPHY ========== */
.page-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--violet-400), var(--violet-500), var(--violet-600));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 20px;
    letter-spacing: -1px;
}

.section-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 700;
    color: var(--violet-400);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ========== SEARCH COMPONENT ========== */
.search-box {
    display: flex;
    gap: 12px;
}

.search-input {
    flex: 1;
    background: rgba(23, 23, 35, 0.9);
    border: 1px solid var(--gray-800);
    border-radius: 60px;
    padding: 14px 22px;
    color: white;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: all var(--transition-fast);
}

.search-input:focus {
    border-color: var(--violet-500);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
}

.search-btn {
    background: linear-gradient(135deg, var(--violet-500), var(--violet-600));
    color: white;
    font-weight: 600;
    padding: 14px 32px;
    border: none;
    border-radius: 60px;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 15px;
}

.search-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--glow-violet);
}

/* ========== STATS GRID ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
    margin: 28px 0;
}

@media (min-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.stat-card {
    text-align: center;
    padding: 24px;
}

.stat-label {
    color: var(--gray-500);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 42px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--violet-400), var(--violet-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-family: 'Space Grotesk', sans-serif;
}

/* ========== ITEMS LIST ========== */
.items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(139, 92, 246, 0.1);
}

.item-name {
    font-weight: 600;
}

.item-price {
    color: var(--success);
    font-weight: 700;
}

/* ========== MARKET PAGE ========== */
.market-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 28px;
    margin-top: 20px;
}

@media (min-width: 992px) {
    .market-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.confidence-card {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.12), rgba(124, 58, 237, 0.06));
    border: 1px solid rgba(139, 92, 246, 0.35);
    border-radius: 28px;
    padding: 24px;
    text-align: center;
    margin: 24px 0;
}

.confidence-value {
    font-size: 56px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--violet-400), var(--violet-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-family: 'Space Grotesk', sans-serif;
}

/* ========== GPS TABLE ========== */
.table-wrapper {
    overflow-x: auto;
    border-radius: 20px;
}

.data-table {
    width: 100%;
    text-align: left;
    font-size: 14px;
}

.data-table th {
    padding: 16px 16px;
    color: var(--violet-400);
    border-bottom: 1px solid rgba(139, 92, 246, 0.2);
    font-weight: 700;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.data-table tr:hover {
    background: rgba(139, 92, 246, 0.05);
}

.tp-btn {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(124, 58, 237, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.4);
    color: var(--violet-400);
    padding: 8px 18px;
    border-radius: 40px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.tp-btn:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.35), rgba(124, 58, 237, 0.2));
    transform: scale(1.02);
}

/* ========== LEADERBOARDS ========== */
.leaderboard-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 28px;
}

@media (min-width: 768px) {
    .leaderboard-grid {
        grid-template-columns: 280px 1fr;
    }
}

.boards-list {
    max-height: 500px;
    overflow-y: auto;
}

.board-btn {
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 14px 16px;
    border-radius: 16px;
    color: var(--gray-300);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.board-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--violet-400);
}

.board-btn.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(124, 58, 237, 0.1));
    color: var(--violet-400);
    border-left: 3px solid var(--violet-500);
}

.period-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.period-btn {
    background: rgba(23, 23, 35, 0.9);
    border: 1px solid var(--gray-800);
    padding: 10px 24px;
    border-radius: 60px;
    color: var(--gray-400);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.period-btn.active {
    background: linear-gradient(135deg, var(--violet-500), var(--violet-600));
    border-color: transparent;
    color: white;
}

.entry-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.entry-rank {
    font-weight: 800;
    color: var(--violet-400);
    width: 60px;
}

.entry-name {
    flex: 1;
    text-decoration: none;
    color: white;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.entry-name:hover {
    color: var(--violet-400);
}

.entry-score {
    font-weight: 700;
    color: var(--violet-400);
}

/* ========== PROFILE PAGE ========== */
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.profile-name {
    font-size: 36px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--violet-400), var(--violet-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    border-radius: 60px;
    font-size: 13px;
    font-weight: 700;
}

.status-online {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: var(--success);
}

.status-offline {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--error);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 1.5s infinite;
}

.dot-offline {
    background: var(--error);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.9); }
}

.profile-info-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 20px;
    margin-top: 24px;
}

@media (min-width: 768px) {
    .profile-info-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.info-label {
    color: var(--gray-500);
    font-size: 13px;
    margin-bottom: 6px;
}

.info-value {
    font-weight: 600;
    font-size: 18px;
}

/* ========== ECONOMY PAGE ========== */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

@media (min-width: 768px) {
    .kpi-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.kpi-card {
    text-align: center;
    padding: 24px 16px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--violet-400), var(--violet-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-family: 'Space Grotesk', sans-serif;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 28px;
    margin-bottom: 32px;
}

@media (min-width: 992px) {
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.chart-card {
    padding: 20px;
}

/* ========== RULES PAGE ========== */
.rules-card {
    padding: 32px;
}

.rules-section {
    margin-bottom: 32px;
}

.rules-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--violet-400);
    margin-bottom: 16px;
    font-family: 'Space Grotesk', sans-serif;
}

.rules-list {
    list-style: none;
    padding-left: 0;
}

.rules-list li {
    padding: 8px 0 8px 24px;
    position: relative;
    color: var(--gray-300);
    line-height: 1.6;
}

.rules-list li::before {
    content: "◆";
    color: var(--violet-500);
    position: absolute;
    left: 0;
}

.rules-footer {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(124, 58, 237, 0.05));
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    margin-top: 24px;
    color: var(--violet-400);
    font-weight: 500;
}

/* ========== FOOTER ========== */
.footer {
    border-top: 1px solid rgba(139, 92, 246, 0.15);
    background: rgba(10, 10, 15, 0.9);
    backdrop-filter: blur(12px);
    padding: 28px 0;
}

.footer-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--gray-500);
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
    }
}

.footer-links {
    display: flex;
    gap: 28px;
}

.footer-links a {
    text-decoration: none;
    color: var(--gray-500);
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--violet-400);
}

/* ========== UTILITIES ========== */
.loading {
    text-align: center;
    padding: 60px;
    font-size: 18px;
    background: linear-gradient(135deg, var(--violet-400), var(--violet-500));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: pulse 1s infinite;
}

.error-message {
    text-align: center;
    padding: 40px;
    color: var(--error);
    background: rgba(239, 68, 68, 0.1);
    border-radius: 20px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--dark-400);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--violet-700);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--violet-500);
}