:root {
    --bg: #070B14;
    --bg2: #0E1628;
    --panel: rgba(17, 24, 39, .72);
    --panel2: rgba(25, 34, 55, .82);
    --border: rgba(255, 255, 255, .08);
    --text: #F8FAFC;
    --muted: #94A3B8;
    --primary: #7C3AED;
    --secondary: #2563EB;
    --cyan: #22D3EE;
    --success: #22C55E;
    --danger: #EF4444;
    --radius: 24px;
    --transition: .28s ease;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: Inter, sans-serif;
    background: 
        radial-gradient(circle at top left, #7C3AED20, transparent 30%),
        radial-gradient(circle at bottom right, #22D3EE15, transparent 35%),
        linear-gradient(180deg, #070B14, #0B1220);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    left: -300px;
    top: -300px;
    width: 700px;
    height: 700px;
    background: radial-gradient(circle, #7C3AED35, transparent 70%);
    filter: blur(90px);
    z-index: -2;
}

body::after {
    content: "";
    position: fixed;
    right: -250px;
    bottom: -250px;
    width: 650px;
    height: 650px;
    background: radial-gradient(circle, #22D3EE20, transparent 70%);
    filter: blur(100px);
    z-index: -2;
}

/* =======================
   HAMBURGER BUTTON
======================= */
.hamburger-btn {
    display: none;
    background: rgba(255, 255, 255, .03);
    border: 1px solid var(--border);
    color: var(--text);
    cursor: pointer;
    padding: 12px;
    border-radius: 14px;
    margin-right: 14px;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.hamburger-btn:hover {
    background: rgba(124, 58, 237, .15);
    border-color: rgba(124, 58, 237, .35);
}

/* =======================
   SIDEBAR
======================= */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    padding: 32px;
    background: linear-gradient(180deg, #080d18, #0b1323) !important;
    border-right: 1px solid var(--border);
    backdrop-filter: blur(24px);
    display: flex;
    flex-direction: column;
    box-shadow: 20px 0 60px rgba(0, 0, 0, .35);
    z-index: 2000;
}

.brand {
    text-align: center;
    margin-bottom: 38px;
}

.brand-logo {
    width: 125px;
    display: block;
    margin: auto;
    transition: .35s;
    filter: drop-shadow(0 0 25px rgba(124, 58, 237, .45));
}

.brand-logo:hover {
    transform: scale(1.04);
    filter: drop-shadow(0 0 35px rgba(37, 99, 235, .55));
}

.brand h2 {
    margin-top: 16px;
    font-size: 25px;
    font-weight: 800;
    letter-spacing: .4px;
}

.brand p {
    margin-top: 6px;
    font-size: 11px;
    letter-spacing: 3px;
    color: var(--muted);
}

.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 18px;
    border-radius: 18px;
    text-decoration: none;
    color: #CBD5E1;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
}

.sidebar nav a:hover {
    background: rgba(124, 58, 237, .15);
    color: #fff;
    transform: translateX(4px);
}

.sidebar nav a.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    box-shadow: 0 12px 35px rgba(124, 58, 237, .35);
}

/* =======================
   MAIN LAYOUT
======================= */
.main {
    margin-left: 260px;
    padding: 28px 34px 40px;
}

.topbar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: center;
    margin-bottom: 32px;
}

.top-left {
    flex: 1;
    display: flex;
    align-items: center;
}

.top-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 54px !important;
    max-width: 430px !important;
    padding: 14px 18px;
    background: rgba(255, 255, 255, .03) !important;
    border: 1px solid var(--border);
    border-radius: 18px;
}

.search-box svg {
    flex: 0 0 auto;
    color: #94A3B8;
}

.search-box input {
    flex: 1;
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-size: 15px;
}

.search-box input::placeholder {
    color: #7b8798;
}

.icon-btn {
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 14px;
    background: var(--panel);
    color: #fff;
    cursor: pointer;
    position: relative;
}

.notify-dot {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
}

.profile-menu {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 18px;
    min-width: 240px;
    justify-content: space-between;
}

.profile-menu img {
    width: 46px !important;
    height: 46px !important;
    border-radius: 50%;
    object-fit: cover;
    background: #1b2333;
}

.profile-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.dropdown-arrow {
    margin-left: auto;
    color: #94A3B8;
}

/* =======================
   HERO & BANNERS
======================= */
.welcome-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin: 24px 0 30px;
    padding: 22px 28px !important;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 24px;
}

.welcome-left h1 {
    font-size: 46px !important;
    line-height: 1.05;
    margin: 10px 0;
    max-width: 520px;
}

.welcome-left p {
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
    max-width: 520px;
}

.season-tag {
    display: inline-flex;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(124, 58, 237, .18);
    color: #c4b5fd;
    font-weight: 700;
}

.welcome-right {
    display: flex;
    gap: 16px;
}

.mini-card {
    background: rgba(255, 255, 255, .04);
    padding: 16px 18px;
    border-radius: 18px;
    min-width: 120px;
    text-align: center;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .22);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 2fr) 340px !important;
    gap: 24px !important;
    align-items: start;
    margin-bottom: 30px;
}

.hero-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-right: 10px;
}

.hero-side {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.hero-side .season-card-large {
    position: sticky;
    top: 28px;
}

.hero-card {
    background: var(--panel);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    border-radius: 28px;
    padding: 34px;
    position: relative;
    overflow: hidden;
}

.hero-buttons {
    display: flex;
    gap: 14px;
    margin-top: 28px;
}

.hero-info {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 14px;
    margin-top: 24px;
}

.hero-info > div {
    background: rgba(255, 255, 255, .04);
    padding: 16px;
    border-radius: 18px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .22);
}

.hero-info strong, .season-grid strong {
    display: block;
    font-size: 22px;
    margin-top: 6px;
}

.season-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    margin: 20px 0;
}

.season-card-large {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 28px;
}

/* =======================
   BUTTONS
======================= */
.wallet-btn, .hero-wallet, .primary {
    border: none;
    border-radius: 16px;
    padding: 15px 22px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.wallet-btn {
    height: 52px;
    padding: 0 24px !important;
    font-size: 15px;
    box-shadow: 0 15px 40px rgba(124, 58, 237, .35);
}

.wallet-btn:hover, .primary:hover, .hero-wallet:hover {
    transform: translateY(-3px);
    box-shadow: 0 22px 55px rgba(37, 99, 235, .45);
}

.secondary {
    padding: 15px 24px;
    border: none;
    border-radius: 16px;
    background: #1E293B;
    color: #fff;
    cursor: pointer;
    transition: var(--transition);
}

.secondary:hover {
    background: #26344E;
}

.hero-wallet {
    margin-top: 22px;
    width: 100%;
}

/* =======================
   STATS & PANELS
======================= */
.stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 22px;
    margin-bottom: 32px;
}

.stat-card {
    position: relative;
    overflow: hidden;
    padding: 26px;
    border-radius: 26px;
    background: var(--panel);
    border: 1px solid var(--border);
    backdrop-filter: blur(22px);
    transition: .3s;
    cursor: pointer;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .22);
}

.stat-card h4 {
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 12px;
}

.stat-card h2 {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 10px;
}

.stat-card small {
    color: var(--muted);
    font-size: 13px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 22px;
}

.panel {
    padding: 28px;
    border-radius: 26px;
    background: var(--panel);
    border: 1px solid var(--border);
    backdrop-filter: blur(20px);
    transition: .3s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .22);
}

.panel:hover, .stat-card:hover, .reward-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 22px 70px rgba(124, 58, 237, .18);
    border-color: rgba(124, 58, 237, .35);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* =======================
   PROGRESS
======================= */
.progress {
    height: 12px;
    background: #1F2937;
    border-radius: 999px;
    overflow: hidden;
    margin: 18px 0;
}

.fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--cyan));
    animation: xpMove 2s ease;
}

@keyframes xpMove {
    0% { width: 0; }
}

/* =======================
   QUEST & REWARD CARDS
======================= */
.quest-grid {
    display: grid;
    gap: 18px;
}

.quest-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: rgba(255, 255, 255, .03);
    padding: 20px !important;
    border-radius: 18px;
    border: 1px solid var(--border);
    transition: .25s;
}

.quest-card:hover {
    background: rgba(124, 58, 237, .08) !important;
}

.quest-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.quest-body {
    flex: 1;
}

.reward-tag {
    display: inline-block;
    margin-top: 10px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(124, 58, 237, .15);
    color: #c4b5fd;
    font-size: 12px;
    font-weight: 700;
}

.reward-card {
    padding: 24px;
    margin-top: 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, #19243A, #101827);
    border: 1px solid rgba(255, 255, 255, .06);
    transition: .3s;
    position: relative;
    overflow: hidden;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .22);
}

.reward-card h3 {
    font-size: 22px;
    margin-bottom: 8px;
}

.reward-card p {
    font-size: 14px;
    line-height: 1.8;
    color: var(--muted);
    margin-bottom: 18px;
}

/* =======================
   LEADERBOARD & ACTIVITY
======================= */
.dashboard-bottom {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 22px;
    margin-top: 22px;
    margin-bottom: 40px;
}

.activity-item {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.leaderboard-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    margin-bottom: 18px;
    border-radius: 22px;
    background: var(--panel);
    border: 1px solid var(--border);
    transition: .3s;
}

.leaderboard-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(37, 99, 235, .18);
}

/* =======================
   PROFILE
======================= */
.profile-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 24px;
    margin-top: 30px;
}

.profile-sidebar {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 30px;
    text-align: center;
    backdrop-filter: blur(22px);
}

.profile-avatar {
    width: 140px;
    height: 140px;
    margin: auto;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid rgba(124, 58, 237, .35);
    box-shadow: 0 0 40px rgba(124, 58, 237, .25);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.profile-box {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 22px;
    padding: 24px;
}

/* =======================
   SETTINGS
======================= */
.settings-group {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 22px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .05);
}

.setting-item:last-child {
    border: none;
}

/* =======================
   MISC (Switch, Toast)
======================= */
.switch {
    position: relative;
    width: 56px;
    height: 30px;
}

.switch input {
    display: none;
}

.slider {
    position: absolute;
    inset: 0;
    background: #1F2937;
    border-radius: 999px;
    cursor: pointer;
    transition: .3s;
}

.slider:before {
    content: "";
    position: absolute;
    left: 4px;
    top: 4px;
    width: 22px;
    height: 22px;
    background: white;
    border-radius: 50%;
    transition: .3s;
}

.switch input:checked + .slider {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.switch input:checked + .slider:before {
    transform: translateX(26px);
}

.toast {
    position: fixed;
    right: 25px;
    top: 25px;
    min-width: 300px;
    padding: 18px 22px;
    border-radius: 18px;
    background: rgba(17, 24, 39, .95);
    border: 1px solid rgba(255, 255, 255, .08);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
    z-index: 9999;
    opacity: 0;
    transform: translateY(-15px);
    transition: .3s;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success { border-left: 5px solid #22C55E; }
.toast.error { border-left: 5px solid #EF4444; }

body.dark-mode {
    --bg: #05070D;
    --panel: rgba(10, 15, 25, .88);
    --panel2: rgba(15, 20, 32, .92);
    --border: rgba(255, 255, 255, .05);
    --text: #FFFFFF;
    --muted: #9CA3AF;
}

/* ==========================
   SCROLLBAR
========================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0B1220;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #8B5CF6, #3B82F6);
}

/* ==========================
   ANIMATIONS
========================== */
@keyframes floating {
    0% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}

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

@keyframes pulseGlow {
    0% { box-shadow: 0 0 0 rgba(124, 58, 237, .2); }
    50% { box-shadow: 0 0 30px rgba(124, 58, 237, .25); }
    100% { box-shadow: 0 0 0 rgba(124, 58, 237, .2); }
}

.hero-side { animation: floating 6s ease-in-out infinite; }
.hero, .stats, .dashboard-grid, .profile-layout { animation: fadeUp .6s ease; }
.wallet-btn { animation: pulseGlow 3s infinite; }

/* ==========================
   MEDIA QUERIES (RESPONSIVE)
========================== */

/* LAPTOP / SMALL DESKTOP */
@media (max-width: 1200px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
    .hero { grid-template-columns: 1fr !important; }
    .hero-side { margin-top: 20px; }
    .profile-layout { grid-template-columns: 1fr; }
    .search-box { max-width: none !important; }
}

@media (max-width: 1100px) {
    .welcome-banner, .dashboard-bottom, .hero { grid-template-columns: 1fr; display: block; }
    .welcome-right { margin-top: 20px; flex-wrap: wrap; }
    .hero-info { grid-template-columns: 1fr; }
}

/* MOBILE (HP) */
@media (max-width: 768px) {
    body { display: block; }
    
    .hamburger-btn {
        display: flex;
    }
    
    .sidebar {
        position: fixed;
        left: -300px;
        top: 0;
        width: 260px !important;
        height: 100vh;
        padding: 32px;
        background: linear-gradient(180deg, #080d18, #0b1323) !important;
        border-right: 1px solid var(--border);
        backdrop-filter: blur(24px);
        display: flex;
        flex-direction: column;
        box-shadow: 20px 0 60px rgba(0, 0, 0, .6) !important;
        z-index: 2500;
        transition: left 0.3s ease;
    }
    
    .sidebar.show-sidebar {
        left: 0;
    }
    
    .brand h2, .brand p { display: block; }
    
    .sidebar nav {
        flex-direction: column !important;
        overflow-x: hidden !important;
        justify-content: flex-start;
        gap: 10px;
    }
    
    .sidebar nav a {
        flex-shrink: 0;
        white-space: nowrap;
        padding: 15px 18px;
        font-size: 14px;
        border-radius: 18px;
    }
    
    .sidebar nav a span {
        display: inline-block !important;
        font-size: 14px;
    }
    
    .main {
        margin-left: 0;
        padding: 20px;
    }
    
    .topbar {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .top-left {
        width: 100%;
        display: flex;
        align-items: center;
    }
    
    .search-box {
        max-width: none !important;
        width: 100%;
    }
    
    .top-right {
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .profile-menu {
        min-width: unset;
        flex: 1;
    }
    
    .stats { grid-template-columns: 1fr; }
    .hero-buttons { flex-direction: column; }
    .wallet-btn, .primary, .secondary, .hero-wallet { width: 100%; }
    .profile-stats { grid-template-columns: 1fr; }
    
    /* Settings Page Fix for Mobile */
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .setting-item button {
        width: 100%;
    }
    
    /* Pengecualian untuk Dark Mode switch agar tetap sebaris */
    .setting-item:has(.switch) {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }
}

/* EXTRA SMALL MOBILE */
@media (max-width: 480px) {
    .hero-card, .panel, .stat-card, .profile-sidebar, .reward-card {
        padding: 20px;
    }
    .welcome-left h1 { font-size: 32px !important; }
}