/* ============================================================
   SnapLink Pro — Premium Theme
   Palette:  Deep Slate Navy + Indigo/Amber Accents | Type: Fraunces + Inter
   ============================================================ */

:root {
    --ink: #12162a;
    --ink-soft: #1b2140;
    --ink-line: rgba(255, 255, 255, 0.10);
    --paper: #f4f5fb;
    --surface: #ffffff;
    --text: #1a1d2e;
    --muted: #6b7085;
    --border: #e3e5f0;

    /* Primary accent — vivid indigo */
    --brass: #4f46e5;
    --brass-dark: #3730a3;
    --brass-soft: #eef0ff;

    /* Secondary accent — warm amber (icons/highlights) */
    --amber: #f59e0b;
    --amber-dark: #b45309;
    --amber-soft: #fef3e2;

    --success: #16a34a;
    --success-soft: #e7f8ee;
    --danger: #e11d48;
    --danger-soft: #fdecef;

    /* legacy aliases used across templates */
    --brand: var(--brass);
    --brand-dark: var(--brass-dark);
    --brand-soft: var(--brass-soft);
    --bg: var(--paper);

    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 6px 22px rgba(18, 22, 42, 0.07);
    --shadow-lg: 0 20px 44px rgba(18, 22, 42, 0.16);

    --font-display: "Fraunces", Georgia, "Times New Roman", serif;
    --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

html { -webkit-text-size-adjust: 100%; }

body {
    background: var(--paper);
    color: var(--text);
    font-family: var(--font-body);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img, svg, canvas { max-width: 100%; }

h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
}

h4, h5, h6 {
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

a { color: var(--brass-dark); text-decoration: none; }
a:hover { color: var(--brass); }

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

/* ---------- Cards ---------- */
.sl-card, .card.sl-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.btn-brand {
    background: var(--brass);
    border-color: var(--brass);
    color: #ffffff;
    border-radius: var(--radius-sm);
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-brand:hover, .btn-brand:focus {
    background: var(--brass-dark);
    border-color: var(--brass-dark);
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
}

.btn-primary {
    background: var(--brass);
    border-color: var(--brass);
    color: #ffffff;
    font-weight: 700;
}
.btn-primary:hover, .btn-primary:focus {
    background: var(--brass-dark);
    border-color: var(--brass-dark);
    color: #ffffff;
}

.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    min-height: 40px;
}

.form-control, .form-select {
    border-radius: var(--radius-sm);
    border-color: var(--border);
    padding: 0.6rem 0.85rem;
    font-size: 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brass);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15);
}

.badge { font-weight: 600; }

/* ---------- Stat Cards ---------- */
.stat-card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 18px !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.stat-card .stat-label {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.stat-card .stat-number {
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin-top: 4px;
}

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

.icon-bg-0 { background: rgba(79, 70, 229, 0.12); color: var(--brass); }
.icon-bg-1 { background: rgba(245, 158, 11, 0.14); color: var(--amber-dark); }
.icon-bg-2 { background: rgba(16, 185, 129, 0.14); color: #0f9d6a; }
.icon-bg-3 { background: rgba(6, 182, 212, 0.14); color: #0891b2; }
.icon-bg-4 { background: rgba(34, 197, 94, 0.14); color: #16a34a; }
.icon-bg-5 { background: rgba(225, 29, 72, 0.12); color: var(--danger); }

.badge-active { background-color: var(--success-soft) !important; color: #0f7a3d !important; font-weight: 700; padding: 6px 12px; }
.badge-paused { background-color: #eeeef5 !important; color: #6b7085 !important; font-weight: 700; padding: 6px 12px; }

/* ---------- Admin Layout ---------- */
.admin-body { overflow-x: hidden; background: var(--paper); }
.admin-shell { display: flex; min-height: 100vh; }

.admin-sidebar {
    width: 254px; flex-shrink: 0;
    background: var(--ink); color: #b9bdd4;
    display: flex; flex-direction: column;
    position: sticky; top: 0; height: 100vh;
}

.admin-sidebar .brand {
    padding: 24px 22px 18px;
    font-family: var(--font-display);
    font-weight: 600; font-size: 1.25rem;
    color: #ffffff;
    border-bottom: 1px solid var(--ink-line);
}

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

.sidebar-nav a {
    color: #9297b3; display: flex; align-items: center; gap: 12px;
    padding: 11px 14px; text-decoration: none; border-radius: 10px;
    font-weight: 500; transition: background 0.15s, color 0.15s;
}

.sidebar-nav a i { font-size: 1.05rem; }
.sidebar-nav a:hover { background: rgba(255, 255, 255, 0.07); color: #ffffff; }
.sidebar-nav a.active { background: var(--brass); color: #ffffff; font-weight: 700; box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35); }
.sidebar-nav a.text-danger { color: #f0a3ae !important; }
.sidebar-nav a.text-danger:hover { background: rgba(225, 29, 72, 0.15); }

.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
    display: flex; align-items: center; gap: 14px; padding: 14px 22px;
    background: var(--surface); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}

.topbar-title { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--ink); }
.topbar-user { margin-left: auto; color: var(--muted); font-size: 0.9rem; display: flex; align-items: center; }
.sidebar-toggle { display: none; border: 1px solid var(--border); background: var(--surface); border-radius: 10px; padding: 6px 11px; font-size: 1.1rem; }
.admin-content { padding: 24px; max-width: 1400px; width: 100%; margin: 0 auto; flex: 1; }
.sidebar-overlay { display: none; }

/* ---------- Admin footer strip ---------- */
.admin-footer {
    margin-top: 32px;
    padding: 16px 4px 4px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--muted);
    font-size: 0.82rem;
}

.admin-footer .brand-mini {
    font-family: var(--font-display);
    font-weight: 600;
    color: var(--ink);
}

.admin-footer .brand-mini::before {
    content: "";
    display: inline-block;
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--brass);
    margin-right: 7px;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

/* ---------- Tables ---------- */
.table { margin-bottom: 0; }
.table thead th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); white-space: nowrap; background-color: var(--paper); }
.table td { vertical-align: middle; }
.table-responsive { border-radius: 12px; -webkit-overflow-scrolling: touch; }
.slug-cell { font-weight: 600; color: var(--brass-dark); }

.slug-link { font-weight: 600; color: var(--brass-dark); text-decoration: none; }
.slug-link:hover { text-decoration: underline; color: var(--brass); }

.copy-mini {
    border: 1px solid var(--border); background: #ffffff; border-radius: 8px;
    padding: 3px 9px; color: var(--brass-dark); font-size: 0.8rem; font-weight: 600; transition: all 0.15s ease;
}
.copy-mini:hover { background: var(--brass-soft); border-color: #c7c5f7; }
.copy-mini.copied { background: var(--success-soft); border-color: #a7e2c4; color: var(--success); }

/* Sticky first column on small tables for easier mobile scanning */
@media (max-width: 768px) {
    .table td:first-child, .table th:first-child {
        position: sticky;
        left: 0;
        background-color: var(--surface);
        box-shadow: 2px 0 6px rgba(0,0,0,0.04);
    }
    .table thead th:first-child { background-color: var(--paper); }
}

/* ---------- Statistics page ---------- */
.tz-note {
    color: var(--muted);
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--brass-soft);
    padding: 6px 12px;
    border-radius: 999px;
}

.chart-box { position: relative; height: 300px; width: 100%; }
.chart-box-sm { position: relative; height: 260px; width: 100%; }

@media (max-width: 576px) {
    .chart-box { height: 220px; }
    .chart-box-sm { height: 220px; }
}

/* ---------- Public Landing Page ---------- */
.public-page {
    background: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.public-page .navbar {
    background: transparent;
    padding: 20px 0;
    border-bottom: 1px solid var(--ink-line);
}
.public-page .navbar-brand {
    color: #ffffff !important;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.3rem;
}
.public-page .navbar .btn-outline-light {
    border-color: var(--ink-line);
    font-weight: 600;
}
.public-page .navbar .btn-outline-light:hover {
    background: var(--brass);
    border-color: var(--brass);
    color: #ffffff;
}

.public-hero { padding: 56px 0 64px; flex: 1; }
.public-hero .rule {
    width: 46px; height: 3px; background: var(--amber); border-radius: 2px; margin-bottom: 22px;
}
.public-hero h1 {
    color: #ffffff;
    font-size: clamp(1.8rem, 4.8vw, 3rem);
    line-height: 1.15;
    margin-bottom: 16px;
}
.public-hero p.lead-text {
    color: #a7acc4;
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 46ch;
}

.shorten-console {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: var(--shadow-lg);
    padding: 28px;
}

.short-url-box { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.short-url-box input { flex: 1 1 200px; font-weight: 600; color: var(--brass-dark); background: var(--brass-soft); border: 1px dashed #c7c5f7; }

/* ---------- Site footer (public pages) ---------- */
.site-footer {
    background: var(--ink-soft);
    border-top: 1px solid var(--ink-line);
    padding: 28px 0;
    margin-top: auto;
}

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

.site-footer .footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 600;
    color: #ffffff;
    font-size: 1rem;
}

.site-footer .footer-brand .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--amber);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.18);
    flex-shrink: 0;
}

.site-footer .footer-tagline {
    color: #8188a3;
    font-size: 0.85rem;
    margin-top: 2px;
}

.site-footer .footer-meta {
    color: #8188a3;
    font-size: 0.85rem;
    text-align: right;
}

.site-footer .footer-meta a { color: #c2c6db; }
.site-footer .footer-meta a:hover { color: var(--amber); }

@media (max-width: 575.98px) {
    .site-footer .footer-inner { flex-direction: column; text-align: center; }
    .site-footer .footer-meta { text-align: center; }
}

/* ---------- Interstitial / message pages ---------- */
.interstitial-page {
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: 24px;
    padding-bottom: 24px;
    background: var(--ink);
    background-image: radial-gradient(900px 420px at 50% -8%, rgba(79, 70, 229, 0.22) 0%, transparent 60%);
}
.interstitial-page .card { border: 1px solid var(--border); }
.geo-msg-body { color: var(--text); line-height: 1.65; }
.geo-msg-body p:last-child { margin-bottom: 0; }
.geo-msg-body a { color: var(--brass-dark); }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .admin-sidebar {
        position: fixed; left: 0; top: 0; z-index: 100;
        transform: translateX(-105%); transition: transform 0.25s ease;
        box-shadow: var(--shadow-lg);
    }
    .admin-sidebar.open { transform: translateX(0); }
    .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .sidebar-overlay.show { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, 0.5); z-index: 99; }
    .admin-content { padding: 16px; }
    .public-hero { padding: 36px 0 44px; }
}

@media (max-width: 767.98px) {
    .admin-topbar { padding: 12px 16px; }
    .topbar-title { font-size: 1rem; }
    h3 { font-size: 1.3rem; }
}

@media (max-width: 575.98px) {
    .stat-card { padding: 14px !important; }
    .stat-card .stat-number { font-size: 1.3rem; }
    .stat-card .stat-label { font-size: 0.66rem; }
    .stat-icon-wrapper { width: 36px; height: 36px; font-size: 1rem; border-radius: 10px; }
    .topbar-user span.name { display: none; }
    .short-url-box .btn { width: 100%; }
    .shorten-console { padding: 20px; }
    .public-page .navbar .container { padding-left: 16px; padding-right: 16px; }
    .btn-brand.btn-lg, .btn-primary.btn-lg { padding: 0.75rem 1rem; }
    .admin-content { padding: 14px 12px 28px; }
    .card.p-md-4 { padding: 1rem !important; }
    .admin-footer { flex-direction: column; text-align: center; gap: 4px; margin-top: 24px; }
}

@media (max-width: 400px) {
    .public-hero h1 { font-size: 1.6rem; }
    .stat-card .stat-number { font-size: 1.15rem; }
}
