/* Read & Earn - Main Stylesheet */
:root {
    --primary: #6C3EF4;
    --primary-dark: #5428E0;
    --primary-light: #EDE9FF;
    --secondary: #F59E0B;
    --secondary-light: #FEF3C7;
    --success: #10B981;
    --success-light: #D1FAE5;
    --danger: #EF4444;
    --danger-light: #FEE2E2;
    --warning: #F59E0B;
    --warning-light: #FEF3C7;
    --info: #3B82F6;
    --info-light: #DBEAFE;
    --dark: #1E1B4B;
    --gray-50: #F8FAFC;
    --gray-100: #F1F5F9;
    --gray-200: #E2E8F0;
    --gray-300: #CBD5E1;
    --gray-400: #94A3B8;
    --gray-500: #64748B;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1E293B;
    --gray-900: #0F172A;
    --white: #FFFFFF;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 20px;
    --shadow: 0 4px 24px rgba(108,62,244,0.10);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.07);
    --shadow-lg: 0 8px 40px rgba(108,62,244,0.18);
}

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

body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-800);
    line-height: 1.6;
    font-size: 15px;
}

a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* ── LAYOUT ─────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.page-wrapper { display: flex; min-height: 100vh; }

/* ── TOPNAV ─────────────────────────────────── */
.topnav {
    background: var(--white);
    border-bottom: 1px solid var(--gray-200);
    position: sticky; top: 0; z-index: 100;
    height: 64px; display: flex; align-items: center;
}
.topnav-inner {
    display: flex; align-items: center; justify-content: space-between; width: 100%;
}
.logo {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 22px; color: var(--primary);
}
.logo-icon {
    width: 36px; height: 36px; background: var(--primary);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
}
.logo-icon svg { color: white; }
.nav-links { display: flex; align-items: center; gap: 8px; }
.nav-links a {
    padding: 8px 16px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; color: var(--gray-600);
    transition: all 0.2s;
}
.nav-links a:hover { background: var(--primary-light); color: var(--primary); }
.nav-links a.active { background: var(--primary-light); color: var(--primary); }
.nav-wallet {
    display: flex; align-items: center; gap: 8px;
    background: var(--primary-light); padding: 8px 16px;
    border-radius: 50px; font-size: 14px; font-weight: 600; color: var(--primary);
}

/* ── SIDEBAR ─────────────────────────────────── */
.sidebar {
    width: 260px; min-height: calc(100vh - 64px);
    background: var(--white); border-right: 1px solid var(--gray-200);
    padding: 24px 16px; flex-shrink: 0;
    position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto;
}
.sidebar-section { margin-bottom: 8px; }
.sidebar-label {
    font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
    text-transform: uppercase; color: var(--gray-400);
    padding: 8px 12px 4px;
}
.sidebar-link {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 500; color: var(--gray-600);
    transition: all 0.15s; margin-bottom: 2px;
}
.sidebar-link:hover { background: var(--gray-100); color: var(--gray-900); }
.sidebar-link.active {
    background: var(--primary-light); color: var(--primary); font-weight: 600;
}
.sidebar-link svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-badge {
    margin-left: auto; background: var(--danger);
    color: white; font-size: 11px; font-weight: 600;
    padding: 2px 7px; border-radius: 50px; min-width: 20px; text-align: center;
}

/* ── MAIN CONTENT ─────────────────────────────── */
.main-content { flex: 1; padding: 32px; overflow-x: hidden; }
.page-header { margin-bottom: 28px; }
.page-title { font-size: 26px; font-weight: 700; color: var(--gray-900); }
.page-subtitle { font-size: 14px; color: var(--gray-500); margin-top: 4px; }

/* ── STATS GRID ─────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-card {
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius); padding: 20px 24px;
}
.stat-card-label { font-size: 13px; color: var(--gray-500); margin-bottom: 6px; }
.stat-card-value { font-size: 28px; font-weight: 700; color: var(--gray-900); }
.stat-card-sub { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.stat-card.primary { background: var(--primary); border-color: var(--primary); }
.stat-card.primary .stat-card-label,
.stat-card.primary .stat-card-sub { color: rgba(255,255,255,0.75); }
.stat-card.primary .stat-card-value { color: white; }
.stat-card.success { background: var(--success); border-color: var(--success); }
.stat-card.success .stat-card-label,
.stat-card.success .stat-card-sub { color: rgba(255,255,255,0.75); }
.stat-card.success .stat-card-value { color: white; }

/* ── CARDS ─────────────────────────────────── */
.card {
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius); margin-bottom: 24px;
}
.card-header {
    padding: 20px 24px; border-bottom: 1px solid var(--gray-100);
    display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 16px; font-weight: 600; color: var(--gray-900); }
.card-body { padding: 24px; }

/* ── TABLES ─────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead tr { border-bottom: 2px solid var(--gray-100); }
th {
    padding: 12px 16px; text-align: left;
    font-size: 12px; font-weight: 600; letter-spacing: 0.05em;
    text-transform: uppercase; color: var(--gray-400);
}
td { padding: 14px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--gray-50); }

/* ── BADGES ─────────────────────────────────── */
.badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 4px 10px; border-radius: 50px; font-size: 12px; font-weight: 600;
}
.badge-success { background: var(--success-light); color: #065F46; }
.badge-danger { background: var(--danger-light); color: #991B1B; }
.badge-warning { background: var(--warning-light); color: #92400E; }
.badge-info { background: var(--info-light); color: #1E40AF; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }
.badge-purple { background: var(--primary-light); color: var(--primary-dark); }

/* ── BUTTONS ─────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 20px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; border: none; cursor: pointer;
    transition: all 0.15s; line-height: 1;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }
.btn-warning { background: var(--warning); color: white; }
.btn-outline {
    background: white; color: var(--gray-700);
    border: 1px solid var(--gray-300);
}
.btn-outline:hover { background: var(--gray-50); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 6px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius); }
.btn-block { width: 100%; justify-content: center; }

/* ── FORMS ─────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block; margin-bottom: 6px;
    font-size: 13px; font-weight: 600; color: var(--gray-700);
}
.form-control {
    width: 100%; padding: 10px 14px;
    border: 1.5px solid var(--gray-200); border-radius: var(--radius-sm);
    font-size: 14px; font-family: var(--font); color: var(--gray-800);
    background: white; transition: all 0.15s; outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.form-control::placeholder { color: var(--gray-400); }
textarea.form-control { resize: vertical; min-height: 120px; }
.form-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ── PLANS GRID ─────────────────────────────── */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.plan-card {
    background: white; border: 2px solid var(--gray-200);
    border-radius: var(--radius-lg); padding: 28px 24px; text-align: center;
    cursor: pointer; transition: all 0.2s; position: relative;
}
.plan-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.plan-card.selected, .plan-card.recommended {
    border-color: var(--primary); background: var(--primary-light);
}
.plan-badge {
    position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
    background: var(--primary); color: white; font-size: 11px; font-weight: 700;
    padding: 4px 16px; border-radius: 50px; white-space: nowrap;
}
.plan-price { font-size: 36px; font-weight: 800; color: var(--primary); line-height: 1; }
.plan-price span { font-size: 18px; font-weight: 600; }
.plan-name { font-size: 15px; font-weight: 700; color: var(--gray-800); margin: 10px 0 4px; }
.plan-articles { font-size: 13px; color: var(--gray-500); }
.plan-profit {
    margin-top: 16px; padding: 10px;
    background: var(--success-light); border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 700; color: #065F46;
}
.plan-profit-label { font-size: 11px; font-weight: 500; color: #059669; }

/* ── READING TIMER ─────────────────────────── */
.reading-container {
    max-width: 800px; margin: 0 auto; padding: 32px;
}
.article-timer {
    position: sticky; top: 64px;
    background: white; border: 2px solid var(--primary);
    border-radius: var(--radius); padding: 16px 24px; margin-bottom: 24px;
    display: flex; align-items: center; justify-content: space-between;
    z-index: 10;
}
.timer-ring {
    width: 64px; height: 64px; position: relative;
    flex-shrink: 0;
}
.timer-ring svg { transform: rotate(-90deg); }
.timer-ring .bg { fill: none; stroke: var(--gray-200); stroke-width: 5; }
.timer-ring .progress {
    fill: none; stroke: var(--primary); stroke-width: 5;
    stroke-linecap: round;
    stroke-dasharray: 176;
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 1s linear;
}
.timer-number {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px; font-weight: 700; color: var(--primary);
}
.timer-info { flex: 1; padding: 0 20px; }
.timer-title { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.timer-sub { font-size: 13px; color: var(--gray-500); }
.timer-earn {
    font-size: 20px; font-weight: 800; color: var(--success);
    text-align: right;
}
.timer-earn-label { font-size: 11px; color: var(--gray-400); }
.article-content {
    background: white; border: 1px solid var(--gray-200);
    border-radius: var(--radius); padding: 32px;
}
.article-content h1 { font-size: 28px; font-weight: 800; color: var(--gray-900); margin-bottom: 16px; }
.article-content p { font-size: 16px; line-height: 1.8; color: var(--gray-700); margin-bottom: 16px; }
.article-content img { border-radius: var(--radius); margin: 20px 0; }

/* ── AUTH PAGES ─────────────────────────────── */
.auth-page {
    min-height: 100vh; display: flex;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 50%, #1E1B4B 100%);
}
.auth-left {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; padding: 60px;
    color: white;
}
.auth-right {
    width: 480px; min-height: 100vh; background: white;
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; padding: 60px 50px;
}
.auth-logo {
    font-size: 32px; font-weight: 800; color: white;
    display: flex; align-items: center; gap: 14px; margin-bottom: 32px;
}
.auth-tagline { font-size: 42px; font-weight: 800; line-height: 1.15; margin-bottom: 20px; }
.auth-sub { font-size: 17px; opacity: 0.85; max-width: 440px; }
.auth-features { margin-top: 48px; display: flex; flex-direction: column; gap: 16px; }
.auth-feature {
    display: flex; align-items: center; gap: 14px;
    font-size: 16px; font-weight: 500;
}
.auth-feature-icon {
    width: 40px; height: 40px; background: rgba(255,255,255,0.15);
    border-radius: 10px; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.auth-form-title { font-size: 28px; font-weight: 800; color: var(--gray-900); margin-bottom: 8px; }
.auth-form-sub { font-size: 14px; color: var(--gray-500); margin-bottom: 32px; }
.auth-divider { text-align: center; color: var(--gray-400); font-size: 13px; margin: 20px 0; }
.auth-switch { text-align: center; margin-top: 24px; font-size: 14px; color: var(--gray-500); }
.auth-switch a { color: var(--primary); font-weight: 600; }

/* ── ALERTS ─────────────────────────────────── */
.alert {
    padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px;
    font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 10px;
}
.alert-success { background: var(--success-light); color: #065F46; border: 1px solid #A7F3D0; }
.alert-danger { background: var(--danger-light); color: #991B1B; border: 1px solid #FECACA; }
.alert-warning { background: var(--warning-light); color: #92400E; border: 1px solid #FDE68A; }
.alert-info { background: var(--info-light); color: #1E40AF; border: 1px solid #BFDBFE; }

/* ── PAYMENT METHODS ─────────────────────────── */
.payment-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.payment-method {
    border: 2px solid var(--gray-200); border-radius: var(--radius);
    padding: 20px 16px; text-align: center; cursor: pointer;
    transition: all 0.2s;
}
.payment-method:hover { border-color: var(--primary); background: var(--primary-light); }
.payment-method.selected { border-color: var(--primary); background: var(--primary-light); }
.payment-method-icon { font-size: 36px; margin-bottom: 8px; }
.payment-method-name { font-size: 14px; font-weight: 600; color: var(--gray-700); }

/* ── WALLET ─────────────────────────────────── */
.wallet-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: var(--radius-lg); padding: 32px;
    color: white; margin-bottom: 28px;
}
.wallet-label { font-size: 14px; opacity: 0.8; margin-bottom: 8px; }
.wallet-balance { font-size: 48px; font-weight: 800; line-height: 1; }
.wallet-actions { display: flex; gap: 12px; margin-top: 24px; }
.wallet-btn {
    flex: 1; padding: 12px; border-radius: var(--radius-sm);
    font-size: 14px; font-weight: 600; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.15s;
}
.wallet-btn-deposit { background: white; color: var(--primary); }
.wallet-btn-withdraw { background: rgba(255,255,255,0.15); color: white; border: 1px solid rgba(255,255,255,0.3); }

/* ── HOMEPAGE ─────────────────────────────────── */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 60%, #1E1B4B 100%);
    padding: 80px 0 100px; text-align: center; color: white;
}
.hero-title { font-size: 54px; font-weight: 900; line-height: 1.1; margin-bottom: 20px; }
.hero-sub { font-size: 20px; opacity: 0.85; max-width: 580px; margin: 0 auto 36px; }
.hero-cta { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.hero-stats {
    display: flex; gap: 48px; justify-content: center; margin-top: 56px;
    padding-top: 40px; border-top: 1px solid rgba(255,255,255,0.2);
}
.hero-stat-value { font-size: 36px; font-weight: 800; }
.hero-stat-label { font-size: 14px; opacity: 0.75; }

/* ── UTILITY ─────────────────────────────────── */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--gray-400); }
.text-sm { font-size: 13px; }
.fw-bold { font-weight: 700; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; } .mb-4 { margin-bottom: 32px; }
.d-flex { display: flex; } .align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; } .gap-2 { gap: 16px; }
.empty-state { text-align: center; padding: 60px 24px; color: var(--gray-400); }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state p { font-size: 15px; }
.progress-bar { background: var(--gray-200); border-radius: 50px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); border-radius: 50px; transition: width 0.3s; }

/* ── RESPONSIVE ─────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main-content { padding: 20px 16px; }
    .form-row { grid-template-columns: 1fr; }
    .payment-methods { grid-template-columns: 1fr; }
    .hero-title { font-size: 34px; }
    .hero-stats { flex-wrap: wrap; gap: 24px; }
    .auth-left { display: none; }
    .auth-right { width: 100%; padding: 40px 24px; }
}
