/* LinkBoom — light, Netlify-inspired UI. No build step required. */
:root {
    --bg: #f6f8f9;
    --surface: #ffffff;
    --surface-2: #f1f4f5;
    --border: #e1e6e8;
    --border-strong: #cbd3d6;
    --text: #0b2a2b;
    --text-2: #4a5f61;
    --muted: #7c8c8e;
    --brand: #00ad9f;
    --brand-600: #009488;
    --brand-700: #01776d;
    --brand-50: #e6f7f5;
    --ink: #014847;
    --danger: #d23f3f;
    --danger-50: #fdeeee;
    --ok: #0e8a5f;
    --ok-50: #e7f6ef;
    --warn: #b7791f;
    --radius: 10px;
    --radius-lg: 14px;
    --shadow-sm: 0 1px 2px rgba(11, 42, 43, .06);
    --shadow: 0 1px 3px rgba(11, 42, 43, .06), 0 8px 24px -12px rgba(11, 42, 43, .14);
    --font: "Inter", "Hind Siliguri", system-ui, -apple-system, "Segoe UI", sans-serif;
    --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-700); text-decoration: none; }
a:hover { color: var(--ink); }
img, svg { max-width: 100%; }
h1, h2, h3 { margin: 0; line-height: 1.25; letter-spacing: -.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.container-sm { max-width: 440px; }

/* ---------- Top nav ---------- */
.nav {
    position: sticky; top: 0; z-index: 20;
    background: rgba(255, 255, 255, .88);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 62px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 18px; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 30px; height: 30px; border-radius: 8px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--brand), #32e6e2);
    color: #fff; box-shadow: 0 4px 12px -4px rgba(0, 173, 159, .6);
}
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link {
    padding: 7px 12px; border-radius: 8px; color: var(--text-2); font-size: 14px; font-weight: 500;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active { color: var(--ink); background: var(--brand-50); }
.nav-user { display: flex; align-items: center; gap: 10px; margin-left: 8px; padding-left: 12px; border-left: 1px solid var(--border); }
.avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: grid; place-items: center; flex: none;
    background: var(--ink); color: #fff; font-weight: 600; font-size: 13px; text-transform: uppercase;
}
@media (max-width: 720px) {
    .nav-user .nav-user-name, .hide-sm { display: none; }
    .nav-link { padding: 7px 8px; }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 38px; padding: 0 16px; border-radius: 8px;
    border: 1px solid transparent; font-size: 14px; font-weight: 600;
    cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, color .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-600); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #013332; color: #fff; }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover { border-color: var(--text-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-50); }
.btn-sm { height: 32px; padding: 0 11px; font-size: 13px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 16px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn { width: 32px; padding: 0; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 24px; }
.card-head { padding: 18px 22px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-title { font-size: 16px; font-weight: 600; }
.card-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- Page header ---------- */
.page { padding-block: 32px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-title { font-size: 26px; font-weight: 700; }
.page-sub { color: var(--text-2); margin-top: 4px; }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--brand-700); }

/* ---------- Forms ---------- */
.field { margin-bottom: 18px; }
.label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.label .opt { font-weight: 400; color: var(--muted); }
.input, .select, .textarea {
    width: 100%; height: 42px; padding: 0 12px;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px;
    outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 120px; padding: 10px 12px; font-family: var(--mono); font-size: 12.5px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 173, 159, .18); }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.input-group:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0, 173, 159, .18); }
.input-group .input { border: 0; box-shadow: none; border-radius: 0; min-width: 0; flex: 1; }
.input-group.is-ok { border-color: var(--ok); }
.input-group.is-bad { border-color: var(--danger); }
.addon { display: flex; align-items: center; padding: 0 12px; background: var(--surface-2); color: var(--muted); font-size: 13.5px; border-left: 1px solid var(--border); white-space: nowrap; }
.hint { font-size: 12.5px; margin-top: 6px; color: var(--muted); min-height: 19px; display: flex; align-items: center; gap: 6px; }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--danger); }
.hint .spinner { width: 12px; height: 12px; border: 2px solid var(--border-strong); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.check input { accent-color: var(--brand); width: 16px; height: 16px; }

/* Drop zone */
.dropzone {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    padding: 26px 16px; text-align: center;
    border: 1.5px dashed var(--border-strong); border-radius: var(--radius); background: var(--surface-2);
    color: var(--text-2); cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-50); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dropzone .dz-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-sm); }
.dropzone strong { color: var(--text); font-size: 14px; }
.dropzone small { color: var(--muted); font-size: 12.5px; }
.dropzone.has-file { border-style: solid; border-color: var(--brand); background: var(--brand-50); }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 14px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }

details.paste summary { cursor: pointer; font-size: 13px; color: var(--brand-700); font-weight: 600; list-style: none; }
details.paste summary::-webkit-details-marker { display: none; }
details.paste[open] summary { margin-bottom: 8px; }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); font-size: 14px; margin-bottom: 20px; border: 1px solid; }
.alert-ok { background: var(--ok-50); border-color: #bfe6d3; color: #0b5e41; }
.alert-bad { background: var(--danger-50); border-color: #f4c7c7; color: #9b2c2c; }
.alert ul { margin: 0; padding-left: 18px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border); }
.badge-brand { background: var(--brand-50); color: var(--brand-700); border-color: #b9e8e2; }
.badge-ink { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Dashboard layout ---------- */
.grid-dash { display: grid; grid-template-columns: 380px 1fr; gap: 24px; align-items: start; }
@media (max-width: 960px) { .grid-dash { grid-template-columns: 1fr; } }
.sticky { position: sticky; top: 86px; }
@media (max-width: 960px) { .sticky { position: static; } }

/* Link list */
.link-list { list-style: none; margin: 0; padding: 0; }
.link-row { display: flex; align-items: center; gap: 16px; padding: 16px 22px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.link-row:last-child { border-bottom: 0; }
.link-row:hover { background: #fbfcfc; }
.site-thumb {
    width: 44px; height: 44px; border-radius: 10px; flex: none;
    display: grid; place-items: center; font-weight: 700; font-size: 17px; text-transform: uppercase;
    color: var(--ink); background: linear-gradient(135deg, #d9f5f1, #eef3ff); border: 1px solid var(--border);
}
.link-main { flex: 1; min-width: 200px; }
.link-host { font-weight: 600; color: var(--text); font-size: 15px; word-break: break-all; }
.link-host:hover { color: var(--brand-700); text-decoration: underline; }
.link-meta { color: var(--muted); font-size: 13px; margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.link-meta .sep { color: var(--border-strong); }
.visits { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.visits-num { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 1ch; color: var(--ink); line-height: 1.1; }
.visits-label { font-size: 11.5px; color: var(--muted); line-height: 1.2; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); position: relative; flex: none; }
.pulse::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--brand); animation: pulse 2s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .7; } 100% { transform: scale(3); opacity: 0; } }
.visits.bump .visits-num { animation: bump .5s ease; }
@keyframes bump { 40% { transform: scale(1.25); color: var(--brand); } }
.link-actions { display: flex; align-items: center; gap: 4px; }

/* Inline update panel */
.update-panel { flex-basis: 100%; margin-top: 4px; padding: 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); }

/* Empty state */
.empty { padding: 56px 24px; text-align: center; color: var(--text-2); }
.empty-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); }
.empty h3 { font-size: 17px; margin-bottom: 4px; color: var(--text); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
@media (max-width: 720px) { .stats { grid-template-columns: 1fr; } }
.stat { padding: 18px 20px; }
.stat-label { color: var(--muted); font-size: 13px; font-weight: 500; }
.stat-value { font-size: 30px; font-weight: 700; color: var(--ink); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 11px 22px; background: #fafbfb; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 13px 22px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fbfcfc; }
.table .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell .avatar { width: 30px; height: 30px; font-size: 12px; background: var(--brand-50); color: var(--brand-700); }
.muted { color: var(--muted); }
.text-sm { font-size: 13px; }

.search { position: relative; }
.search .input { height: 36px; padding-left: 34px; width: 240px; max-width: 100%; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 14px; font-size: 14px; font-weight: 500; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--ink); border-bottom-color: var(--brand); }

.pagination { display: flex; gap: 6px; padding: 16px 22px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 5px 11px; border-radius: 7px; border: 1px solid var(--border); font-size: 13px; color: var(--text-2); background: var(--surface); }
.pagination .current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 62px); display: grid; place-items: center; padding-block: 40px; }
.auth-card { width: 100%; }
.auth-head { text-align: center; margin-bottom: 24px; }
.auth-head h1 { font-size: 24px; font-weight: 700; }
.auth-head p { color: var(--text-2); margin-top: 6px; }
.auth-foot { text-align: center; margin-top: 18px; font-size: 14px; color: var(--text-2); }

/* ---------- Landing ---------- */
.hero { position: relative; overflow: hidden; padding-block: 88px 72px; text-align: center; }
.hero::before {
    content: ""; position: absolute; inset: -40% -10% auto; height: 620px; z-index: -1;
    background: radial-gradient(closest-side, rgba(50, 230, 226, .22), transparent 70%),
                radial-gradient(closest-side at 70% 40%, rgba(0, 173, 159, .14), transparent 70%);
}
.hero h1 { font-size: clamp(34px, 5.5vw, 60px); font-weight: 800; letter-spacing: -.03em; color: var(--ink); max-width: 820px; margin: 16px auto 0; line-height: 1.08; }
.hero h1 .grad { background: linear-gradient(90deg, var(--brand), #1ec8c1); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 18px; color: var(--text-2); max-width: 620px; margin: 18px auto 0; }
.hero-cta { display: flex; justify-content: center; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.url-demo {
    margin: 48px auto 0; max-width: 560px; display: flex; align-items: center; gap: 10px;
    padding: 12px 14px 12px 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow);
    font-family: var(--mono); font-size: 15px; text-align: left;
}
.url-demo .lock { color: var(--ok); flex: none; }
.url-demo .typed { color: var(--brand-700); font-weight: 700; }
.url-demo .rest { color: var(--text-2); }
.url-demo .caret { display: inline-block; width: 2px; height: 18px; background: var(--brand); vertical-align: -3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.url-demo .badge { margin-left: auto; font-family: var(--font); }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding-block: 24px 80px; }
@media (max-width: 860px) { .features { grid-template-columns: 1fr; } }
.feature { padding: 24px; }
.feature-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); margin-bottom: 14px; }
.feature h3 { font-size: 17px; margin-bottom: 6px; }
.feature p { color: var(--text-2); font-size: 14.5px; }

.steps { padding-block: 0 96px; }
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-top: 28px; counter-reset: step; }
@media (max-width: 860px) { .steps-grid { grid-template-columns: 1fr; } }
.step { padding: 22px 24px; position: relative; }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: 13px; margin-bottom: 12px; }
.step h3 { font-size: 16px; margin-bottom: 4px; }
.step p { color: var(--text-2); font-size: 14px; }
.section-title { text-align: center; font-size: 28px; font-weight: 700; color: var(--ink); }

.footer { border-top: 1px solid var(--border); padding-block: 24px; color: var(--muted); font-size: 13px; background: var(--surface); }
.footer .container { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Groups ---------- */
.group-thumb { background: linear-gradient(135deg, var(--ink), #0b6f68); color: #fff; }
/* Keep the group's buttons on the top line next to the visit count; the
   "created …" line sits underneath the whole row. */
.group-row .link-main { min-width: 110px; }
.group-row .visits { padding: 6px 10px; }
.group-row .link-actions { gap: 6px; }
.link-row .row-footer { flex-basis: 100%; margin-left: 60px; color: var(--muted); font-size: 12.5px; }
@media (max-width: 560px) { .link-row .row-footer { margin-left: 0; } }
.sample-names { padding: 14px 16px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border); margin-bottom: 18px; }
.sample-names code { display: block; font-family: var(--mono); font-size: 12.5px; color: var(--brand-700); padding: 1px 0; word-break: break-all; }
.sample-names .hint { margin-top: 6px; }
.tab[data-form-tab] { background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer; font-family: inherit; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(11, 42, 43, .45); backdrop-filter: blur(2px); }
.modal-box { position: relative; width: 100%; max-width: 640px; max-height: 85vh; display: flex; flex-direction: column;
             background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: 0 24px 60px -20px rgba(11, 42, 43, .45); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--border); }
.modal-list { flex: 1; min-height: 240px; margin: 0; padding: 14px 18px; border: 0; resize: none; outline: none;
              font-family: var(--mono); font-size: 12.5px; line-height: 1.7; color: var(--text-2); background: var(--surface); white-space: pre; overflow: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 18px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius-lg) var(--radius-lg); flex-wrap: wrap; }

/* Toast */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: all .2s; z-index: 50; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

[hidden] { display: none !important; }
