/* ============================================================
   EarnZone — Global Stylesheet
   Primary: #0080ff | Secondary: #add8e6 | Base: #ffffff
   ============================================================ */

:root {
    --primary:        #0080ff;
    --primary-dark:   #0060cc;
    --primary-light:  #4da6ff;
    --secondary:      #add8e6;
    --secondary-soft: #d6eef8;
    --white:          #ffffff;
    --bg:             #f4f8ff;
    --bg-card:        #ffffff;
    --text:           #1a2332;
    --text-muted:     #6b7c93;
    --text-light:     #a0aec0;
    --border:         #e2ecf7;
    --success:        #10b981;
    --warning:        #f59e0b;
    --danger:         #ef4444;
    --info:           #3b82f6;
    --shadow-sm:      0 1px 4px rgba(0,128,255,0.08);
    --shadow:         0 4px 20px rgba(0,128,255,0.12);
    --shadow-lg:      0 8px 40px rgba(0,128,255,0.18);
    --radius:         14px;
    --radius-sm:      8px;
    --radius-lg:      20px;
    --nav-height:     68px;
    --transition:     all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    padding-bottom: var(--nav-height);
}

a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; display: block; }

/* ── Typography ───────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}
h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

/* ── App Shell ────────────────────────────────────────────── */
.app-wrapper {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--white);
    position: relative;
    box-shadow: 0 0 60px rgba(0,128,255,0.06);
}

/* ── Top App Bar ─────────────────────────────────────────── */
.app-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(12px);
}

.app-bar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-bar-logo {
    height: 32px;
    width: auto;
}

.balance-chip {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    padding: 5px 12px;
    border-radius: 30px;
    font-size: 0.82rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(0,128,255,0.3);
}

/* ── Page Content ─────────────────────────────────────────── */
.page-content {
    padding: 20px 16px;
    animation: fadeSlideIn 0.3s ease;
}

@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 18px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.card:hover { box-shadow: var(--shadow); }

.card-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, #0060cc 100%);
    color: var(--white);
    border: none;
}

.card-soft {
    background: var(--secondary-soft);
    border-color: var(--secondary);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    letter-spacing: 0.02em;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: var(--white);
    box-shadow: 0 4px 15px rgba(0,128,255,0.35);
}
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,128,255,0.45);
    color: var(--white);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--secondary-soft);
    color: var(--primary);
    border: 1.5px solid var(--secondary);
}
.btn-secondary:hover {
    background: var(--secondary);
    transform: translateY(-1px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #059669);
    color: var(--white);
    box-shadow: 0 4px 15px rgba(16,185,129,0.3);
}
.btn-success:hover { transform: translateY(-2px); color: var(--white); }

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #dc2626);
    color: var(--white);
}
.btn-danger:hover { transform: translateY(-2px); color: var(--white); }

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-1px);
}

.btn-block { width: 100%; display: flex; }

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-lg { padding: 16px 32px; font-size: 1.05rem; border-radius: var(--radius); }
.btn-sm { padding: 8px 16px; font-size: 0.82rem; }

/* ── Bottom Navigation ────────────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: var(--nav-height);
    background: var(--white);
    border-top: 1px solid var(--border);
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    z-index: 200;
    box-shadow: 0 -4px 20px rgba(0,128,255,0.08);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 500;
    padding: 8px 4px;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    text-decoration: none;
}

.nav-item i {
    font-size: 1.3rem;
    transition: var(--transition);
}

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

.nav-item.active i {
    transform: scale(1.15);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 32px;
    height: 3px;
    background: var(--primary);
    border-radius: 0 0 4px 4px;
}

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

/* ── Section Header ───────────────────────────────────────── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title i { color: var(--primary); }

/* ── Balance Card ─────────────────────────────────────────── */
.balance-card {
    background: linear-gradient(135deg, #0080ff 0%, #0050cc 50%, #003399 100%);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    color: var(--white);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-bottom: 20px;
}

.balance-card::before {
    content: '';
    position: absolute;
    top: -40px;
    right: -40px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: rgba(255,255,255,0.06);
}
.balance-card::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255,255,255,0.04);
}

.balance-label {
    font-size: 0.82rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.balance-amount {
    font-size: 2.4rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.balance-sub {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* ── Alert / Toast ────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    animation: fadeSlideIn 0.3s ease;
}
.alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.alert-info    { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.alert-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }

/* ── Toast Notification ───────────────────────────────────── */
.toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    pointer-events: none;
    width: 90%;
    max-width: 360px;
}

.toast {
    background: var(--text);
    color: var(--white);
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 500;
    text-align: center;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
    margin-bottom: 8px;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-16px); }
}

/* ── Badge ────────────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 30px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}
.badge-success  { background: #d1fae5; color: #065f46; }
.badge-warning  { background: #fef3c7; color: #92400e; }
.badge-danger   { background: #fee2e2; color: #991b1b; }
.badge-primary  { background: #dbeafe; color: #1e40af; }
.badge-muted    { background: #f1f5f9; color: #64748b; }

/* ── List Items ───────────────────────────────────────────── */
.list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}
.list-item:last-child { border-bottom: none; }

.list-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.list-icon-primary { background: #dbeafe; color: var(--primary); }
.list-icon-success { background: #d1fae5; color: var(--success); }
.list-icon-warning { background: #fef3c7; color: var(--warning); }
.list-icon-danger  { background: #fee2e2; color: var(--danger); }

.list-body { flex: 1; min-width: 0; }
.list-title { font-size: 0.9rem; font-weight: 600; }
.list-subtitle { font-size: 0.78rem; color: var(--text-muted); margin-top: 2px; }
.list-meta { text-align: right; flex-shrink: 0; }
.list-amount { font-size: 0.95rem; font-weight: 700; }
.list-time { font-size: 0.72rem; color: var(--text-light); }

.amount-positive { color: var(--success); }
.amount-negative { color: var(--danger); }

/* ── Stats Grid ───────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow-sm);
}
.stat-value { font-size: 1.4rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; font-weight: 500; }

/* ── Empty State ──────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state i { font-size: 3.5rem; color: var(--secondary); margin-bottom: 16px; }
.empty-state h3 { font-size: 1rem; color: var(--text-muted); margin-bottom: 8px; }
.empty-state p  { font-size: 0.85rem; }

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Divider ──────────────────────────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Utilities ────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-bold      { font-weight: 700; }
.fw-semibold  { font-weight: 600; }
.fs-sm        { font-size: 0.82rem; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.w-full { width: 100%; }

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--secondary); border-radius: 4px; }

/* ── Selection ────────────────────────────────────────────── */
::selection { background: var(--primary); color: var(--white); }

/* ── Global Form Controls ─────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 7px;
}

.input-wrapper { position: relative; }

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 0.95rem;
    pointer-events: none;
}

.form-control {
    width: 100%;
    padding: 13px 14px 13px 40px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    color: var(--text);
    background: var(--white);
    transition: var(--transition);
    outline: none;
    font-family: inherit;
    -webkit-appearance: none;
    appearance: none;
}
.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,128,255,0.12);
}
.form-control::placeholder { color: var(--text-light); }
.form-control.no-icon { padding-left: 14px; }

textarea.form-control {
    resize: vertical;
    min-height: 110px;
    padding: 12px 14px;
    line-height: 1.6;
}

.toggle-password {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    transition: var(--transition);
}
.toggle-password:hover { color: var(--primary); }
