@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* =====================================================
   VARIABLES
===================================================== */
:root {
    --primary: #2563EB;
    --primary-hover: #1D4ED8;
    --primary-light: #EFF6FF;
    --background: #F8FAFC;
    --card-bg: #FFFFFF;
    --text-main: #1E293B;
    --text-muted: #64748B;
    --border-color: #E2E8F0;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --font-main: 'Inter', sans-serif;
    --header-h: 64px;
}
[data-theme="dark"] {
    --background: #0F172A;
    --card-bg: #1E293B;
    --text-main: #F8FAFC;
    --text-muted: #94A3B8;
    --border-color: #334155;
    --primary-light: #1e3a5f;
}

/* =====================================================
   RESET
===================================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overflow-x: hidden; }
body { font-family: var(--font-main); background: var(--background); color: var(--text-main); line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: var(--primary); transition: color .2s; }
a:hover { color: var(--primary-hover); }
ul { list-style: none; }

/* =====================================================
   LAYOUT
===================================================== */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* =====================================================
   BUTTONS
===================================================== */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 10px 20px; border-radius: 8px; font-weight: 600;
    cursor: pointer; border: none; transition: all .2s;
    font-family: var(--font-main); font-size: .9rem; white-space: nowrap;
    text-decoration: none;
}
.btn-primary { background: var(--primary); color: #FFF; }
.btn-primary:hover { background: var(--primary-hover); color: #FFF; }
.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary-light); }
.btn-sm { padding: 7px 14px; font-size: .82rem; }

/* =====================================================
   CARD
===================================================== */
.card {
    background: var(--card-bg); border-radius: 12px; padding: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06); border: 1px solid var(--border-color);
    transition: transform .2s, box-shadow .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.text-muted { color: var(--text-muted); }

/* =====================================================
   PUBLIC HEADER
===================================================== */
.site-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    height: var(--header-h);
    position: sticky; top: 0; z-index: 600;
    transition: all 0.3s ease;
}
.site-header.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border-bottom-color: transparent;
}
[data-theme="dark"] .site-header.scrolled {
    background: rgba(30, 41, 59, 0.95);
}
.header-container {
    height: 100%; display: flex; align-items: center;
    justify-content: space-between; gap: 12px;
}
.logo img { height: 36px; }

/* Desktop nav – horizontal */
.nav-wrapper { display: flex; align-items: center; gap: 16px; }
.nav-links { display: flex; align-items: center; gap: 16px; }
.nav-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-main); font-weight: 500; font-size: .9rem; white-space: nowrap; }
.nav-links a:hover { color: var(--primary); }
.auth-buttons { display: flex; gap: 8px; }

/* Hamburger – hidden on desktop */
.mobile-menu-toggle {
    display: none; background: none; border: 1px solid var(--border-color);
    border-radius: 8px; width: 40px; height: 40px;
    align-items: center; justify-content: center;
    font-size: 1.1rem; color: var(--text-main); cursor: pointer; flex-shrink: 0;
}

/* =====================================================
   SEARCH BAR
===================================================== */
.search-bar {
    display: flex; align-items: center;
    background: var(--background); border-radius: 50px;
    padding: 5px 5px 5px 14px; border: 1px solid var(--border-color);
    box-shadow: 0 2px 6px rgba(0,0,0,.04);
}
.search-bar input {
    border: none; background: transparent; padding: 6px 8px;
    outline: none; flex: 1; min-width: 0; font-size: .9rem; color: var(--text-main);
}
.search-bar select {
    border: none; background: transparent; padding: 6px 8px;
    outline: none; border-left: 1px solid var(--border-color);
    color: var(--text-muted); font-size: .85rem; max-width: 110px;
}

/* =====================================================
   HERO
===================================================== */
.hero { padding-top: 56px; padding-bottom: 56px; display: flex; align-items: center; gap: 40px; }
.hero-content { flex: 1; min-width: 0; }
.hero-content h1 { font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1.2; margin-bottom: 16px; word-break: break-word; }
.hero-content h1 span { color: var(--primary); }
.hero-content > p { font-size: 1rem; color: var(--text-muted); margin-bottom: 20px; }
.hero-cta-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 0; }
.hero-image { flex: 1; max-width: 460px; }
.hero-image img { border-radius: 16px; width: 100%; }

/* Stats row */
.hero-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 32px; }
.stat-item {
    display: flex; align-items: center; gap: 10px;
    background: var(--card-bg); padding: 12px 14px; border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,.06); border: 1px solid var(--border-color);
}
.stat-item i { font-size: 1.3rem; color: var(--primary); flex-shrink: 0; }
.stat-info h4 { font-size: 1rem; font-weight: 700; line-height: 1.2; }
.stat-info p { font-size: .75rem; color: var(--text-muted); }

/* =====================================================
   FOOTER
===================================================== */
.site-footer { background: #0F172A; color: #fff; padding: 56px 0 20px; margin-top: 60px; }
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 2fr;
    gap: 28px; margin-bottom: 40px;
}
.footer-brand p { color: #94A3B8; font-size: .88rem; margin: 12px 0 16px; line-height: 1.6; }
.footer-social { display: flex; gap: 12px; }
.footer-social a { color: #94A3B8; font-size: 1.2rem; }
.footer-social a:hover { color: #fff; }
.footer-col h4 { color: #fff; margin-bottom: 16px; font-size: .95rem; }
.footer-col ul li { margin-bottom: 9px; }
.footer-col ul li a { color: #94A3B8; font-size: .88rem; }
.footer-col ul li a:hover { color: #fff; }
.footer-subscribe h4 { color: #fff; margin-bottom: 14px; font-size: .95rem; }
.footer-subscribe-form {
    display: flex; background: #fff; border-radius: 8px; padding: 4px; overflow: hidden;
}
.footer-subscribe-form input {
    border: none; padding: 9px 12px; flex: 1; min-width: 0;
    outline: none; color: #1E293B; font-size: .88rem; border-radius: 6px;
}
.footer-subscribe-form button { flex-shrink: 0; border-radius: 5px; padding: 8px 14px; font-size: .82rem; }
.footer-bottom {
    border-top: 1px solid #1E293B; padding-top: 18px;
    display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 12px; color: #94A3B8; font-size: .82rem;
}
.footer-payments { display: flex; gap: 10px; align-items: center; font-size: 1.4rem; flex-wrap: wrap; }

/* =====================================================
   DASHBOARD LAYOUT
===================================================== */
.dashboard-layout { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar {
    width: 260px; background: var(--card-bg); border-right: 1px solid var(--border-color);
    display: flex; flex-direction: column; overflow-y: auto; flex-shrink: 0;
    transition: transform .3s ease; z-index: 1001;
}
.sidebar-brand { padding: 18px 20px; border-bottom: 1px solid var(--border-color); display: flex; align-items: center; gap: 10px; }
.sidebar-brand img { height: 32px; }
.sidebar-menu { padding: 16px 0; flex: 1; }
.menu-title { font-size: .72rem; text-transform: uppercase; color: var(--text-muted); padding: 0 20px; margin: 14px 0 8px; font-weight: 600; letter-spacing: .04em; }
.menu-item { display: flex; align-items: center; padding: 11px 20px; color: var(--text-main); font-weight: 500; font-size: .9rem; text-decoration: none; transition: .2s; }
.menu-item i { width: 24px; color: var(--text-muted); font-size: 1rem; }
.menu-item:hover, .menu-item.active { background: var(--primary-light); color: var(--primary); border-right: 3px solid var(--primary); }
.menu-item:hover i, .menu-item.active i { color: var(--primary); }
.badge { background: var(--primary-light); color: var(--primary); padding: 2px 8px; border-radius: 12px; font-size: .72rem; margin-left: auto; font-weight: 600; }
.refer-box { margin: 16px; background: var(--primary-light); border-radius: 12px; padding: 18px; text-align: center; }

/* Overlay for mobile sidebar */
.sidebar-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,.45); z-index: 1000;
}
.sidebar-overlay.active { display: block; }

/* Main wrapper */
.main-wrapper { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

/* Top header */
.top-header { background: var(--card-bg); border-bottom: 1px solid var(--border-color); padding: 14px 24px; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; gap: 12px; }
.header-search { display: flex; background: var(--background); padding: 8px 14px; border-radius: 8px; align-items: center; width: 320px; border: 1px solid var(--border-color); flex-shrink: 0; }
.header-search input { border: none; background: transparent; width: 100%; outline: none; margin-left: 10px; color: var(--text-main); font-size: .9rem; }
.header-right { display: flex; align-items: center; gap: 12px; }
.balance-badge { background: var(--primary-light); color: var(--primary); padding: 7px 14px; border-radius: 8px; font-weight: 600; display: flex; align-items: center; gap: 8px; font-size: .88rem; white-space: nowrap; }
.icon-btn { position: relative; color: var(--text-muted); font-size: 1.15rem; cursor: pointer; }
.icon-badge { position: absolute; top: -5px; right: -6px; background: var(--danger); color: #fff; font-size: .58rem; padding: 2px 4px; border-radius: 50%; border: 2px solid var(--card-bg); }
.user-profile { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.user-profile img { width: 34px; height: 34px; border-radius: 50%; }

/* Content area */
.content-area { flex: 1; padding: 22px; overflow-y: auto; display: flex; gap: 22px; min-width: 0; }
.main-panel { flex: 2; min-width: 0; }
.right-panel { flex: 1; max-width: 330px; display: flex; flex-direction: column; gap: 18px; flex-shrink: 0; }

/* Job components */
.job-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border-color); margin-bottom: 18px; overflow-x: auto; }
.job-tab { padding: 9px 0; color: var(--text-muted); font-weight: 500; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; font-size: .9rem; }
.job-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.job-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; padding: 18px; margin-bottom: 14px; display: flex; align-items: center; gap: 14px; transition: .2s; }
.job-card:hover { border-color: var(--primary); box-shadow: 0 4px 12px rgba(0,0,0,.06); }
.job-icon { width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; flex-shrink: 0; }
.job-details { flex: 1; min-width: 0; }
.job-title { font-weight: 600; font-size: .95rem; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.job-meta { display: flex; gap: 10px; color: var(--text-muted); font-size: .8rem; flex-wrap: wrap; }
.job-meta span { display: flex; align-items: center; gap: 4px; }
.job-reward { text-align: center; flex-shrink: 0; padding: 0 14px; }
.job-reward .amount { font-size: 1.1rem; font-weight: 700; color: var(--success); }
.job-apply-btn { flex-shrink: 0; min-width: 100px; }
.job-apply-btn .btn { width: 100%; }
.job-progress { width: 130px; flex-shrink: 0; }
.progress-text { display: flex; justify-content: space-between; font-size: .78rem; font-weight: 600; margin-bottom: 5px; }
.progress-bar { height: 5px; background: var(--border-color); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 3px; }

/* Widgets */
.widget { background: var(--card-bg); border-radius: 12px; border: 1px solid var(--border-color); padding: 18px; }
.widget-title { font-size: .95rem; font-weight: 600; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.wallet-card { background: var(--primary); color: #fff; border-radius: 12px; padding: 18px; }
.wallet-balance { font-size: 1.8rem; font-weight: 700; margin: 8px 0; }
.wallet-actions { display: flex; gap: 8px; margin-top: 14px; }
.wallet-actions .btn { flex: 1; background: rgba(255,255,255,.2); color: #fff; font-size: .85rem; padding: 8px; border-radius: 8px; }
.wallet-actions .btn:hover { background: rgba(255,255,255,.3); }
.leaderboard-item { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.leaderboard-item img { width: 30px; height: 30px; border-radius: 50%; }
.leaderboard-rank { width: 20px; font-weight: 700; color: var(--warning); text-align: center; }
.leaderboard-info { flex: 1; min-width: 0; }
.leaderboard-name { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leaderboard-amount { font-weight: 700; font-size: .88rem; }

/* Dropdowns */
.dropdown { position: relative; }
.dropdown-menu { position: absolute; top: calc(100% + 10px); right: -8px; width: 300px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: 0 10px 25px rgba(0,0,0,.1); opacity: 0; visibility: hidden; transform: translateY(8px); transition: all .2s; z-index: 300; }
.dropdown.active .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-header { padding: 13px 18px; border-bottom: 1px solid var(--border-color); font-weight: 600; font-size: .9rem; display: flex; justify-content: space-between; align-items: center; }
.dropdown-item { padding: 12px 18px; border-bottom: 1px solid var(--border-color); display: flex; gap: 12px; cursor: pointer; transition: .15s; text-decoration: none; color: var(--text-main); }
.dropdown-item:hover { background: var(--background); }
.dropdown-item:last-child { border-bottom: none; }
.dropdown-footer { padding: 11px; text-align: center; border-top: 1px solid var(--border-color); font-size: .82rem; font-weight: 500; }
.dropdown-footer a { color: var(--primary); }

/* =====================================================
   RESPONSIVE — TABLET ≤ 1024px
===================================================== */
@media (max-width: 1024px) {
    .nav-links { gap: 12px; }
    .hero-stats { grid-template-columns: repeat(2, 1fr); }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
    .footer-brand, .footer-subscribe { grid-column: 1 / -1; }
    .content-area { padding: 16px; gap: 16px; }
    .header-search { width: 240px; }
}

/* =====================================================
   RESPONSIVE — TABLET & SMALL LAPTOPS ≤ 992px
===================================================== */
@media (max-width: 992px) {
    /* --- Header --- */
    .mobile-menu-toggle { display: flex !important; }

    .nav-wrapper {
        display: none !important;
        position: fixed;
        top: var(--header-h);
        left: 0; right: 0;
        background: var(--card-bg);
        flex-direction: column;
        align-items: stretch;
        padding: 16px 20px 24px;
        box-shadow: 0 12px 24px rgba(0,0,0,.15);
        border-top: 1px solid var(--border-color);
        z-index: 599;
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
        gap: 16px;
    }
    .nav-wrapper.open { display: flex !important; }

    .nav-links {
        flex-direction: column; align-items: stretch;
        gap: 0; width: 100%;
    }
    .nav-links a {
        padding: 13px 4px; border-bottom: 1px solid var(--border-color);
        font-size: .95rem; color: var(--text-main); display: flex; align-items: center; gap: 10px;
    }
    .nav-links a:last-child { border-bottom: none; }

    .auth-buttons {
        margin-top: 8px; flex-direction: column; gap: 8px; width: 100%;
    }
    .auth-buttons .btn { width: 100%; justify-content: center; padding: 12px; font-size: .95rem; }

    /* --- Hero --- */
    .hero { flex-direction: column; padding-top: 80px; padding-bottom: 32px; gap: 24px; text-align: center; }
    .hero-content h1 { font-size: clamp(1.6rem, 7vw, 2.5rem); word-break: normal; hyphens: auto; }
    .hero-content > p { font-size: .92rem; }
    .hero-cta-btns { justify-content: center; width: 100%; }
    .hero-cta-btns .btn { flex: 1; min-width: 140px; }
    .hero-image { display: block; margin: 30px auto 30px; max-width: 380px; width: 100%; }

    .search-bar { flex-wrap: wrap; border-radius: 12px; padding: 8px; gap: 6px; }
    .search-bar > i { display: none; }
    .search-bar input { padding: 8px; min-width: 100%; order: 1; border-bottom: 1px solid var(--border-color); }
    .search-bar select { display: block; max-width: 100%; width: 100%; order: 2; border-left: none; padding: 8px; border-bottom: 1px solid var(--border-color); }
    .search-bar .btn { width: 100%; order: 3; border-radius: 8px !important; margin-top: 5px; }

    .hero-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 20px; }
    .stat-item { padding: 12px; gap: 10px; }
    .stat-item i { font-size: 1.2rem; }
    .stat-info h4 { font-size: .95rem; }
    .stat-info p { font-size: .75rem; }

    /* --- How it works grid --- */
    .connecting-line { display: none !important; }

    /* --- Contact --- */
    .contact-hero { padding: 32px 0 60px !important; }
    .contact-hero h1 { font-size: 1.8rem !important; }
    .contact-grid { margin-top: 0 !important; padding: 0 16px 60px !important; }
    .contact-info-card { padding: 24px !important; min-width: unset !important; }
    .contact-form-card { padding: 24px !important; min-width: unset !important; }

    /* --- Dashboard --- */
    .sidebar {
        position: fixed; top: 0; left: 0; height: 100vh;
        transform: translateX(-100%);
    }
    .sidebar.active { transform: translateX(0); }
    .top-header { padding: 12px 16px; }
    .header-search { display: none; }
    .balance-badge { padding: 6px 10px; font-size: .82rem; }

    /* Job cards stack */
    .job-card { flex-wrap: wrap; gap: 10px; padding: 14px; }
    .job-reward { padding: 0; }
    .job-apply-btn { width: 100%; }
    .job-progress { width: 100%; }

    /* Right panel */
    .content-area { flex-direction: column; }
    .right-panel { max-width: 100%; }

    /* Footer */
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
    .footer-brand, .footer-subscribe { grid-column: 1 / -1; }
    .footer-bottom { flex-direction: column; text-align: center; }
}

/* =====================================================
   RESPONSIVE — SMALL ≤ 480px
===================================================== */
@media (max-width: 480px) {
    .container { padding: 0 12px; }
    .hero-stats { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-item { flex-direction: column; text-align: center; gap: 4px; padding: 12px 8px; }
    .stat-item i { font-size: 1.4rem; }
    .stat-info h4 { font-size: .88rem; }
    .header-right { gap: 8px; }
    .user-profile .user-name { display: none; }
    .dropdown-menu { width: calc(100vw - 24px); right: -12px; }
    .footer-payments { font-size: 1.2rem; }
}

/* =====================================================
   ANIMATIONS
===================================================== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}
.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}
