/* ── Theme Variables ─────────────────────────────────────── */
:root,
[data-theme="light"] {
    --brand: #2563eb;
    --brand-light: #3b82f6;
    --brand-bg: #eff6ff;
    --hero-bg: #1e293b;
    --hero-text: #f8fafc;
    --hero-sub: #94a3b8;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --surface-border: #e2e8f0;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --footer-bg: #0f172a;
    --footer-text: #cbd5e1;
    --footer-heading: #f1f5f9;
    --code-bg: #f1f5f9;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --nav-bg: rgba(255,255,255,0.92);
    --nav-border: #e2e8f0;
    --input-bg: #ffffff;
    --input-border: #cbd5e1;
    --card-bg: #ffffff;
    --badge-bg: #f1f5f9;
    --badge-text: #475569;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --warning: #d97706;
    --warning-bg: #fffbeb;
}

[data-theme="dark"] {
    --brand: #3b82f6;
    --brand-light: #60a5fa;
    --brand-bg: #1e293b;
    --hero-bg: #0f172a;
    --hero-text: #f1f5f9;
    --hero-sub: #64748b;
    --surface: #1e293b;
    --surface-alt: #0f172a;
    --surface-border: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --footer-bg: #020617;
    --footer-text: #94a3b8;
    --footer-heading: #e2e8f0;
    --code-bg: #0f172a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
    --nav-bg: rgba(15,23,42,0.95);
    --nav-border: #334155;
    --input-bg: #0f172a;
    --input-border: #475569;
    --card-bg: #1e293b;
    --badge-bg: #334155;
    --badge-text: #cbd5e1;
    --success: #22c55e;
    --success-bg: #052e16;
    --danger: #ef4444;
    --danger-bg: #450a0a;
    --warning: #f59e0b;
    --warning-bg: #451a03;
}

/* ── Reset / Base ────────────────────────────────────────── */
body {
    background: var(--surface-alt);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.2s, color 0.2s;
    min-height: 100vh;
}

a { color: var(--brand); }
a:hover { color: var(--brand-light); }

/* ── Navbar ──────────────────────────────────────────────── */
.navbar {
    background: var(--nav-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--nav-border);
    box-shadow: var(--shadow-sm);
}

.navbar-item,
.navbar-burger { color: var(--text-primary) !important; }
.navbar-item:hover { color: var(--brand) !important; background: transparent !important; }
.navbar-item.is-active { color: var(--brand) !important; background: transparent !important; font-weight: 600; }
.navbar-burger span { background-color: var(--text-primary); }

.navbar-item.is-brand:hover { background: transparent; }
.navbar-item.is-brand img { max-height: 2rem; }
.brand-text {
    font-size: 1.1rem;
    font-weight: 700;
    margin-left: 0.4rem;
    letter-spacing: -0.02em;
}

@media screen and (max-width: 1023px) {
    .navbar-menu {
        background: var(--surface);
        border-top: 1px solid var(--surface-border);
        box-shadow: var(--shadow-md);
    }
    .navbar-menu .navbar-item { color: var(--text-primary); }
}

/* ── Theme Toggle ────────────────────────────────────────── */
.theme-toggle {
    background: none;
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    cursor: pointer;
    padding: 0.4rem 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.2s;
    font-size: 1.1rem;
    line-height: 1;
}
.theme-toggle:hover {
    background: var(--badge-bg);
    color: var(--brand);
    border-color: var(--brand);
}

/* ── Hero ────────────────────────────────────────────────── */
.hero-section {
    background: var(--hero-bg);
    color: var(--hero-text);
    padding: 3rem 1.5rem;
}
.hero-section .subtitle,
.hero-section .hero-sub { color: var(--hero-sub); }

.ip-display {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: var(--brand-light);
    letter-spacing: -0.02em;
}
.ip-location {
    color: var(--hero-sub);
    font-size: 1.1rem;
    margin-top: 0.25rem;
}

/* ── Promo Card (in hero) ────────────────────────────────── */
.promo-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow-lg);
    color: var(--text-primary);
}
.promo-card a { color: inherit; text-decoration: none; display: block; }
.promo-card img.promo-icon {
    float: left;
    margin-right: 1rem;
    border-radius: 12px;
}
.promo-card .promo-text { font-size: 0.95rem; line-height: 1.6; }
.promo-card .promo-stars { color: #f59e0b; margin-top: 0.25rem; font-size: 0.85rem; }
.promo-badges { margin-top: 0.75rem; display: flex; gap: 0.5rem; align-items: center; }
.promo-badges img { height: 36px; }

/* ── IP Lookup Form ──────────────────────────────────────── */
.ip-form .input {
    background: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
    border-radius: 8px 0 0 8px;
}
.ip-form .input::placeholder { color: var(--text-muted); }
.ip-form .input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.ip-form .button {
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 0 8px 8px 0;
    font-weight: 600;
}
.ip-form .button:hover { background: var(--brand-light); }

/* ── Navbar spacing ───────────────────────────────────────── */
.navbar.is-fixed-top + .hero-section { padding-top: calc(3rem + 3.25rem); }
.navbar.is-fixed-top + .section { padding-top: calc(1.5rem + 3.25rem); }
body { padding-top: 0; }

/* ── Section ─────────────────────────────────────────────── */
.section { background: var(--surface-alt); }
.section.is-surface { background: var(--surface); }

/* ── Cards & Boxes ───────────────────────────────────────── */
.box, .card {
    background: var(--card-bg);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
}
.box:hover { box-shadow: var(--shadow-md); }

/* ── Notifications ───────────────────────────────────────── */
.notification.is-vpn-detected {
    background: var(--warning-bg);
    border-left: 4px solid var(--warning);
    color: var(--text-primary);
    border-radius: 8px;
}
.notification.is-vpn-clean {
    background: var(--success-bg);
    border-left: 4px solid var(--success);
    color: var(--text-primary);
    border-radius: 8px;
}

/* ── DCIP Result Cards ───────────────────────────────────── */
.result-card {
    border-left: 4px solid;
    padding: 1.5rem;
    margin-top: 1.5rem;
    border-radius: 8px;
    text-align: left;
}
.result-card.is-datacenter {
    border-color: var(--danger);
    background: var(--danger-bg);
}
.result-card.is-residential {
    border-color: var(--success);
    background: var(--success-bg);
}
.result-card.is-error {
    border-color: var(--warning);
    background: var(--warning-bg);
}
.provider-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    background: var(--badge-bg);
    color: var(--badge-text);
    font-weight: 600;
}

/* ── API Code Boxes ──────────────────────────────────────── */
.api-box {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    overflow-x: auto;
    border: 1px solid #1e293b;
}
.api-box .key { color: #7dd3fc; }
.api-box .val-str { color: #86efac; }
.api-box .val-true { color: #fca5a5; }
.api-box .val-false { color: #86efac; }
.api-box .val-null { color: #64748b; }

/* ── Content Typography ──────────────────────────────────── */
.content h1, .content h2, .content h3 {
    color: var(--text-primary);
}
.content p, .content li {
    color: var(--text-secondary);
}
.content strong { color: var(--text-primary); }
.content a { color: var(--brand); }

.title { color: var(--text-primary); }
.subtitle { color: var(--text-secondary); }

/* ── Tables ──────────────────────────────────────────────── */
.table {
    background: var(--card-bg);
    color: var(--text-primary);
}
.table th { color: var(--text-primary); background: var(--badge-bg); border-color: var(--surface-border); }
.table td { border-color: var(--surface-border); }
.table.is-striped tbody tr:nth-child(even) { background: var(--surface-alt); }

/* ── Tags ────────────────────────────────────────────────── */
.tag {
    background: var(--badge-bg);
    color: var(--badge-text);
    border-radius: 6px;
}

/* ── Pagination ──────────────────────────────────────────── */
.pagination-previous,
.pagination-next,
.pagination-link {
    background: var(--card-bg);
    color: var(--text-primary);
    border-color: var(--surface-border);
}

/* ── Map ─────────────────────────────────────────────────── */
#map {
    width: 100%;
    height: 400px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--surface-border);
}

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 1.5rem 2rem;
}
.site-footer h3 {
    color: var(--footer-heading);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.site-footer a { color: var(--footer-text); transition: color 0.15s; }
.site-footer a:hover { color: #fff; }
.site-footer .copyright {
    border-top: 1px solid #1e293b;
    padding-top: 1.5rem;
    margin-top: 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.site-footer .lang-switcher { text-align: center; margin-top: 1rem; }
.site-footer .lang-switcher a {
    display: inline-block;
    margin: 0 0.35rem;
    font-size: 1.4rem;
    opacity: 0.6;
    transition: opacity 0.15s;
}
.site-footer .lang-switcher a:hover,
.site-footer .lang-switcher a.selected { opacity: 1; }

/* ── Form Overrides (Bulma compat) ───────────────────────── */
.input, .textarea, .select select {
    background-color: var(--input-bg);
    border-color: var(--input-border);
    color: var(--text-primary);
}
.input:focus, .textarea:focus, .select select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.input::placeholder { color: var(--text-muted); }

.button.is-primary {
    background-color: var(--brand);
    color: #fff;
    border: none;
}
.button.is-primary:hover { background-color: var(--brand-light); }

.button.is-info {
    background-color: var(--brand);
    color: #fff;
    border: none;
}
.button.is-info:hover { background-color: var(--brand-light); }

/* ── Utility ─────────────────────────────────────────────── */
.has-text-grey { color: var(--text-secondary) !important; }
.has-text-grey-light { color: var(--text-muted) !important; }

/* ── Blog cards ──────────────────────────────────────────── */
.blog-card {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.15s;
}
.blog-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
    color: inherit;
}
.blog-card figure img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

/* ── VPN comparison table header ─────────────────────────── */
.table thead th { white-space: nowrap; }

/* ── Print ───────────────────────────────────────────────── */
@media print {
    .navbar, .site-footer, .promo-card, .theme-toggle { display: none; }
}
