/* EarnBD - Mobile First Design System */
:root {
    --primary: #00d4aa;
    --primary-dark: #00b894;
    --secondary: #6c5ce7;
    --accent: #fdcb6e;
    --danger: #ff6b6b;
    --success: #00d4aa;
    --bg: #0a0a1a;
    --bg-card: #12122a;
    --bg-elevated: #1a1a3a;
    --text: #ffffff;
    --text-muted: #8892b0;
    --border: #2a2a4a;
    --gradient-primary: linear-gradient(135deg, #00d4aa, #00b894);
    --gradient-gold: linear-gradient(135deg, #fdcb6e, #f39c12);
    --shadow: 0 4px 20px rgba(0,0,0,0.3);
    --shadow-glow: 0 0 30px rgba(0,212,170,0.2);
    --radius: 16px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 4px; }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.animate-fadeInUp { animation: fadeInUp 0.5s ease forwards; }
.animate-pulse { animation: pulse 2s infinite; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* ===== LAYOUT ===== */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    background: var(--bg);
}

/* ===== HEADER ===== */
.app-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    z-index: 1000;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    font-size: 1.3rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    -webkit-text-fill-color: #fff;
}

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

.notification-bell {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.notification-bell:hover { background: var(--border); }

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    border: 2px solid var(--primary);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    padding-top: 70px;
    padding-bottom: 90px;
    padding-left: 16px;
    padding-right: 16px;
}

/* ===== HERO SECTION ===== */
.hero-section {
    padding: 20px 0;
    text-align: center;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 212, 170, 0.1);
    border: 1px solid rgba(0, 212, 170, 0.3);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    color: var(--primary);
    margin-bottom: 16px;
}

.hero-title {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 12px;
}

.hero-title span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ===== WALLET CARD ===== */
.wallet-card {
    background: linear-gradient(135deg, #1a1a3a, #252550);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.wallet-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0,212,170,0.05) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

.wallet-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

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

.wallet-refresh {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid var(--border);
    font-size: 0.9rem;
}

.wallet-balance {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 4px;
    position: relative;
    z-index: 1;
}

.wallet-balance span { font-size: 1rem; color: var(--text-muted); }

.wallet-change {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(0, 212, 170, 0.1);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.wallet-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.btn {
    padding: 14px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: #0a0a1a;
    box-shadow: 0 4px 15px rgba(0, 212, 170, 0.3);
}

.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:active { transform: scale(0.97); }

.btn-gold {
    background: var(--gradient-gold);
    color: #1a1a1a;
    box-shadow: 0 4px 15px rgba(253, 203, 110, 0.3);
}

.btn-full { width: 100%; }

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 14px 10px;
    text-align: center;
    border: 1px solid var(--border);
}

.stat-icon {
    font-size: 1.4rem;
    margin-bottom: 6px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* ===== SECTION HEADERS ===== */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-link {
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
}

/* ===== TASK CARDS ===== */
.tasks-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.task-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid var(--border);
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.task-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.task-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--gradient-primary);
    opacity: 0;
    transition: var(--transition);
}

.task-card:hover::after { opacity: 1; }

.task-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.task-icon.blue { background: rgba(108, 92, 231, 0.15); }
.task-icon.green { background: rgba(0, 212, 170, 0.15); }
.task-icon.gold { background: rgba(253, 203, 110, 0.15); }
.task-icon.purple { background: rgba(155, 89, 182, 0.15); }

.task-content { flex: 1; min-width: 0; }

.task-title {
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-desc {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.task-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.task-reward {
    background: rgba(0, 212, 170, 0.1);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.task-time {
    color: var(--text-muted);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.task-difficulty {
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.diff-easy { background: rgba(0, 212, 170, 0.15); color: var(--primary); }
.diff-medium { background: rgba(253, 203, 110, 0.15); color: var(--accent); }
.diff-hard { background: rgba(255, 107, 107, 0.15); color: var(--danger); }

.task-action {
    align-self: center;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: 20px;
}

/* ===== LEADERBOARD ===== */
.leaderboard-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.leader-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.leader-item:last-child { border-bottom: none; }

.leader-rank {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.rank-1 { background: var(--gradient-gold); color: #1a1a1a; }
.rank-2 { background: linear-gradient(135deg, #bdc3c7, #95a5a6); color: #1a1a1a; }
.rank-3 { background: linear-gradient(135deg, #cd7f32, #a0522d); color: #fff; }
.rank-other { background: var(--bg-elevated); color: var(--text-muted); }

.leader-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.leader-info { flex: 1; min-width: 0; }

.leader-name {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.leader-status {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.leader-earning {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.95rem;
}

/* ===== REFERRAL BANNER ===== */
.referral-banner {
    background: linear-gradient(135deg, rgba(108, 92, 231, 0.2), rgba(0, 212, 170, 0.1));
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.referral-banner h3 {
    font-size: 1rem;
    margin-bottom: 8px;
}

.referral-banner p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.referral-code {
    background: var(--bg);
    border: 1px dashed var(--primary);
    border-radius: var(--radius-sm);
    padding: 12px;
    font-family: monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.referral-code button {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    font-size: 1rem;
}

/* ===== WITHDRAWAL SECTION ===== */
.withdrawal-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 16px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.payment-methods {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 16px 0;
}

.payment-method {
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.payment-method:hover { border-color: var(--primary); }

.payment-method.selected {
    border-color: var(--primary);
    background: rgba(0, 212, 170, 0.1);
}

.payment-method img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 6px;
}

.payment-method .name {
    font-size: 0.75rem;
    font-weight: 600;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(10, 10, 26, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-muted);
    text-decoration: none;
    border: none;
    background: none;
    font-size: 0.75rem;
}

.nav-item.active { color: var(--primary); }

.nav-item .icon { font-size: 1.4rem; }

.nav-item .label { font-size: 0.65rem; font-weight: 600; }

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 20px;
    transform: translateY(100%);
    transition: var(--transition);
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

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

.modal-header h2 { font-size: 1.2rem; }

.modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
}

/* ===== FORM ELEMENTS ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 14px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.1);
}

/* ===== TOAST ===== */
.toast-container {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 90%;
    max-width: 440px;
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideIn 0.3s ease;
    pointer-events: auto;
    box-shadow: var(--shadow);
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast.info { border-left: 4px solid var(--secondary); }

/* ===== LOADING SKELETON ===== */
.skeleton {
    background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--border) 50%, var(--bg-elevated) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

/* ===== PROGRESS BAR ===== */
.progress-bar {
    height: 6px;
    background: var(--bg-elevated);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* ===== HORIZONTAL SCROLL ===== */
.horizontal-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.horizontal-scroll::-webkit-scrollbar { display: none; }

/* ===== CATEGORY CHIPS ===== */
.category-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 16px;
    scrollbar-width: none;
}

.category-chips::-webkit-scrollbar { display: none; }

.chip {
    padding: 8px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    transition: var(--transition);
}

.chip.active {
    background: var(--gradient-primary);
    color: #0a0a1a;
    border-color: var(--primary);
}

/* ===== ACTIVITY FEED ===== */
.activity-item {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 212, 170, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.activity-content { flex: 1; }

.activity-title { font-weight: 600; font-size: 0.9rem; }

.activity-time { color: var(--text-muted); font-size: 0.75rem; }

.activity-amount { font-weight: 700; color: var(--primary); }

/* ===== RESPONSIVE ===== */
@media (min-width: 481px) {
    body {
        background: #050510;
    }
    .app-container {
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
    }
}

/* ===== UTILITY ===== */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--text-muted); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.hidden { display: none !important; }
