/* =============================================
   EarnHopes — Main Stylesheet
   Font: Sora + JetBrains Mono
   Theme: Dark luxury finance
============================================= */

:root {
    --bg-base:       #0a0d14;
    --bg-card:       #111520;
    --bg-card2:      #161b28;
    --bg-sidebar:    #0d1119;
    --border:        rgba(255,255,255,0.07);
    --border-glow:   rgba(99,211,147,0.3);

    --accent:        #63d393;
    --accent-dim:    rgba(99,211,147,0.12);
    --accent2:       #4fa8e8;
    --accent2-dim:   rgba(79,168,232,0.12);
    --gold:          #f5c842;
    --gold-dim:      rgba(245,200,66,0.12);
    --danger:        #f06060;
    --danger-dim:    rgba(240,96,96,0.12);

    --text-primary:  #e8edf5;
    --text-secondary:#8b95a8;
    --text-muted:    #4a5568;

    --radius-sm:     8px;
    --radius-md:     14px;
    --radius-lg:     20px;

    --sidebar-w:     260px;
    --topbar-h:      68px;

    --shadow-card:   0 4px 24px rgba(0,0,0,0.4);
    --shadow-glow:   0 0 30px rgba(99,211,147,0.1);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: 'Sora', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
    width: var(--sidebar-w);
    min-height: 100vh;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    z-index: 100;
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 28px 24px 24px;
    border-bottom: 1px solid var(--border);
}

.logo-icon {
    width: 38px; height: 38px;
    background: var(--accent);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    color: #0a0d14;
    font-size: 16px;
    box-shadow: 0 0 16px rgba(99,211,147,0.35);
}

.logo-text {
    font-size: 18px;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}
.logo-text strong { color: var(--accent); }

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    position: relative;
}

.nav-item i { width: 18px; text-align: center; font-size: 15px; }

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-dim);
    color: var(--accent);
    border: 1px solid rgba(99,211,147,0.15);
}

.nav-item.logout:hover { color: var(--danger); background: var(--danger-dim); }

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 10px 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-top: 1px solid var(--border);
    background: rgba(255,255,255,0.02);
}

.user-avatar {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    color: #0a0d14;
    flex-shrink: 0;
}

.user-info { display: flex; flex-direction: column; overflow: hidden; }
.user-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-status { font-size: 11px; margin-top: 2px; }
.user-status.active  { color: var(--accent); }
.user-status.pending { color: var(--gold); }
.user-status.suspended { color: var(--danger); }

/* ── MAIN WRAPPER ── */
.main-wrapper {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ── TOPBAR ── */
.topbar {
    height: var(--topbar-h);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 28px;
    gap: 16px;
    position: sticky; top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
}

.menu-toggle {
    display: none;
    background: none; border: none;
    color: var(--text-secondary);
    font-size: 18px; cursor: pointer;
    padding: 6px;
}

.topbar-title {
    font-size: 17px;
    font-weight: 600;
    flex: 1;
    letter-spacing: -0.2px;
}

.topbar-right { display: flex; align-items: center; gap: 14px; }

.notif-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--bg-card2);
    border: 1px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.notif-btn:hover { border-color: var(--accent); color: var(--accent); }

.topbar-avatar {
    width: 36px; height: 36px;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 700; color: #0a0d14;
    text-decoration: none;
    cursor: pointer;
}

/* ── PAGE CONTENT ── */
.page-content {
    flex: 1;
    padding: 32px 28px;
    max-width: 1300px;
    width: 100%;
}

/* ── CARDS ── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    box-shadow: var(--shadow-card);
}

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

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-icon {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
}

/* ── STAT CARDS ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 22px;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: var(--stat-color, var(--accent));
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.stat-card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.12); }

.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.stat-sub {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-green { background: var(--accent-dim); color: var(--accent); }
.badge-blue  { background: var(--accent2-dim); color: var(--accent2); }
.badge-gold  { background: var(--gold-dim); color: var(--gold); }
.badge-red   { background: var(--danger-dim); color: var(--danger); }

/* ── TABLES ── */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead tr {
    background: var(--bg-base);
}

thead th {
    padding: 13px 16px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.8px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

tbody tr {
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
}

tbody tr:hover { background: rgba(255,255,255,0.03); }
tbody tr:last-child { border-bottom: none; }

tbody td {
    padding: 14px 16px;
    color: var(--text-secondary);
    vertical-align: middle;
}

tbody td.mono {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-primary);
}

tbody td.amount-green { color: var(--accent); font-family: 'JetBrains Mono', monospace; font-weight: 600; }
tbody td.amount-blue  { color: var(--accent2); font-family: 'JetBrains Mono', monospace; font-weight: 600; }
tbody td.amount-gold  { color: var(--gold); font-family: 'JetBrains Mono', monospace; font-weight: 600; }

/* ── STATUS PILLS ── */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.status-success  { background: var(--accent-dim); color: var(--accent); }
.status-pending  { background: var(--gold-dim); color: var(--gold); }
.status-failed   { background: var(--danger-dim); color: var(--danger); }

/* ── SECTION HEADERS ── */
.section-header {
    margin-bottom: 22px;
}
.section-header h2 {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.4px;
}
.section-header p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}

/* ── GRID LAYOUTS ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.three-col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }

/* ── FORMS ── */
.form-group { margin-bottom: 18px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 7px;
}

.form-control {
    width: 100%;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 14px;
    color: var(--text-primary);
    font-family: 'Sora', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s;
    outline: none;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,211,147,0.08);
}

.form-control:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-family: 'Sora', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: #0a0d14;
}
.btn-primary:hover { background: #78e8a8; box-shadow: 0 0 20px rgba(99,211,147,0.3); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

.btn-danger {
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid rgba(240,96,96,0.2);
}
.btn-danger:hover { background: var(--danger); color: white; }

/* ── ALERT / FLASH ── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(99,211,147,0.2); }
.alert-error   { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(240,96,96,0.2); }
.alert-info    { background: var(--accent2-dim); color: var(--accent2); border: 1px solid rgba(79,168,232,0.2); }

/* ── EMPTY STATE ── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state i { font-size: 40px; margin-bottom: 14px; display: block; }
.empty-state p { font-size: 14px; }

/* ── REFERRAL CARD ── */
.referral-card {
    background: linear-gradient(135deg, rgba(99,211,147,0.08), rgba(79,168,232,0.08));
    border: 1px solid rgba(99,211,147,0.2);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
}

.referral-code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 3px;
    background: var(--bg-base);
    border: 1px dashed rgba(99,211,147,0.3);
    border-radius: var(--radius-sm);
    padding: 14px 28px;
    display: inline-block;
    margin: 14px 0;
}

.copy-btn {
    background: var(--accent-dim);
    border: 1px solid rgba(99,211,147,0.2);
    color: var(--accent);
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Sora', sans-serif;
}
.copy-btn:hover { background: var(--accent); color: #0a0d14; }

/* ── PROFILE ── */
.profile-banner {
    height: 140px;
    background: linear-gradient(135deg, rgba(99,211,147,0.15), rgba(79,168,232,0.15));
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid var(--border);
    border-bottom: none;
    position: relative;
}

.profile-avatar-wrap {
    position: absolute;
    bottom: -36px;
    left: 28px;
}

.profile-avatar-lg {
    width: 72px; height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 700; color: #0a0d14;
    border: 3px solid var(--bg-base);
}

.profile-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 52px 28px 28px;
}

.profile-name { font-size: 20px; font-weight: 700; }
.profile-email { font-size: 13px; color: var(--text-secondary); margin-top: 3px; }

.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 24px;
}

.info-item { }
.info-item .label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 4px; }
.info-item .value { font-size: 14px; color: var(--text-primary); font-weight: 500; }

/* ── LOGIN PAGE ── */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-base);
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(99,211,147,0.06) 0%, transparent 70%);
    top: -100px; left: -100px;
    pointer-events: none;
}

.login-page::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(79,168,232,0.06) 0%, transparent 70%);
    bottom: -50px; right: -50px;
    pointer-events: none;
}

.login-box {
    width: 100%;
    max-width: 420px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-logo {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo .logo-icon {
    width: 54px; height: 54px;
    font-size: 22px;
    margin: 0 auto 14px;
}

.login-logo h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.login-logo h1 span { color: var(--accent); }

.login-logo p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 5px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.input-icon-wrap {
    position: relative;
}

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

.input-icon-wrap .form-control { padding-left: 40px; }

.input-icon-wrap .toggle-pass {
    position: absolute;
    right: 14px; top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    background: none; border: none;
    font-size: 14px;
}

.btn-full { width: 100%; justify-content: center; }

.login-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 13px;
    color: var(--text-muted);
}

.login-footer a { color: var(--accent); text-decoration: none; }

/* ── SIDEBAR OVERLAY (mobile) ── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99;
    backdrop-filter: blur(2px);
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.open {
        display: block;
    }
    .main-wrapper {
        margin-left: 0;
    }
    .menu-toggle {
        display: flex;
    }
    .two-col, .three-col {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    .info-grid {
        grid-template-columns: 1fr;
    }
    .page-content {
        padding: 20px 16px;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .topbar { padding: 0 16px; }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

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

.fade-up { animation: fadeInUp 0.4s ease both; }
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.10s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.20s; }
.delay-5 { animation-delay: 0.25s; }
.delay-6 { animation-delay: 0.30s; }

/* ── PAGE FOOTER ── */
.page-footer {
    border-top: 1px solid var(--border);
    background: var(--bg-sidebar);
    padding: 18px 28px;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    max-width: 1300px;
}

.footer-left {
    font-size: 12px;
    color: var(--text-muted);
}
.footer-left strong { color: var(--text-secondary); }

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
}

.footer-links a {
    font-size: 12px;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--accent); }

/* ── SUPPORT GRID ── */
.support-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-bottom: 0;
}

.support-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    transition: border-color 0.2s, transform 0.2s;
}

.support-card:hover {
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-2px);
}

.support-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.support-info { flex: 1; }

.support-dept {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.support-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 10px;
}

.support-email {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 500;
    transition: opacity 0.2s;
}
.support-email:hover { opacity: 0.75; }

/* ── LEGAL LINKS ── */
.legal-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    background: var(--bg-base);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}
.legal-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}
.legal-link i:first-child { color: var(--accent2); font-size: 14px; }

/* ── TOPBAR ADD FUNDS BUTTON ── */
@media (max-width: 600px) {
    .add-funds-label { display: none; }
}

@media (max-width: 900px) {
    .footer-inner { flex-direction: column; align-items: flex-start; }
    .support-grid { grid-template-columns: 1fr; }
}
