/* ==========================================================
   EarnEasy - Mini App stylesheet
   Theme: green #16C784 / purple #6C4CF1
   ========================================================== */

:root {
    --green: #16C784;
    --green-dark: #0FA86C;
    --purple: #6C4CF1;
    --purple-dark: #5638d6;
    --orange: #FF8A3D;
    --pink: #FF5E8A;
    --bg: #F4F6FA;
    --card: #FFFFFF;
    --ink: #1A1F36;
    --muted: #8A92A6;
    --line: #EEF1F6;
    --radius: 18px;
    --shadow: 0 6px 20px rgba(20, 30, 60, .06);
    --tg: #229ED9;
    --maxw: 480px;
}

* { -webkit-tap-highlight-color: transparent; box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overscroll-behavior-y: none;
}

body { max-width: var(--maxw); margin: 0 auto; }

.text-green { color: var(--green) !important; }
.text-purple { color: var(--purple) !important; }
.text-orange { color: var(--orange) !important; }

/* ---------------- Splash ---------------- */
.splash {
    position: fixed; inset: 0; z-index: 9999;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    background: linear-gradient(160deg, var(--green), var(--purple));
    color: #fff;
}
.splash-logo { text-align: center; animation: pop .6s ease; }
.splash-logo i { font-size: 64px; }
.splash-logo h1 { font-weight: 800; margin-top: 8px; letter-spacing: .5px; }
.splash-msg { margin-top: 14px; opacity: .85; font-size: 14px; }

@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* ---------------- App shell ---------------- */
.app { padding-bottom: 86px; min-height: 100vh; }
.screen { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------- Headers ---------------- */
.app-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px; padding-top: calc(16px + env(safe-area-inset-top));
}
.greeting { font-weight: 700; font-size: 16px; }
.subtle { color: var(--muted); font-size: 12.5px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: var(--shadow); background: #e9ecf3; }
.avatar-lg { width: 92px; height: 92px; border-radius: 50%; object-fit: cover; border: 3px solid #fff; box-shadow: var(--shadow); background: #e9ecf3; }

.icon-btn {
    border: none; background: #fff; width: 40px; height: 40px;
    border-radius: 12px; box-shadow: var(--shadow); color: var(--ink);
    font-size: 18px; display: grid; place-items: center;
}
.sub-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top));
}
.sub-header .sub-title { font-weight: 700; font-size: 16px; }
.sub-header span { width: 40px; }

/* ---------------- Balance card ---------------- */
.balance-card {
    border-radius: 22px; padding: 18px 20px; color: #fff;
    box-shadow: 0 10px 26px rgba(22, 199, 132, .35);
    position: relative; overflow: hidden;
}
.green-gradient { background: linear-gradient(135deg, var(--green), #12b377); }
.balance-top { display: flex; align-items: center; justify-content: space-between; }
.balance-label { opacity: .9; font-size: 13px; font-weight: 500; }
.balance-wallet { font-size: 30px; opacity: .85; }
.balance-amount { font-size: 34px; font-weight: 800; margin-top: 6px; }
.btn-pill { border-radius: 999px; font-weight: 700; padding: 10px 22px; }
.balance-card .btn-light { color: var(--green-dark); }

/* ---------------- Mini cards ---------------- */
.mini-card {
    background: var(--card); border-radius: var(--radius); padding: 14px;
    box-shadow: var(--shadow); height: 100%;
}
.mini-label { color: var(--muted); font-size: 12px; }
.mini-value { font-weight: 800; font-size: 19px; margin-top: 2px; }
.mini-card i { font-size: 20px; }

/* ---------------- Section title ---------------- */
.section-title { font-size: 15.5px; font-weight: 700; margin-bottom: 10px; }

/* ---------------- Task list ---------------- */
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--card); border-radius: var(--radius); padding: 12px 14px;
    box-shadow: var(--shadow); cursor: pointer; transition: transform .12s ease;
}
.task-item:active { transform: scale(.98); }
.task-icon {
    width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
    color: #fff; font-size: 20px; flex-shrink: 0;
}
.bg-telegram { background: var(--tg); }
.bg-purple { background: var(--purple); }
.bg-green { background: var(--green); }
.bg-orange { background: var(--orange); }
.bg-pink { background: var(--pink); }
.task-info { flex: 1; min-width: 0; }
.task-name { font-weight: 700; font-size: 14.5px; }
.task-sub { color: var(--muted); font-size: 12px; }
.task-badge {
    background: var(--green); color: #fff; font-weight: 700; font-size: 12px;
    min-width: 26px; height: 26px; padding: 0 8px; border-radius: 999px;
    display: grid; place-items: center;
}
.task-badge.purple { background: var(--purple); }
.chev { color: #c5cad6; font-size: 18px; }
.tag-private { display: inline-block; background: #fff3e0; color: #c9821f; font-size: 9px; font-weight: 700; padding: 1px 6px; border-radius: 6px; vertical-align: middle; }
.task-badge.orange { background: var(--orange); }
.sponsor-item .task-icon img { width: 100%; height: 100%; object-fit: cover; border-radius: 13px; }

/* ---------------- Buttons ---------------- */
.btn-green { background: var(--green); border: none; color: #fff; }
.btn-green:hover, .btn-green:focus { background: var(--green-dark); color: #fff; }
.btn-purple { background: var(--purple); border: none; color: #fff; }
.btn-purple:hover, .btn-purple:focus { background: var(--purple-dark); color: #fff; }
.btn-outline-purple { border: 1.5px solid var(--purple); color: var(--purple); background: #fff; }
.btn-sm-pill { border-radius: 999px; font-size: 12.5px; font-weight: 700; padding: 7px 16px; }

/* ---------------- Stat cards ---------------- */
.stat-card {
    background: var(--card); border-radius: var(--radius); padding: 12px 6px;
    box-shadow: var(--shadow); text-align: center;
}
.stat-card i { font-size: 20px; }
.stat-value { font-weight: 800; font-size: 16px; margin-top: 4px; }
.stat-label { color: var(--muted); font-size: 10.5px; }

/* ---------------- Activity feed ---------------- */
.activity-feed { display: flex; flex-direction: column; gap: 8px; }
.activity-item {
    display: flex; align-items: center; gap: 10px;
    background: var(--card); border-radius: 14px; padding: 10px 12px; box-shadow: var(--shadow);
}
.activity-avatar {
    width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--green), var(--purple));
    color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0;
}
.activity-text { flex: 1; font-size: 12.5px; }
.activity-amt { color: var(--green); font-weight: 700; font-size: 13px; }
.activity-time { color: var(--muted); font-size: 11px; }

/* ---------------- Banners ---------------- */
.purple-banner, .refer-banner {
    border-radius: 20px; padding: 18px 20px; color: #fff;
    display: flex; align-items: center; justify-content: space-between;
    box-shadow: 0 10px 26px rgba(108, 76, 241, .3);
}
.purple-banner { background: linear-gradient(135deg, var(--purple), #8a5cff); }
.refer-banner { background: linear-gradient(135deg, #4f7cff, var(--purple)); box-shadow: 0 10px 26px rgba(79, 124, 255, .3); }
.banner-title { font-size: 19px; font-weight: 800; }
.banner-sub { opacity: .92; font-size: 13px; margin-top: 4px; }
.banner-icon { font-size: 46px; opacity: .9; }

/* ---------------- Ad items ---------------- */
.ad-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--card); border-radius: var(--radius); padding: 12px;
    box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.ad-thumb {
    width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0;
    background: linear-gradient(135deg, #2b2150, #4a3a8c); color: #fff;
    display: grid; place-items: center; font-size: 22px;
}
.ad-meta { flex: 1; }
.ad-title { font-weight: 700; font-size: 14px; }
.ad-sub { color: var(--muted); font-size: 12px; }
.ad-action { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.ad-left { font-size: 10px; color: var(--muted); font-weight: 600; }
.watch-ad { min-width: 92px; }
.watch-ad.cooling { background: #c4b9f5 !important; color: #fff !important; }
.watch-ad.cooling i { margin-right: 2px; }
.cd-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: #ede9fb; opacity: 0; transition: opacity .2s; }
.ad-item.cooling .cd-bar { opacity: 1; }
.cd-bar-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--purple), #8a5cff); transition: width .5s linear; }

/* "Ready!" pulse when cooldown ends */
@keyframes readyPulse {
    0%   { transform: scale(1);    box-shadow: 0 0 0 0 rgba(108,76,241,.55); }
    50%  { transform: scale(1.08); }
    100% { transform: scale(1);    box-shadow: 0 0 0 12px rgba(108,76,241,0); }
}
.watch-ad.ready-pulse { animation: readyPulse .5s ease 2; }

/* Daily-limit reached card with reset countdown */
.limit-card {
    background: linear-gradient(135deg, #eafff5, #eef0ff);
    border: 1px solid #e6ecff; border-radius: var(--radius);
    padding: 26px 18px; text-align: center;
}
.limit-ic { font-size: 46px; color: var(--green); line-height: 1; }
.limit-title { font-weight: 800; font-size: 18px; margin-top: 8px; }
.limit-sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.reset-clock {
    font-size: 30px; font-weight: 800; color: var(--purple);
    font-variant-numeric: tabular-nums; letter-spacing: 1px; margin: 12px 0 4px;
}
.limit-hint { color: var(--muted); font-size: 12px; }

/* ---------------- Info card ---------------- */
.info-card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.info-title { font-weight: 700; margin-bottom: 8px; }
.info-steps { margin: 0; padding-left: 18px; color: #4a5168; font-size: 13px; }
.info-steps li { margin-bottom: 4px; }
.info-steps.tick { list-style: none; padding-left: 0; }
.info-steps.tick li::before { content: '✓'; color: var(--green); font-weight: 800; margin-right: 8px; }

/* ---------------- Referral link ---------------- */
.ref-link-box {
    display: flex; align-items: center; background: var(--card);
    border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.ref-link-box input { border: none; flex: 1; padding: 13px 14px; font-size: 12.5px; color: var(--purple); background: transparent; outline: none; }
.copy-inline { border: none; background: var(--purple); color: #fff; padding: 0 16px; align-self: stretch; font-size: 16px; }

/* ---------------- Lists ---------------- */
.list-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.list-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 13.5px; color: var(--ink); text-decoration: none;
}
.list-row:last-child { border-bottom: none; }
.list-row span i { margin-right: 8px; font-size: 16px; }
.list-row.clickable { cursor: pointer; }
.list-row.clickable:active { background: #fafbff; }

/* ---------------- Withdraw ---------------- */
.avail-card {
    background: linear-gradient(135deg, #eafff5, #eef0ff); border-radius: var(--radius);
    padding: 16px; text-align: center; border: 1px solid #e6ecff;
}
.avail-amount { font-size: 28px; font-weight: 800; color: var(--green-dark); }
.input-prefix { display: flex; align-items: center; background: #fff; border: 1.5px solid var(--line); border-radius: 14px; overflow: hidden; }
.input-prefix span { padding: 0 14px; font-weight: 700; color: var(--muted); }
.input-prefix input { border: none; box-shadow: none; padding: 13px 8px; font-weight: 700; font-size: 16px; }
.input-prefix input:focus { box-shadow: none; }
.form-control { border-radius: 14px; padding: 13px 14px; border: 1.5px solid var(--line); }
.form-control:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(22,199,132,.12); }
.form-label { font-weight: 600; font-size: 13px; }

.quick-amounts { display: flex; gap: 8px; margin-top: 10px; }
.quick-amounts button {
    flex: 1; border: 1.5px solid var(--line); background: #fff; border-radius: 12px;
    padding: 9px 0; font-weight: 700; font-size: 13px; color: var(--ink);
}
.quick-amounts button.active { border-color: var(--green); background: #eafff5; color: var(--green-dark); }

.method-row { display: flex; gap: 8px; }
.method-row button {
    flex: 1; border: 1.5px solid var(--line); background: #fff; border-radius: 12px;
    padding: 10px 0; font-weight: 700; font-size: 12.5px; color: var(--ink); text-transform: uppercase;
}
.method-row button.active { border-color: var(--purple); background: #f1ecff; color: var(--purple); }

.warn-note { background: #fff7ed; color: #b3651b; border-radius: 12px; padding: 10px 12px; font-size: 12px; }

/* ---------------- Tabs ---------------- */
.tab-row { display: flex; gap: 8px; background: #fff; padding: 6px; border-radius: 14px; box-shadow: var(--shadow); }
.tab { flex: 1; border: none; background: transparent; padding: 9px 0; border-radius: 10px; font-weight: 700; font-size: 13px; color: var(--muted); }
.tab.active { background: var(--green); color: #fff; }

/* ---------------- History items ---------------- */
.hist-item {
    display: flex; align-items: center; gap: 12px;
    background: var(--card); border-radius: var(--radius); padding: 13px 14px; box-shadow: var(--shadow);
}
.hist-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; }
.hist-ic.up { background: #eafff5; color: var(--green); }
.hist-ic.down { background: #fdecec; color: #e5484d; }
.hist-main { flex: 1; }
.hist-amount { font-weight: 800; font-size: 15px; }
.hist-sub { color: var(--muted); font-size: 11.5px; }
.badge-status { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.badge-approved { background: #eafff5; color: var(--green-dark); }
.badge-pending { background: #fff7ed; color: #c9821f; }
.badge-rejected { background: #fdecec; color: #e5484d; }

/* ---------------- Check-in grid ---------------- */
.checkin-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.checkin-day {
    background: var(--card); border-radius: 16px; padding: 12px 6px; text-align: center;
    box-shadow: var(--shadow); border: 2px solid transparent; position: relative;
}
.checkin-day .cd-day { font-size: 11px; color: var(--muted); font-weight: 600; }
.checkin-day .cd-reward { font-weight: 800; font-size: 16px; margin-top: 4px; }
.checkin-day .cd-state { font-size: 16px; margin-top: 6px; color: #c5cad6; }
.checkin-day.claimed { background: #eafff5; }
.checkin-day.claimed .cd-state { color: var(--green); }
.checkin-day.current { border-color: var(--purple); background: #f3efff; }
.checkin-day.current .cd-reward { color: var(--purple); }
.checkin-day .cd-today { position: absolute; top: -8px; left: 50%; transform: translateX(-50%); background: var(--purple); color: #fff; font-size: 9px; font-weight: 700; padding: 2px 8px; border-radius: 999px; }

/* ---------------- Bottom nav ---------------- */
.bottom-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: var(--maxw); background: #fff;
    display: flex; justify-content: space-around; align-items: center;
    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(20, 30, 60, .07); z-index: 100;
}
.nav-btn {
    border: none; background: transparent; color: var(--muted);
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 10.5px; font-weight: 600; flex: 1; padding: 4px 0;
}
.nav-btn i { font-size: 20px; }
.nav-btn.active { color: var(--green); }

/* ---------------- Reward overlay ---------------- */
.reward-overlay {
    position: fixed; inset: 0; z-index: 2000;
    background: linear-gradient(160deg, #2a1f55, #1c1640);
    display: flex; align-items: center; justify-content: center; padding: 28px; color: #fff;
}
.reward-content { text-align: center; max-width: 360px; width: 100%; animation: pop .4s ease; }
.reward-content h2 { font-weight: 800; }
.reward-check {
    width: 96px; height: 96px; margin: 0 auto 16px; border-radius: 50%;
    background: var(--green); display: grid; place-items: center; font-size: 52px;
    box-shadow: 0 0 0 12px rgba(22,199,132,.18); animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 12px rgba(22,199,132,.18); } 50% { box-shadow: 0 0 0 20px rgba(22,199,132,.08); } }
.reward-amount { font-size: 44px; font-weight: 800; color: var(--green); margin: 8px 0; }
.btn-link-light { background: none; border: none; color: #c9c2ee; text-decoration: underline; font-weight: 600; }

/* ---------------- Toast ---------------- */
.toast-box {
    position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px);
    background: #1a1f36; color: #fff; padding: 12px 18px; border-radius: 12px;
    font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; transition: .3s; z-index: 3000;
    max-width: 88%; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.toast-box.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-box.success { background: var(--green-dark); }
.toast-box.error { background: #e5484d; }

/* ---------------- Skeleton ---------------- */
.skeleton-row { height: 64px; border-radius: var(--radius); background: linear-gradient(90deg, #eef1f6 25%, #f7f9fc 50%, #eef1f6 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

.empty-state { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty-state i { font-size: 40px; display: block; margin-bottom: 8px; opacity: .5; }

.spin { animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
