/* =========================================================
   VPLINK - DESIGN SYSTEM
   Theme: "Terminal Console" - dark, technical, precise.
   Display: Space Grotesk | Body: Inter | Data: JetBrains Mono
========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
    --bg: #0B0F19;
    --bg-soft: #0E1424;
    --surface: #131A2B;
    --surface-2: #1A2338;
    --border: #232D45;
    --border-soft: #1C2438;
    --text: #E7ECF7;
    --text-dim: #8B96B4;
    --text-faint: #5C6785;
    --accent: #4C8CFF;
    --accent-soft: rgba(76, 140, 255, 0.12);
    --accent-2: #23D5A0;
    --accent-2-soft: rgba(35, 213, 160, 0.12);
    --danger: #FF5D6C;
    --danger-soft: rgba(255, 93, 108, 0.12);
    --warning: #FFB020;
    --radius-sm: 8px;
    --radius: 14px;
    --radius-lg: 20px;
    --shadow: 0 10px 30px rgba(0,0,0,0.35);
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    background-image:
        radial-gradient(circle at 15% 0%, rgba(76,140,255,0.08), transparent 40%),
        radial-gradient(circle at 85% 20%, rgba(35,213,160,0.06), transparent 40%);
    color: var(--text);
    font-family: var(--font-body);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; letter-spacing: -0.02em; }
code, .mono { font-family: var(--font-mono); }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Layout Containers ---------- */
.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Top Navigation ---------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-soft);
}
.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1140px;
    margin: 0 auto;
    padding: 16px 24px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 20px;
}
.brand-mark {
    width: 32px; height: 32px;
    border-radius: 9px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    display: flex; align-items: center; justify-content: center;
    color: #04101f;
    font-weight: 700;
    font-size: 14px;
}
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--text-dim); font-size: 14.5px; font-weight: 500; transition: color .15s; }
.nav-links a:hover { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 14.5px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .12s ease, background .15s, border-color .15s, opacity .15s;
    text-align: center;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #3f7bef; }
.btn-outline { background: transparent; border-color: var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-ghost:hover { color: var(--text); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(255,93,108,0.3); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---------- Hero ---------- */
.hero {
    padding: 90px 0 60px;
    text-align: center;
}
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--accent-2);
    background: var(--accent-2-soft);
    border: 1px solid rgba(35,213,160,0.25);
    padding: 6px 14px;
    border-radius: 100px;
    margin-bottom: 24px;
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 8px var(--accent-2); }
.hero h1 {
    font-size: 52px;
    font-weight: 700;
    line-height: 1.1;
    max-width: 780px;
    margin: 0 auto 18px;
}
.hero h1 span { color: var(--accent); }
.hero p {
    color: var(--text-dim);
    font-size: 17px;
    max-width: 560px;
    margin: 0 auto 40px;
}

/* ---------- Shorten Console (signature element) ---------- */
.console {
    max-width: 700px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 8px;
    box-shadow: var(--shadow);
}
.console-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 4px;
}
.console-bar span { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.console-form { display: flex; gap: 8px; padding: 8px; }
.console-form input[type=url],
.console-form input[type=text] {
    flex: 1;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    color: var(--text);
    font-family: var(--font-mono);
    font-size: 14.5px;
}
.console-form input::placeholder { color: var(--text-faint); }

.result-card {
    display: none;
    margin-top: 14px;
    padding: 16px;
    background: var(--bg-soft);
    border: 1px dashed var(--accent);
    border-radius: var(--radius-sm);
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.result-card.show { display: flex; }
.result-url { font-family: var(--font-mono); color: var(--accent-2); font-weight: 600; font-size: 15px; word-break: break-all; }

/* ---------- Feature Grid ---------- */
.section { padding: 70px 0; }
.section-head { text-align: center; max-width: 560px; margin: 0 auto 48px; }
.section-head h2 { font-size: 32px; margin-bottom: 12px; }
.section-head p { color: var(--text-dim); font-size: 15.5px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 26px;
}
.feature-icon {
    width: 42px; height: 42px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 16px;
}
.feature-card h3 { font-size: 17px; margin-bottom: 8px; }
.feature-card p { color: var(--text-dim); font-size: 14.5px; margin: 0; }

/* ---------- Cards / Panels (generic) ---------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.panel-title { font-size: 16px; font-weight: 600; margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13.5px; color: var(--text-dim); margin-bottom: 8px; font-weight: 500; }
.form-control {
    width: 100%;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 14.5px;
    transition: border-color .15s;
}
.form-control:focus { border-color: var(--accent); }
textarea.form-control { resize: vertical; min-height: 90px; font-family: var(--font-mono); font-size: 13.5px; }
.form-hint { font-size: 12.5px; color: var(--text-faint); margin-top: 6px; }
.form-row { display: flex; gap: 14px; }
.form-row .form-group { flex: 1; }

.alert {
    padding: 13px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 18px;
    border: 1px solid transparent;
}
.alert-error { background: var(--danger-soft); color: #ffb3ba; border-color: rgba(255,93,108,0.3); }
.alert-success { background: var(--accent-2-soft); color: #6ff0c8; border-color: rgba(35,213,160,0.3); }
.alert-info { background: var(--accent-soft); color: #a9c6ff; border-color: rgba(76,140,255,0.3); }

/* ---------- Login Page ---------- */
.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: var(--shadow);
}
.auth-card .brand { justify-content: center; margin-bottom: 22px; }
.auth-card h2 { text-align: center; font-size: 22px; margin-bottom: 6px; }
.auth-card > p { text-align: center; color: var(--text-dim); font-size: 13.5px; margin-bottom: 28px; }

/* ---------- Admin Layout ---------- */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: var(--bg-soft);
    border-right: 1px solid var(--border-soft);
    padding: 22px 16px;
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
}
.sidebar .brand { padding: 0 10px 24px; }
.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.side-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    font-size: 14.5px; font-weight: 500;
    transition: all .15s;
}
.side-nav a:hover { background: var(--surface-2); color: var(--text); }
.side-nav a.active { background: var(--accent-soft); color: var(--accent); }
.side-nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar-foot { border-top: 1px solid var(--border-soft); padding-top: 14px; margin-top: 14px; }

.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 32px;
    border-bottom: 1px solid var(--border-soft);
}
.admin-topbar h1 { font-size: 20px; }
.admin-content { padding: 28px 32px 60px; }

/* ---------- Stat Cards ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 28px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.stat-card .label { color: var(--text-dim); font-size: 13px; margin-bottom: 10px; display:flex; align-items:center; gap:8px; }
.stat-card .value { font-family: var(--font-display); font-size: 28px; font-weight: 700; }
.stat-card .value.mono { font-family: var(--font-mono); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data-table th {
    text-align: left; color: var(--text-faint); font-weight: 600;
    text-transform: uppercase; font-size: 11.5px; letter-spacing: 0.04em;
    padding: 12px 14px; border-bottom: 1px solid var(--border);
}
table.data-table td { padding: 14px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table.data-table tr:hover td { background: rgba(255,255,255,0.015); }
.link-url { font-family: var(--font-mono); color: var(--text-dim); font-size: 13px; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.short-code { font-family: var(--font-mono); color: var(--accent-2); font-weight: 600; }

.badge {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px; border-radius: 100px;
    font-size: 12px; font-weight: 600;
}
.badge-active { background: var(--accent-2-soft); color: var(--accent-2); }
.badge-disabled { background: var(--danger-soft); color: var(--danger); }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.action-icons { display: flex; gap: 6px; }
.icon-btn {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px; border: 1px solid var(--border);
    color: var(--text-dim); background: transparent; cursor: pointer;
    transition: all .15s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn.danger:hover { border-color: var(--danger); color: var(--danger); }
.icon-btn svg { width: 15px; height: 15px; }

/* ---------- Pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.pagination a, .pagination span {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border-radius: var(--radius-sm); border: 1px solid var(--border);
    color: var(--text-dim); font-size: 13.5px;
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- Redirect / Ad Verification Page ---------- */
.verify-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
}
.verify-card {
    max-width: 560px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 34px;
    text-align: center;
    margin-top: 40px;
}
.verify-dest {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-dim);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    margin: 18px 0 26px;
    word-break: break-all;
}
.timer-ring { position: relative; width: 96px; height: 96px; margin: 0 auto 22px; }
.timer-ring svg { transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 6; }
.timer-ring .bg { stroke: var(--border); }
.timer-ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.timer-num {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: var(--font-mono); font-size: 26px; font-weight: 600;
}
.ad-slot {
    background: var(--bg-soft);
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    min-height: 100px;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-faint); font-size: 12.5px;
    margin: 22px 0;
    overflow: hidden;
}
.step-dots { display: flex; gap: 8px; justify-content: center; margin: 20px 0; }
.step-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--border); }
.step-dots span.done { background: var(--accent-2); }
.step-dots span.active { background: var(--accent); }

/* ---------- Adblock Modal ---------- */
.ab-overlay {
    position: fixed; inset: 0; background: rgba(4,7,14,0.9);
    backdrop-filter: blur(6px);
    display: none; align-items: center; justify-content: center;
    z-index: 999; padding: 20px;
}
.ab-overlay.show { display: flex; }
.ab-modal {
    max-width: 420px; background: var(--surface); border: 1px solid var(--danger);
    border-radius: var(--radius-lg); padding: 32px; text-align: center;
}
.ab-modal .icon { width: 56px; height: 56px; margin: 0 auto 18px; color: var(--danger); }
.ab-modal h3 { font-size: 20px; margin-bottom: 10px; }
.ab-modal p { color: var(--text-dim); font-size: 14px; margin-bottom: 22px; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border-soft); padding: 34px 0; text-align: center; color: var(--text-faint); font-size: 13.5px; }
.footer a { color: var(--text-dim); }

/* ---------- Utilities ---------- */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-0 { margin-top: 0; }
.text-dim { color: var(--text-dim); }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* ---------- Responsive ---------- */
.mobile-menu-btn { display: none; }
@media (max-width: 900px) {
    .mobile-menu-btn { display: inline-flex; }
    .grid-3 { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .sidebar { position: fixed; left: -260px; z-index: 200; transition: left .2s; box-shadow: var(--shadow); }
    .sidebar.open { left: 0; }
    .hero h1 { font-size: 34px; }
    .console-form { flex-direction: column; }
    .nav-links { display: none; }
}
@media (max-width: 560px) {
    .stats-grid { grid-template-columns: 1fr 1fr; }
    .admin-content { padding: 20px 16px 50px; }
    .admin-topbar { padding: 16px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
