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

:root {
    --primary: #007BFF;
    --primary-light: #0A84FF;
    --primary-dark: #0059C9;
    --accent-glow: #EAF5FF;
    
    --canvas-bg: #F8FAFC;
    --surface-solid: #FFFFFF;
    --text-core: #0F172A;
    --text-muted: #64748B;
    --border-rgb: rgba(0, 123, 255, 0.08);
    
    --glass-plate: rgba(255, 255, 255, 0.75);
    --glass-rim: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 12px 40px rgba(0, 40, 120, 0.04);
    --premium-linear: linear-gradient(135deg, #0059C9 0%, #0A84FF 100%);
    --card-linear: linear-gradient(180deg, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.75) 100%);
    
    --radius-squircle: 20px;
    --radius-pill: 30px;
    --speed-fluid: 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

body.dark-mode {
    --canvas-bg: #040812;
    --surface-solid: #0A0F1D;
    --text-core: #F8FAFC;
    --text-muted: #94A3B8;
    --border-rgb: rgba(255, 255, 255, 0.05);
    --glass-plate: rgba(10, 15, 29, 0.75);
    --glass-rim: rgba(255, 255, 255, 0.05);
    --glass-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    --card-linear: linear-gradient(180deg, rgba(16, 24, 45, 0.95) 0%, rgba(10, 15, 29, 0.8) 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--canvas-bg);
    color: var(--text-core);
    overflow-x: hidden;
    transition: background-color var(--speed-fluid), color var(--speed-fluid);
}

.app-container {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    padding: 20px 16px 100px 16px;
}

/* Premium Lucide Vector Icon Alignments */
.lucide {
    width: 22px;
    height: 22px;
    stroke-width: 2.2px;
    display: inline-block;
    vertical-align: middle;
}

.glass-card {
    background: var(--card-linear);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-rim);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-squircle);
}

.glass-header {
    background: var(--glass-plate);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--glass-rim);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px 24px 4px;
}

.header-user-block {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-circle {
    width: 48px;
    height: 48px;
    background: var(--premium-linear);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 18px;
}

.user-meta-text { display: flex; flex-direction: column; }
.welcome-tag { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.user-display-name { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.header-actions { display: flex; align-items: center; gap: 10px; }

.circle-action-btn {
    width: 44px;
    height: 44px;
    background: var(--surface-solid);
    border: 1px solid var(--border-rgb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-core);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.notif-container { position: relative; }
.badge-dot {
    position: absolute; top: 12px; right: 12px;
    width: 8px; height: 8px; background: #EF4444;
    border-radius: 50%; animation: pulseGlow 2s infinite;
}

.notif-dropdown {
    position: absolute; top: 55px; right: 0; width: 280px;
    padding: 16px; z-index: 500; opacity: 0; visibility: hidden;
    transform: translateY(-10px);
}
.notif-dropdown.active { opacity: 1; visibility: visible; transform: translateY(0); }
.notif-dropdown h3 { font-size: 14px; margin-bottom: 12px; font-weight: 700; }
.notif-row { padding: 10px 4px; font-size: 12px; border-bottom: 1px solid var(--border-rgb); color: var(--text-muted); }

.announcement-banner {
    width: 100%; overflow: hidden; background: var(--accent-glow);
    border-radius: 12px; padding: 10px 16px; margin-bottom: 24px;
}
body.dark-mode .announcement-banner { background: rgba(0, 123, 255, 0.08); }
.announcement-track { display: flex; transition: transform 0.6s ease; }
.announcement-item { min-width: 100%; text-align: center; font-size: 12px; font-weight: 600; color: var(--primary-dark); }
body.dark-mode .announcement-item { color: var(--primary-light); }

.wallet-balance-section { text-align: center; padding: 10px 0 24px 0; }
.balance-label { font-size: 14px; color: var(--text-muted); font-weight: 500; }
.main-balance-display { font-size: 40px; font-weight: 800; letter-spacing: -1px; margin: 4px 0 10px 0; }

.shimmer-effect {
    background: linear-gradient(90deg, var(--text-core) 0%, var(--text-muted) 50%, var(--text-core) 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: textShimmer 4s linear infinite;
}

.package-status-badge {
    display: inline-block; background: #FEF3C7; color: #D97706;
    padding: 6px 14px; border-radius: 30px; font-size: 12px; font-weight: 700;
}
body.dark-mode .package-status-badge { background: rgba(217, 119, 6, 0.15); color: #FBBF24; }

/* Task Earnings Module - Matches 1002194991_2.jpg clean styling natively */
.task-earnings-container {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.06) 0%, rgba(99, 102, 241, 0.06) 100%);
    border: 1px solid rgba(168, 85, 247, 0.12);
    border-radius: 24px; padding: 16px 20px;
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 28px; cursor: pointer;
}
.task-left { display: flex; align-items: center; gap: 14px; }
.task-icon-circle {
    width: 46px; height: 46px; background: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.08);
}
body.dark-mode .task-icon-circle { background: #1E1B4B; }
.purple-icon { color: #8B5CF6; width: 20px; height: 20px; }
.task-text-info { display: flex; flex-direction: column; }
.task-title { font-size: 11px; color: #8B5CF6; font-weight: 700; letter-spacing: 0.5px; }
.task-amount { font-size: 20px; font-weight: 800; color: var(--text-core); margin-top: 2px; }
.task-arrow {
    color: #8B5CF6; width: 32px; height: 32px; background: rgba(255,255,255,0.8);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
}
body.dark-mode .task-arrow { background: rgba(0,0,0,0.2); }
.task-arrow .lucide { width: 16px; height: 16px; }

/* Quick Actions Grid Module System */
.quick-actions-section {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 12px; margin-bottom: 32px;
}

.squircle-action-wrapper { display: flex; flex-direction: column; align-items: center; text-align: center; cursor: pointer; }
.squircle-card {
    width: 60px; height: 60px; background: var(--surface-solid);
    border-radius: 18px; display: flex; align-items: center; justify-content: center;
    color: var(--primary); box-shadow: 0 6px 16px rgba(0, 40, 120, 0.02);
    border: 1px solid var(--border-rgb); transition: var(--speed-fluid);
}
.squircle-card .lucide { width: 24px; height: 24px; }
.squircle-action-wrapper:hover .squircle-card { transform: translateY(-3px); border-color: var(--primary-light); }
.squircle-card.state-highlight { background: var(--primary); color: white; border: none; }
.squircle-label { font-size: 11px; font-weight: 600; color: var(--text-muted); margin-top: 8px; }

/* Cashback Bonus Card */
.cashback-hero-card { padding: 24px; margin-bottom: 32px; display: flex; flex-direction: column; gap: 16px; }
.cb-upper { display: flex; align-items: center; gap: 16px; }
.cb-details { display: flex; flex-direction: column; }
.cb-tag { font-size: 13px; color: var(--text-muted); font-weight: 500; }
.cb-value { font-size: 28px; font-weight: 800; color: var(--primary-light); }
.claim-cb-btn {
    width: 100%; background: var(--primary); color: white; border-radius: 14px;
    padding: 14px; font-weight: 700; font-size: 14px; border: none;
}

/* Functional Stream Grid Framework with Vector Consistency */
.block-title { font-size: 18px; font-weight: 800; margin-bottom: 20px; letter-spacing: -0.3px; }
.modules-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 36px; }
.module-card { padding: 22px 14px; text-align: center; position: relative; cursor: pointer; }
.module-card:hover { transform: translateY(-3px); border-color: var(--primary-light); }
.module-badge {
    position: absolute; top: 10px; right: 10px; background: rgba(0, 123, 255, 0.1);
    color: var(--primary-light); font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 6px;
}
.module-icon { color: var(--primary-light); margin-bottom: 12px; }
.module-icon .lucide { width: 28px; height: 28px; stroke-width: 1.8px; }
.module-title { font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.module-desc { font-size: 11px; color: var(--text-muted); line-height: 1.4; }

/* Analytics Grid Layout Infrastructure */
.analytics-layout-grid { display: flex; flex-direction: column; gap: 20px; }
.info-block { padding: 24px; }
.card-heading { font-size: 15px; font-weight: 700; margin-bottom: 16px; }

.premium-input-pills {
    display: flex; background: var(--canvas-bg); border: 1px solid var(--border-rgb);
    border-radius: 14px; padding: 6px; align-items: center; margin-bottom: 16px;
}
.premium-input-pills input {
    flex: 1; background: transparent; border: none; font-size: 13px;
    color: var(--text-core); font-weight: 600; padding: 0 10px;
}
.premium-input-pills button {
    background: var(--primary-dark); color: white; border-radius: 10px;
    padding: 10px 20px; font-weight: 700; font-size: 13px; border: none;
}

.referral-metrics-row { display: flex; justify-content: space-between; gap: 8px; }
.metric-box { flex: 1; background: var(--surface-solid); border: 1px solid var(--border-rgb); padding: 12px 6px; border-radius: 12px; text-align: center; }
.metric-box span { font-size: 11px; color: var(--text-muted); display: block; margin-bottom: 4px; }
.metric-box strong { font-size: 14px; color: var(--text-core); }

.bar-outer { width: 100%; height: 8px; background: var(--border-rgb); border-radius: 20px; overflow: hidden; margin-bottom: 10px; }
.bar-inner { height: 100%; background: var(--premium-linear); border-radius: 20px; transition: width 1.2s ease; }
.bar-metrics { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); font-weight: 600; }

.leaderboard-ranking-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.leaderboard-ranking-list li { display: flex; align-items: center; gap: 14px; }
.position { width: 28px; height: 28px; border-radius: 50%; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.position.gold { background: #FEF3C7; color: #D97706; }
.position.silver { background: #F1F5F9; color: #475569; }
.position.bronze { background: #FFEDD5; color: #EA580C; }
.leaderboard-ranking-list .name { font-size: 14px; font-weight: 600; }

.app-footer { text-align: center; padding: 32px 0 12px 0; font-size: 12px; color: var(--text-muted); }

/* Fixed Mobile Navigation Bar Engine */
.bottom-navigation-bar {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 68px;
    display: flex; justify-content: space-around; align-items: center;
    z-index: 900; border-top: 1px solid var(--border-rgb);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.02);
}
.nav-tab-item { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-muted); text-decoration: none; }
.nav-tab-icon .lucide { width: 20px; height: 20px; stroke-width: 2px; }
.nav-tab-label { font-size: 10px; font-weight: 600; }
.nav-tab-item.active { color: var(--primary-light); }

.floating-action-support-btn {
    position: fixed; bottom: 84px; right: 16px; width: 50px; height: 50px;
    background: var(--primary); color: white; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; z-index: 850; border: none;
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}
.floating-action-support-btn .lucide { width: 22px; height: 22px; color: white; }

/* Sliding Sidebar Layout Components */
.sidebar {
    position: fixed; top: 0; left: -285px; width: 285px; height: 100vh;
    background: var(--surface-solid); z-index: 2000; transition: transform var(--speed-fluid);
    display: flex; flex-direction: column;
}
.sidebar.active { transform: translateX(285px); box-shadow: 20px 0 60px rgba(0,0,0,0.1); }
.sidebar-top { padding: 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-rgb); }
.sidebar-logo { font-size: 22px; font-weight: 800; color: var(--primary); }
.sidebar-close-btn { font-size: 28px; color: var(--text-core); background: none; border: none; }
.sidebar-menu { padding: 16px 12px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.menu-link { padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--text-muted); border-radius: 12px; display: flex; align-items: center; gap: 12px; text-decoration: none; }
.menu-link .lucide { width: 18px; height: 18px; color: var(--text-muted); }
.menu-link:hover, .menu-link.active { background: var(--accent-glow); color: var(--primary); }
.menu-link:hover .lucide, .menu-link.active .lucide { color: var(--primary); }
.menu-divider { border: 0; height: 1px; background: var(--border-rgb); margin: 12px 0; }
.logout-btn { color: #EF4444; }
.logout-btn .lucide { color: #EF4444; }

/* Modal Window Base Architectures */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(4, 8, 18, 0.35); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 3000; display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: var(--speed-fluid);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal-content { width: 92%; max-width: 400px; padding: 28px; position: relative; transform: scale(0.95); transition: transform 0.3s ease; }
.modal-overlay.active .modal-content { transform: scale(1); }
.close-modal { position: absolute; top: 16px; right: 16px; font-size: 24px; color: var(--text-muted); background: none; border: none; }
.modal-header h2 { font-size: 20px; font-weight: 800; color: var(--primary-light); text-align: center; margin-bottom: 12px; }
.modal-header p { font-size: 13px; color: var(--text-muted); text-align: center; line-height: 1.5; }
.plan-subtitle { margin-top: 14px; font-weight: 700; color: var(--text-core); }
.modal-body { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.plan-card { display: flex; flex-direction: column; padding: 18px; border-radius: 16px; text-decoration: none; text-align: center; }
.plan-card .lucide { width: 14px; height: 14px; margin-left: 4px; stroke-width: 2.5px; }
.king-plan { background: linear-gradient(135deg, #1E3A8A 0%, #3B82F6 100%); color: white; }
.emperor-plan { background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%); color: #F8FAFC; }
.plan-name { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.plan-btn-text { font-size: 12px; opacity: 0.9; font-weight: 600; }
.modal-footer { text-align: center; margin-top: 20px; font-size: 11px; color: var(--text-muted); }

@keyframes textShimmer { 0% { background-position: -200% center; } 100% { background-position: 200% center; } }
@keyframes pulseGlow { 0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); } 70% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); } 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }

@media (min-width: 768px) {
    .modules-grid { grid-template-columns: repeat(3, 1fr); }
    .analytics-layout-grid { grid-template-columns: repeat(2, 1fr); display: grid; }
}

@media (min-width: 1024px) {
    .sidebar { left: 0; }
    .sidebar-close-btn, #sidebarOpen { display: none; }
    .app-container { padding-left: 305px; }
    .bottom-navigation-bar { display: none; }
    .modules-grid { grid-template-columns: repeat(4, 1fr); }
    .analytics-layout-grid { grid-template-columns: repeat(3, 1fr); }
    .floating-action-support-btn { bottom: 24px; right: 24px; }
}
