/* ─── LeadGenAI Design System ─── */
:root {
    --bg-primary: #080C14;
    --bg-secondary: #0D1220;
    --bg-card: #111827;
    --bg-card-hover: #161F30;
    --border: #1E2D45;
    --border-glow: #2563EB40;
    --accent: #3B82F6;
    --accent-bright: #60A5FA;
    --accent-glow: #3B82F620;
    --green: #10B981;
    --green-glow: #10B98120;
    --yellow: #F59E0B;
    --red: #EF4444;
    --purple: #8B5CF6;
    --text-primary: #F1F5F9;
    --text-secondary: #94A3B8;
    --text-muted: #475569;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --shadow-accent: 0 0 40px rgba(59,130,246,0.12);
}

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

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    min-height: 100vh;
}

/* ─── Navbar ─── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: 64px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-primary);
}
.brand-icon { font-size: 22px; }
.brand-ai { color: var(--accent); }

.nav-links {
    display: flex;
    gap: 4px;
}
.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
    background: var(--accent-glow);
}
.nav-links a.active { color: var(--accent-bright); }

.nav-right { display: flex; align-items: center; gap: 16px; position: relative; }

.coin-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #1A2540, #1E2D45);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 6px 14px;
    font-size: 13px;
}
.coin-icon { font-size: 16px; }
.coin-count { font-weight: 700; font-family: var(--font-display); color: var(--yellow); }
.coin-label { color: var(--text-muted); font-size: 12px; }

.nav-user {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    font-size: 14px;
}
.nav-user:hover { background: var(--bg-card); }
.avatar {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px;
}
.chevron { color: var(--text-muted); font-size: 11px; }

.dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px;
    min-width: 160px;
    display: none;
    box-shadow: var(--shadow);
}
.dropdown.open { display: block; }
.dropdown a, .dropdown button {
    display: block;
    width: 100%;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 6px;
    text-align: left;
    transition: all 0.2s;
}
.dropdown a:hover, .dropdown button:hover {
    color: var(--text-primary);
    background: var(--border);
}

/* ─── Main Content ─── */
.main-content { padding: 32px; max-width: 1280px; margin: 0 auto; }

/* ─── Alerts ─── */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 500;
}
.alert-success { background: var(--green-glow); border: 1px solid var(--green); color: var(--green); }
.alert-error { background: #EF444420; border: 1px solid var(--red); color: var(--red); }

/* ─── Cards ─── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.card:hover { border-color: var(--border-glow); box-shadow: var(--shadow-accent); }
.card-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}
.card-subtitle { color: var(--text-muted); font-size: 13px; }

/* ─── Grid ─── */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media(max-width:1024px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media(max-width:640px) { .grid-4,.grid-3,.grid-2 { grid-template-columns: 1fr; } .main-content { padding: 16px; } .navbar { padding: 0 16px; } }

/* ─── Stat Cards ─── */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
}
.stat-card.blue::before { background: linear-gradient(90deg, var(--accent), transparent); }
.stat-card.green::before { background: linear-gradient(90deg, var(--green), transparent); }
.stat-card.yellow::before { background: linear-gradient(90deg, var(--yellow), transparent); }
.stat-card.purple::before { background: linear-gradient(90deg, var(--purple), transparent); }
.stat-icon { font-size: 24px; margin-bottom: 12px; }
.stat-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}
.stat-label { color: var(--text-muted); font-size: 13px; }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
    text-decoration: none;
    font-family: var(--font-body);
}
.btn-primary {
    background: var(--accent);
    color: white;
}
.btn-primary:hover { background: #2563EB; transform: translateY(-1px); box-shadow: 0 4px 16px rgba(59,130,246,0.4); }
.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-green { background: var(--green); color: white; }
.btn-green:hover { background: #059669; transform: translateY(-1px); }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius); }
.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ─── Forms ─── */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}
.form-control {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-family: var(--font-body);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-control::placeholder { color: var(--text-muted); }
.form-error { color: var(--red); font-size: 12px; margin-top: 4px; }

/* ─── Badges ─── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 12px;
    font-weight: 600;
}
.badge-blue { background: var(--accent-glow); color: var(--accent-bright); border: 1px solid #3B82F640; }
.badge-green { background: var(--green-glow); color: var(--green); border: 1px solid #10B98140; }
.badge-yellow { background: #F59E0B20; color: var(--yellow); border: 1px solid #F59E0B40; }
.badge-purple { background: #8B5CF620; color: var(--purple); border: 1px solid #8B5CF640; }

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

/* ─── Page Header ─── */
.page-header { margin-bottom: 28px; }
.page-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 4px;
}
.page-sub { color: var(--text-muted); font-size: 14px; }

/* ─── Coin Timer Widget ─── */
.coin-timer-card {
    background: linear-gradient(135deg, #0F172A, #1E1B4B);
    border: 1px solid #4338CA40;
    border-radius: var(--radius);
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.coin-timer-left { display: flex; align-items: center; gap: 16px; }
.coin-timer-icon { font-size: 36px; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
.coin-timer-info .label { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.coin-timer-info .value {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--yellow);
}
.coin-timer-countdown { text-align: right; }
.countdown-label { color: var(--text-muted); font-size: 11px; text-transform: uppercase; }
.countdown-time {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-bright);
    letter-spacing: 2px;
}

/* ─── Scraper Box ─── */
.scraper-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.scraper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
}
.scraper-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
}
.scraper-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}
.status-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}
.status-dot.active { background: var(--green); box-shadow: 0 0 8px var(--green); animation: blink 1.2s infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
.scraper-body { padding: 24px; }
.scraper-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.scraper-actions { display: flex; gap: 12px; align-items: center; }
.cost-label {
    color: var(--text-muted);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.cost-label strong { color: var(--yellow); }

/* ─── Progress Bar ─── */
.progress-wrap { margin-top: 20px; display: none; }
.progress-wrap.visible { display: block; }
.progress-info { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-muted); margin-bottom: 8px; }
.progress-bar-bg {
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
}
.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--green));
    border-radius: 99px;
    transition: width 0.3s ease;
    width: 0%;
}
.live-log {
    margin-top: 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--green);
    height: 120px;
    overflow-y: auto;
}

/* ─── Plan Cards ─── */
.plan-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    position: relative;
    transition: all 0.2s;
}
.plan-card.popular {
    border-color: var(--accent);
    box-shadow: var(--shadow-accent);
}
.plan-popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 50px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.plan-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}
.plan-price {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin: 16px 0 4px;
}
.plan-price sup { font-size: 18px; color: var(--text-secondary); }
.plan-period { color: var(--text-muted); font-size: 13px; margin-bottom: 20px; }
.plan-features { list-style: none; margin-bottom: 24px; }
.plan-features li {
    padding: 8px 0;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border);
}
.plan-features li:last-child { border-bottom: none; }
.feat-check { color: var(--green); font-size: 14px; flex-shrink: 0; }

/* ─── Auth pages ─── */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(ellipse at 50% 0%, #1E3A8A15 0%, transparent 60%);
}
.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: var(--shadow);
}
.auth-logo {
    text-align: center;
    margin-bottom: 28px;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
}
.auth-logo span { color: var(--accent); }
.auth-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
    text-align: center;
}
.auth-sub { color: var(--text-muted); font-size: 14px; text-align: center; margin-bottom: 28px; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-muted); }
.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 500; }

/* ─── Empty state ─── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-title { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.empty-sub { color: var(--text-muted); font-size: 14px; }

/* ─── Section spacing ─── */
.section { margin-bottom: 28px; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.flex-gap { display: flex; align-items: center; gap: 12px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
