/* =========================================================
   CashMyApp — Design System
   Palette: Ink #0F1320, Surface #161B2E, Surface-2 #1E2540
   Accent Lime #39FF88, Accent Cyan #22D3EE, Gold #FFC542
   Type: Space Grotesk (display) + Inter (body)
   ========================================================= */

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

:root {
    --ink: #0F1320;
    --surface: #161B2E;
    --surface-2: #1E2540;
    --surface-3: #262E4D;
    --border: #2A3257;
    --text: #EDEFF7;
    --text-dim: #9AA3C7;
    --text-faint: #6B7299;
    --lime: #39FF88;
    --cyan: #22D3EE;
    --gold: #FFC542;
    --pink: #FF6B9D;
    --danger: #FF5C5C;
    --grad-main: linear-gradient(135deg, #39FF88 0%, #22D3EE 100%);
    --grad-gold: linear-gradient(135deg, #FFC542 0%, #FF9D42 100%);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow-glow: 0 0 0 1px rgba(57,255,136,0.15), 0 8px 30px rgba(57,255,136,0.08);
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    background: var(--ink);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* Background ambience */
body.app-bg {
    background-image:
        radial-gradient(circle at 10% 0%, rgba(57,255,136,0.08), transparent 40%),
        radial-gradient(circle at 90% 20%, rgba(34,211,238,0.07), transparent 40%),
        var(--ink);
    background-attachment: fixed;
}

.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* ---------- Typography ---------- */
h1, h2, h3, h4, .font-display { font-family: var(--font-display); letter-spacing: -0.01em; }
.eyebrow {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--lime);
}

/* ---------- Top Navigation ---------- */
.navbar {
    position: sticky; top: 0; z-index: 100;
    background: rgba(15,19,32,0.85);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border);
}
.navbar-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 21px; }
.brand .coin {
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--grad-main);
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; color: var(--ink); font-weight: 800;
    box-shadow: 0 0 18px rgba(57,255,136,0.4);
}
.brand .cash { color: var(--text); }
.brand .myapp { color: var(--lime); }

.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a {
    font-size: 14.5px; font-weight: 600; color: var(--text-dim);
    transition: color .15s ease;
    position: relative;
}
.nav-links a:hover, .nav-links a.active { color: var(--text); }
.nav-links a.active::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: -22px;
    height: 2px; background: var(--grad-main); border-radius: 2px;
}

.nav-right { display: flex; align-items: center; gap: 14px; }
.points-pill {
    display: flex; align-items: center; gap: 8px;
    background: var(--surface-2); border: 1px solid var(--border);
    padding: 7px 14px 7px 8px; border-radius: 999px;
    font-family: var(--font-display); font-weight: 700; font-size: 14px;
}
.points-pill .icon {
    width: 24px; height: 24px; border-radius: 50%; background: var(--grad-gold);
    display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    font-weight: 700; font-size: 14.5px; font-family: var(--font-body);
    padding: 10px 20px; border-radius: 999px; transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
    white-space: nowrap;
}
.btn-primary { background: var(--grad-main); color: #06140C; box-shadow: 0 6px 20px rgba(57,255,136,0.25); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(57,255,136,0.35); }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-block { width: 100%; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.hamburger { display: none; width: 38px; height: 38px; border-radius: 10px; background: var(--surface-2); align-items: center; justify-content: center; font-size: 18px; }

/* ---------- Hero ---------- */
.hero {
    padding: 64px 0 40px;
    display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center;
}
.hero h1 {
    font-size: clamp(32px, 4.2vw, 52px);
    font-weight: 700; line-height: 1.08; margin: 14px 0 18px;
}
.hero h1 .grad { background: var(--grad-main); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-dim); font-size: 16.5px; max-width: 460px; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 28px; margin-top: 34px; }
.hero-stat .num { font-family: var(--font-display); font-size: 26px; font-weight: 700; color: var(--lime); }
.hero-stat .label { font-size: 12.5px; color: var(--text-faint); }

.hero-art {
    position: relative; aspect-ratio: 1/1; max-width: 420px; margin: 0 auto;
}
.coin-stack {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.coin-big {
    width: 230px; height: 230px; border-radius: 50%;
    background: var(--grad-gold);
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 800; font-size: 64px; color: #4A2E00;
    box-shadow: 0 0 70px rgba(255,197,66,0.35), inset 0 -10px 30px rgba(0,0,0,0.15);
    animation: float 5s ease-in-out infinite;
}
.coin-small {
    position: absolute; width: 70px; height: 70px; border-radius: 50%;
    background: var(--grad-main); display: flex; align-items: center; justify-content: center;
    font-weight: 800; color: #06140C; font-size: 22px; font-family: var(--font-display);
    box-shadow: 0 0 30px rgba(57,255,136,0.3);
}
.coin-small.c1 { top: 4%; left: 0%; animation: float 4s ease-in-out infinite; }
.coin-small.c2 { bottom: 8%; right: 0%; animation: float 4.5s ease-in-out infinite reverse; }
.coin-small.c3 { top: 50%; right: -6%; width: 46px; height: 46px; font-size: 16px; background: var(--grad-gold); color:#4A2E00; animation: float 3.6s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }

/* ---------- Section ---------- */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 26px; flex-wrap: wrap; gap: 10px; }
.section-head h2 { font-size: 28px; font-weight: 700; }
.section-head p.sub { color: var(--text-dim); font-size: 14.5px; margin-top: 4px; }

/* ---------- Category pills ---------- */
.cat-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 26px; scrollbar-width: none; }
.cat-row::-webkit-scrollbar { display: none; }
.cat-pill {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
    background: var(--surface-2); border: 1px solid var(--border);
    padding: 10px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--text-dim);
    transition: all .15s ease;
}
.cat-pill:hover { border-color: var(--lime); color: var(--text); }
.cat-pill.active { background: var(--grad-main); color: #06140C; border-color: transparent; }

/* ---------- Task cards ---------- */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.task-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    display: flex; flex-direction: column;
}
.task-card:hover { transform: translateY(-4px); border-color: rgba(57,255,136,0.4); box-shadow: var(--shadow-glow); }
.task-thumb { width: 100%; aspect-ratio: 16/9.5; object-fit: cover; background: var(--surface-2); }
.task-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }
.task-tag {
    align-self: flex-start; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    padding: 4px 10px; border-radius: 999px; color: var(--ink);
}
.tag-lead { background: var(--cyan); }
.tag-app_install { background: var(--lime); }
.tag-sweepstake { background: var(--pink); color: #fff; }
.tag-survey { background: var(--gold); }
.tag-video { background: #B98CFF; color: #fff; }
.tag-other { background: var(--text-faint); color: #fff; }
.task-title { font-weight: 700; font-size: 15.5px; line-height: 1.3; }
.task-desc { color: var(--text-dim); font-size: 13px; line-height: 1.4; flex-grow: 1; }
.task-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.task-points { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 700; color: var(--gold); font-size: 15px; }
.task-daily-badge { font-size: 11px; color: var(--text-faint); display:flex; align-items:center; gap:4px; }

/* ---------- Spin Wheel Section ---------- */
.spin-section {
    background: linear-gradient(135deg, var(--surface-2), var(--surface));
    border: 1px solid var(--border); border-radius: 24px; padding: 40px;
    display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 36px; align-items: center;
    position: relative; overflow: hidden;
}
.spin-section::before {
    content: ''; position: absolute; width: 400px; height: 400px; border-radius: 50%;
    background: radial-gradient(circle, rgba(57,255,136,0.12), transparent 70%);
    top: -150px; right: -150px;
}
.spin-copy h2 { font-size: 26px; margin-bottom: 10px; }
.spin-copy p { color: var(--text-dim); margin-bottom: 18px; font-size: 14.5px; }
.streak-row { display: flex; gap: 8px; margin-bottom: 20px; }
.streak-day {
    width: 38px; height: 38px; border-radius: 10px; background: var(--surface-3);
    display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--text-faint);
    border: 1px solid var(--border);
}
.streak-day.done { background: var(--grad-main); color: #06140C; border-color: transparent; }

.wheel-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.wheel-outer { position: relative; width: 280px; height: 280px; }
.wheel-pointer {
    position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
    width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent;
    border-top: 22px solid var(--gold); z-index: 5; filter: drop-shadow(0 2px 4px rgba(0,0,0,.4));
}
#wheelCanvas { border-radius: 50%; box-shadow: 0 0 0 8px var(--surface-3), 0 0 40px rgba(0,0,0,.4); transition: transform 3.5s cubic-bezier(.17,.89,.32,1.1); }
.wheel-hub {
    position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; border-radius: 50%;
    background: var(--grad-gold); transform: translate(-50%,-50%); box-shadow: 0 0 16px rgba(255,197,66,.5);
    display: flex; align-items: center; justify-content: center; font-size: 18px; color: #4A2E00; z-index: 4;
}

/* ---------- Stat / Dashboard cards ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px; display: flex; align-items: center; gap: 14px;
}
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.stat-card .num { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.stat-card .label { font-size: 12.5px; color: var(--text-faint); }

/* ---------- Forms / Auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 30px 20px; }
.auth-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 22px;
    padding: 38px; width: 100%; max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.auth-card .brand { justify-content: center; margin-bottom: 6px; font-size: 24px; }
.auth-card h2 { text-align: center; font-size: 20px; margin: 6px 0 4px; }
.auth-card p.sub { text-align: center; color: var(--text-dim); font-size: 13.5px; margin-bottom: 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text-dim); }
.field input, .field select, .field textarea {
    width: 100%; background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
    padding: 12px 14px; border-radius: var(--radius-sm); font-size: 14.5px; transition: border-color .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--lime); }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.auth-foot { text-align: center; font-size: 13.5px; color: var(--text-dim); margin-top: 18px; }
.auth-foot a { color: var(--lime); font-weight: 700; }

.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 13.5px; margin-bottom: 16px; font-weight: 600; }
.alert-success { background: rgba(57,255,136,0.12); color: var(--lime); border: 1px solid rgba(57,255,136,0.3); }
.alert-error { background: rgba(255,92,92,0.12); color: var(--danger); border: 1px solid rgba(255,92,92,0.3); }
.alert-info { background: rgba(34,211,238,0.12); color: var(--cyan); border: 1px solid rgba(34,211,238,0.3); }

/* ---------- Withdraw page ---------- */
.method-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; }
.method-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 18px; cursor: pointer; transition: border-color .15s ease, transform .15s ease;
}
.method-card:hover { border-color: var(--lime); transform: translateY(-2px); }
.method-card.selected { border-color: var(--lime); box-shadow: var(--shadow-glow); }
.method-card .m-icon { font-size: 26px; margin-bottom: 10px; color: var(--lime); }
.method-card .m-name { font-weight: 700; margin-bottom: 4px; }
.method-card .m-min { font-size: 12.5px; color: var(--text-faint); }

table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.table th, table.table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
table.table th { color: var(--text-faint); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.badge { padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; }
.badge-pending { background: rgba(255,197,66,0.15); color: var(--gold); }
.badge-approved { background: rgba(57,255,136,0.15); color: var(--lime); }
.badge-paid { background: rgba(34,211,238,0.15); color: var(--cyan); }
.badge-rejected { background: rgba(255,92,92,0.15); color: var(--danger); }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 36px 0; margin-top: 40px; color: var(--text-faint); font-size: 13.5px; text-align: center; }

/* ---------- Modal ---------- */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(8,10,18,0.7); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-box { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 30px; max-width: 420px; width: 100%; text-align: center; }
.modal-box .big-icon { font-size: 44px; margin-bottom: 12px; }

/* ---------- Toast ---------- */
#toast {
    position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: var(--surface-3); border: 1px solid var(--border); color: var(--text);
    padding: 12px 22px; border-radius: 999px; font-size: 14px; font-weight: 600;
    opacity: 0; transition: all .25s ease; z-index: 300; pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Admin Panel ---------- */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
    width: 240px; background: var(--surface); border-right: 1px solid var(--border);
    position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0;
    display: flex; flex-direction: column; z-index: 50;
}
.admin-sidebar .brand { padding: 22px 20px; font-size: 18px; border-bottom: 1px solid var(--border); }
.admin-nav { padding: 14px 12px; flex-grow: 1; }
.admin-nav a {
    display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: var(--radius-sm);
    color: var(--text-dim); font-size: 14px; font-weight: 600; margin-bottom: 3px; transition: all .15s ease;
}
.admin-nav a i { width: 18px; text-align: center; color: var(--text-faint); }
.admin-nav a:hover { background: var(--surface-2); color: var(--text); }
.admin-nav a.active { background: var(--surface-2); color: var(--lime); }
.admin-nav a.active i { color: var(--lime); }
.admin-nav .nav-section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); padding: 14px 14px 6px; }
.admin-sidebar-foot { padding: 14px; border-top: 1px solid var(--border); }

.admin-main { flex-grow: 1; min-width: 0; }
.admin-topbar {
    height: 64px; border-bottom: 1px solid var(--border); display: flex; align-items: center;
    justify-content: space-between; padding: 0 26px; position: sticky; top: 0; background: rgba(15,19,32,0.85);
    backdrop-filter: blur(10px); z-index: 40;
}
.admin-content { padding: 26px; }
.admin-mobile-toggle { display: none; }

.data-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; }
.data-table-wrap table.table th, .data-table-wrap table.table td { white-space: nowrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }

.tab-row { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.tab-link { padding: 10px 16px; font-size: 14px; font-weight: 600; color: var(--text-dim); border-bottom: 2px solid transparent; }
.tab-link.active { color: var(--lime); border-color: var(--lime); }

.icon-btn { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--border); display: inline-flex; align-items: center; justify-content: center; color: var(--text-dim); transition: all .15s ease; }
.icon-btn:hover { color: var(--text); border-color: var(--lime); }
.icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }

@media (max-width: 900px) {
    .admin-sidebar { position: fixed; left: -260px; top: 0; transition: left .2s ease; box-shadow: 10px 0 40px rgba(0,0,0,.4); }
    .admin-sidebar.open { left: 0; }
    .admin-mobile-toggle { display: flex; }
    .form-grid { grid-template-columns: 1fr; }
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; padding-top: 36px; }
    .hero-art { order: -1; max-width: 280px; }
    .spin-section { grid-template-columns: 1fr; padding: 28px; text-align: center; }
    .streak-row, .hero-stats { justify-content: center; }
}
@media (max-width: 768px) {
    .nav-links { position: fixed; top: 68px; left: 0; right: 0; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; align-items: flex-start; padding: 16px 20px; gap: 16px; transform: translateY(-110%); transition: transform .2s ease; }
    .nav-links.open { transform: translateY(0); }
    .nav-links a.active::after { display: none; }
    .hamburger { display: flex; }
    .nav-right .btn-ghost-text { display: none; }
}
@media (max-width: 560px) {
    .field-row { flex-direction: column; gap: 0; }
    .auth-card { padding: 26px 22px; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
