/* ============================================================
   style.css — DNS & Network Tools
   Design System: Dark/Light theme with CSS custom properties
   ============================================================ */

/* ──────── Google Fonts are loaded in layout.php ──────── */

/* ── 1. DESIGN TOKENS ──────────────────────────────────── */
:root {
    /* Brand */
    --brand-primary:   #6366f1;
    --brand-secondary: #8b5cf6;
    --brand-accent:    #06b6d4;
    --brand-gradient:  linear-gradient(135deg, #6366f1, #8b5cf6);

    /* Status */
    --color-pass:      #10b981;
    --color-warn:      #f59e0b;
    --color-fail:      #ef4444;
    --color-info:      #3b82f6;

    --color-pass-bg:   rgba(16, 185, 129, 0.1);
    --color-warn-bg:   rgba(245, 158, 11, 0.1);
    --color-fail-bg:   rgba(239, 68, 68, 0.1);
    --color-info-bg:   rgba(59, 130, 246, 0.1);

    /* Spacing */
    --space-xs:  4px;
    --space-sm:  8px;
    --space-md:  16px;
    --space-lg:  24px;
    --space-xl:  40px;
    --space-2xl: 64px;

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Typography */
    --font-sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:  'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

    /* Transitions */
    --transition-fast:   0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow:   0.4s ease;

    /* Shadows */
    --shadow-sm:  0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
    --shadow-md:  0 4px 12px rgba(0,0,0,0.15);
    --shadow-lg:  0 8px 32px rgba(0,0,0,0.2);
    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);
}

/* ── 2. DARK THEME (default) ────────────────────────────── */
[data-theme="dark"] {
    --bg-base:      #0f172a;
    --bg-surface:   #1e293b;
    --bg-elevated:  #334155;
    --bg-hover:     #475569;
    --bg-input:     #1e293b;

    --border-color: rgba(255,255,255,0.1);
    --border-focus: rgba(99,102,241,0.6);

    --text-primary:  #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted:    #64748b;
    --text-code:     #a5b4fc;

    --header-bg:     rgba(15, 23, 42, 0.85);
    --footer-bg:     #020617;

    --card-shadow:   0 4px 24px rgba(0,0,0,0.4);
    --card-shadow-hover: 0 8px 40px rgba(0,0,0,0.5);

    --scrollbar-track: #0f172a;
    --scrollbar-thumb: #334155;
}

/* ── 3. LIGHT THEME ─────────────────────────────────────── */
[data-theme="light"] {
    --bg-base:      #f5f5fa;
    --bg-surface:   #ffffff;
    --bg-elevated:  #f0f0f8;
    --bg-hover:     #e8e8f4;
    --bg-input:     #ffffff;

    --border-color: rgba(0,0,0,0.08);
    --border-focus: rgba(99,102,241,0.5);

    --text-primary:  #1a1a2e;
    --text-secondary: #555570;
    --text-muted:    #9898b0;
    --text-code:     #5b21b6;

    --header-bg:     rgba(245, 245, 250, 0.9);
    --footer-bg:     #1a1a2e;

    --card-shadow:   0 2px 16px rgba(0,0,0,0.08);
    --card-shadow-hover: 0 6px 30px rgba(0,0,0,0.14);

    --scrollbar-track: #f0f0f8;
    --scrollbar-thumb: #c0c0d8;
}

/* ── 4. RESET & BASE ────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-base);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition-slow), color var(--transition-slow);
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--scrollbar-track); }
::-webkit-scrollbar-thumb { background: var(--scrollbar-thumb); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--brand-primary); }

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-md);
    background: var(--brand-primary);
    color: white;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    z-index: 9999;
    transition: top var(--transition-fast);
}
.skip-link:focus { top: var(--space-md); }

/* ── 5. HEADER ──────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: background var(--transition-normal);
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px var(--space-lg) 8px;
    min-height: 74px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px var(--space-lg);
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    text-decoration: none;
    flex-shrink: 0;
    order: 1;
}

.logo-icon {
    display: flex;
    align-items: center;
    transition: transform var(--transition-normal);
}

.logo:hover .logo-icon { transform: rotate(-5deg) scale(1.05); }

.logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    white-space: nowrap;
}

/* Main Nav */
.main-nav {
    flex: 1 1 100%;
    order: 3;
    display: flex;
    justify-content: flex-start;
}

.nav-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    overflow-x: auto;
    padding-bottom: 6px;
}
.nav-list::-webkit-scrollbar { height: 0px; display: none; }

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px var(--space-md);
    border-radius: var(--radius-full);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--brand-primary);
}

.nav-icon { font-size: 0.95rem; }

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-left: auto;
    order: 2;
}

/* Theme Toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover { background: var(--bg-hover); border-color: var(--brand-primary); }

.theme-icon { position: absolute; transition: all var(--transition-fast); }
.theme-icon-dark  { opacity: 1; transform: translateY(0); }
.theme-icon-light { opacity: 0; transform: translateY(20px); }

[data-theme="light"] .theme-icon-dark  { opacity: 0; transform: translateY(-20px); }
[data-theme="light"] .theme-icon-light { opacity: 1; transform: translateY(0); }

/* Admin button */
.btn-admin {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-elevated);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    white-space: nowrap;
}

.btn-admin:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
    background: rgba(99,102,241,0.08);
}

/* Mobile menu button */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-btn span {
    display: block;
    height: 2px;
    background: var(--text-secondary);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

.mobile-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile Nav */
.mobile-nav {
    display: none;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface);
    overflow: hidden;
    max-height: 0;
    transition: max-height var(--transition-normal);
}

.mobile-nav.open { max-height: 400px; }

.mobile-nav-list { list-style: none; padding: var(--space-sm) 0; }

.mobile-nav-link {
    display: block;
    padding: var(--space-sm) var(--space-lg);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all var(--transition-fast);
}

.mobile-nav-link:hover, .mobile-nav-link.active {
    background: var(--bg-hover);
    color: var(--brand-primary);
}

/* ── 6. MAIN / LAYOUT ───────────────────────────────────── */
main {
    flex: 1;
    width: 100%;
}

.page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-lg);
}

/* ── 7. PAGE HERO ───────────────────────────────────────── */
.page-hero {
    text-align: center;
    margin-bottom: var(--space-lg);
    padding: var(--space-lg) 0 var(--space-sm);
}

.page-hero-icon {
    font-size: 2.2rem;
    display: block;
    margin-bottom: var(--space-sm);
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.page-hero h1 {
    font-size: clamp(1.8rem, 5vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--brand-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-sm);
}

.page-hero p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* ── 8. CARDS ───────────────────────────────────────────── */
.card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
    overflow: hidden;
}

.card:hover { box-shadow: var(--card-shadow-hover); }

.card-header {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.card-body {
    padding: var(--space-lg);
}

/* ── 9. SEARCH / INPUT AREA ─────────────────────────────── */
.search-card {
    margin-bottom: var(--space-xl);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--shadow-glow), var(--card-shadow);
}

.search-card h2 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: var(--space-md);
}

.input-row {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.input-group {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 14px var(--space-md);
    font-size: 1rem;
    font-family: var(--font-sans);
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    outline: none;
    -webkit-appearance: none;
}

.form-input:focus {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}

.form-input::placeholder { color: var(--text-muted); }

/* Small helper text */
.input-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* ── 10. BUTTONS ────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 24px;
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all var(--transition-fast);
    position: relative;
    overflow: hidden;
    letter-spacing: 0.01em;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0);
    transition: background var(--transition-fast);
}

.btn:hover::after { background: rgba(255,255,255,0.06); }
.btn:active { transform: scale(0.98); }

.btn-primary {
    background: var(--brand-gradient);
    color: white;
    box-shadow: 0 4px 14px rgba(99,102,241,0.35);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99,102,241,0.5);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover { background: var(--bg-hover); border-color: var(--brand-primary); }

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: transparent;
    color: var(--brand-primary);
    border-color: var(--brand-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ── 11. RESULTS TABLE ──────────────────────────────────── */
.results-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.result-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    animation: slideUp 0.35s ease forwards;
    opacity: 0;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-card-header {
    padding: 14px var(--space-lg);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.result-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.result-table-wrap {
    overflow-x: auto;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.result-table th {
    padding: 10px var(--space-lg);
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: transparent;
    border-bottom: 1px solid var(--border-color);
}

.result-table td {
    padding: 14px var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
    color: var(--text-secondary);
    line-height: 1.6;
}

.result-table td.td-test {
    font-weight: 600;
    color: var(--text-primary);
    width: 30%;
}

.result-table td.td-info {
    width: 55%;
    word-break: break-word;
}

.result-table tr:last-child td { border-bottom: none; }
.result-table tr:hover td { background: var(--bg-elevated); }

/* Record value display */
.record-value {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-code);
    background: var(--bg-elevated);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    word-break: break-word;
    display: inline-block;
}

.record-list {
    list-style: none;
    padding: 0;
    margin: var(--space-sm) 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.record-list li {
    display: block;
    line-height: 1.6;
    padding: 8px var(--space-md);
    background: var(--bg-elevated);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

/* ── 12. STATUS BADGES ──────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    white-space: nowrap;
}

.badge-pass { background: var(--color-pass-bg); color: var(--color-pass); }
.badge-warn { background: var(--color-warn-bg); color: var(--color-warn); }
.badge-fail { background: var(--color-fail-bg); color: var(--color-fail); }
.badge-info { background: var(--color-info-bg); color: var(--color-info); }
.badge-open   { background: var(--color-pass-bg); color: var(--color-pass); }
.badge-closed { background: var(--color-fail-bg); color: var(--color-fail); }
.badge-timeout { background: var(--color-warn-bg); color: var(--color-warn); }
.badge-listed     { background: var(--color-fail-bg); color: var(--color-fail); }
.badge-notlisted  { background: var(--color-pass-bg); color: var(--color-pass); }

/* Dot indicator */
.badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
}

/* ── 13. LOADING SKELETON ───────────────────────────────── */
.skeleton-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: slideUp 0.25s ease forwards;
}

.skeleton-header {
    padding: 14px var(--space-lg);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.skeleton-bar {
    height: 14px;
    border-radius: var(--radius-full);
    background: linear-gradient(90deg,
        var(--bg-elevated) 25%,
        var(--bg-hover)    50%,
        var(--bg-elevated) 75%
    );
    background-size: 400% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.skeleton-body {
    padding: var(--space-md) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.skeleton-row {
    display: flex;
    gap: var(--space-md);
}

/* Spinner */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-top-color: var(--brand-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── 14. COPY BUTTON & TOAST ────────────────────────────── */
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 3px 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.copy-btn:hover { 
    border-color: var(--brand-primary); 
    color: var(--brand-primary); 
    background: rgba(99,102,241,0.06);
}

.copy-btn.copied { color: var(--color-pass); border-color: var(--color-pass); }

/* Toast notification */
.toast-container {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
    pointer-events: none;
}

.toast {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    animation: toastIn 0.25s ease, toastOut 0.3s ease 1.8s forwards;
    pointer-events: all;
}

@keyframes toastIn  { from { opacity: 0; transform: translateX(40px); } }
@keyframes toastOut { to   { opacity: 0; transform: translateX(40px); } }

/* ── 15. EXPORT BAR ─────────────────────────────────────── */
.export-bar {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-elevated);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.export-bar span {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-right: var(--space-xs);
}

/* ── 16. TOOL STATUS NOTICE ─────────────────────────────── */
.tool-disabled-notice {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.tool-disabled-notice .notice-icon { font-size: 3rem; margin-bottom: var(--space-md); display: block; }
.tool-disabled-notice h2 { font-size: 1.3rem; color: var(--text-secondary); margin-bottom: var(--space-sm); }

/* ── 17. PRESETS (Port Checker) ─────────────────────────── */
.preset-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.preset-chip {
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    font-family: var(--font-sans);
}

.preset-chip:hover { 
    background: rgba(99,102,241,0.12); 
    border-color: var(--brand-primary); 
    color: var(--brand-primary); 
}

/* ── 18. IP RESULT CARD ─────────────────────────────────── */
.ip-result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.ip-info-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.ip-info-value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-word;
}

.country-flag { font-size: 1.8rem; line-height: 1; display: block; margin-bottom: 4px; }

/* ── 19. BLACKLIST RESULT ───────────────────────────────── */
.bl-summary-bar {
    display: flex;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
    flex-wrap: wrap;
}

.bl-summary-item {
    background: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--space-sm) var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 80px;
    text-align: center;
}

.bl-summary-num {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.bl-summary-label {
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.bl-listed-num   { color: var(--color-fail); }
.bl-ok-num       { color: var(--color-pass); }
.bl-total-num    { color: var(--brand-primary); }

/* Progress bar for blacklist loading */
.bl-progress {
    background: var(--bg-elevated);
    border-radius: var(--radius-full);
    height: 6px;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

.bl-progress-bar {
    height: 100%;
    background: var(--brand-gradient);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
    width: 0%;
}

/* ── 20. ADMIN PANEL ────────────────────────────────────── */
.admin-layout {
    display: flex;
    min-height: calc(100vh - 68px - 200px);
}

.admin-sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    padding: var(--space-lg) 0;
}

.admin-sidebar-title {
    padding: 0 var(--space-lg) var(--space-md);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.admin-nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 10px var(--space-lg);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    border-left: 3px solid transparent;
}

.admin-nav-link:hover { background: var(--bg-hover); color: var(--text-primary); }
.admin-nav-link.active { 
    background: rgba(99,102,241,0.08); 
    color: var(--brand-primary); 
    border-left-color: var(--brand-primary); 
}

.admin-main {
    flex: 1;
    padding: var(--space-xl);
    overflow-x: hidden;
}

.admin-page-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-xl);
    letter-spacing: -0.3px;
}

/* Stats grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    transition: all var(--transition-normal);
}

.stat-card:hover { border-color: var(--brand-primary); box-shadow: var(--shadow-glow); }

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

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-xs);
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input { opacity: 0; width: 0; height: 0; }

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-hover);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: background var(--transition-fast);
    border: 1px solid var(--border-color);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: white;
    transition: transform var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

/* Tool row in settings */
.tool-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-color);
    gap: var(--space-md);
}

.tool-row:last-child { border-bottom: none; }

.tool-info { flex: 1; }
.tool-info h4 { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.tool-info p  { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

/* Recent searches table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table th {
    padding: 10px var(--space-md);
    text-align: left;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-elevated);
}

.data-table td {
    padding: 12px var(--space-md);
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
    vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-elevated); }

/* ── 21. LOGIN PAGE ─────────────────────────────────────── */
.login-page {
    min-height: calc(100vh - 68px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    background: radial-gradient(ellipse at 50% 0%, rgba(99,102,241,0.12) 0%, transparent 70%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    box-shadow: var(--card-shadow), var(--shadow-glow);
}

.login-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-xl);
}

.form-field {
    margin-bottom: var(--space-md);
}

.form-field label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.alert {
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--space-md);
}

.alert-error { background: var(--color-fail-bg); color: var(--color-fail); border: 1px solid rgba(239,68,68,0.2); }
.alert-success { background: var(--color-pass-bg); color: var(--color-pass); border: 1px solid rgba(16,185,129,0.2); }
.alert-info { background: var(--color-info-bg); color: var(--color-info); border: 1px solid rgba(59,130,246,0.2); }

/* ── 22. FOOTER ─────────────────────────────────────────── */
.site-footer {
    background: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
    padding: var(--space-xl) 0 0;
}

.footer-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-lg);
    display: flex;
    gap: var(--space-2xl);
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: var(--space-xl);
}

.footer-brand { flex: 1; min-width: 200px; }

.footer-logo-text {
    font-size: 1.05rem;
    font-weight: 700;
    color: white;
    display: block;
    margin-bottom: var(--space-xs);
}

.footer-tagline {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.4);
    line-height: 1.6;
}

.footer-links {
    display: flex;
    gap: var(--space-2xl);
    flex-wrap: wrap;
}

.footer-col h4 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.4);
    margin-bottom: var(--space-sm);
}

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a {
    text-decoration: none;
    color: rgba(255,255,255,0.55);
    font-size: 0.875rem;
    transition: color var(--transition-fast);
}
.footer-col ul li a:hover { color: white; }

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: var(--space-md) var(--space-lg);
    text-align: center;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.25);
}

/* ── Custom Footer HTML content styling ───────────────── */
.footer-custom-content {
    font-size: 0.875rem;
    line-height: 1.7;
    color: rgba(255,255,255,0.55);
}

.footer-custom-content p {
    margin-bottom: 6px;
    color: rgba(255,255,255,0.55);
}

.footer-custom-content a {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-custom-content a:hover { color: #fff; }

.footer-custom-content h3,
.footer-custom-content h4 {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.4);
    margin-bottom: var(--space-sm);
    margin-top: var(--space-sm);
}

.footer-custom-content h3:first-child,
.footer-custom-content h4:first-child { margin-top: 0; }

.footer-custom-content ul,
.footer-custom-content ol {
    list-style: none;
    padding: 0;
    margin: 0 0 6px 0;
}

.footer-custom-content ul li,
.footer-custom-content ol li {
    margin-bottom: 6px;
    color: rgba(255,255,255,0.55);
}

.footer-custom-content strong { color: rgba(255,255,255,0.8); font-weight: 600; }
.footer-custom-content em     { color: rgba(255,255,255,0.5); font-style: italic; }
.footer-custom-content small  { font-size: 0.78rem; color: rgba(255,255,255,0.35); }

/* ── 23. UTILITY CLASSES ────────────────────────────────── */
.text-muted    { color: var(--text-muted); }
.text-pass     { color: var(--color-pass); }
.text-fail     { color: var(--color-fail); }
.text-warn     { color: var(--color-warn); }
.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mb-md  { margin-bottom: var(--space-md); }
.flex   { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-sm { gap: var(--space-sm); }
.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; clip: rect(0,0,0,0); overflow: hidden; }

/* ── 24. RESPONSIVE ─────────────────────────────────────── */
@media (max-width: 900px) {
    .main-nav { display: none; }
    .mobile-menu-btn { display: flex; }
    .mobile-nav { display: block; }
    .btn-admin span { display: none; }
    .admin-layout { flex-direction: column; }
    .admin-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border-color); padding: var(--space-sm) 0; }
    .admin-sidebar-title { display: none; }
    .admin-main { padding: var(--space-lg); }
}

@media (max-width: 640px) {
    .header-inner { padding: 16px var(--space-md) 12px; }
    .page-container { padding: var(--space-lg) var(--space-md); }
    .search-card { padding: var(--space-lg); }
    .input-row { flex-direction: column; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .bl-summary-bar { flex-direction: row; }
    .result-table th, .result-table td { padding: 10px var(--space-md); }
    .footer-inner { flex-direction: column; gap: var(--space-lg); }
    .footer-links { gap: var(--space-lg); }

    /* Responsive result table */
    .result-table-wrap { overflow-x: visible; overflow-y: hidden; }
    table.result-table, .result-table tbody, .result-table tr, .result-table td { display: block; }
    .result-table thead { display: none; }
    .result-table tr {
        padding: var(--space-md);
        border-bottom: 1px solid var(--border-color);
        position: relative;
    }
    .result-table td {
        padding: 4px 0 !important;
        border: none !important;
        width: 100% !important;
    }
    .result-table td:nth-child(1) { margin-bottom: 4px; }
    .result-table td.td-test { font-size: 1rem; margin-bottom: 4px; }
    .result-table td.td-info { font-size: 0.85rem; word-break: break-word; color: var(--text-muted); padding-right: 4px; margin-bottom: 8px; }
    .result-table td:last-child {
        position: absolute;
        top: var(--space-md);
        right: var(--space-md);
        width: auto !important;
        padding: 0 !important;
    }
}

 / *    % %  1 6 .   P W A   C U S T O M   P R O M P T    % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %  * / 
 . p w a - p r o m p t   { 
         p o s i t i o n :   f i x e d ; 
         b o t t o m :   v a r ( - - s p a c e - x l ) ; 
         l e f t :   5 0 % ; 
         t r a n s f o r m :   t r a n s l a t e X ( - 5 0 % )   t r a n s l a t e Y ( 1 5 0 % ) ; 
         b a c k g r o u n d :   v a r ( - - b g - s u r f a c e ) ; 
         b o r d e r :   1 p x   s o l i d   v a r ( - - b o r d e r - c o l o r ) ; 
         b o r d e r - r a d i u s :   v a r ( - - r a d i u s - l g ) ; 
         b o x - s h a d o w :   v a r ( - - s h a d o w - l g ) ; 
         p a d d i n g :   v a r ( - - s p a c e - m d )   v a r ( - - s p a c e - l g ) ; 
         d i s p l a y :   f l e x ; 
         a l i g n - i t e m s :   c e n t e r ; 
         g a p :   v a r ( - - s p a c e - m d ) ; 
         z - i n d e x :   1 0 0 0 ; 
         w i d t h :   9 0 % ; 
         m a x - w i d t h :   4 0 0 p x ; 
         t r a n s i t i o n :   t r a n s f o r m   0 . 4 s   c u b i c - b e z i e r ( 0 . 1 7 5 ,   0 . 8 8 5 ,   0 . 3 2 ,   1 . 2 7 5 ) ; 
         o p a c i t y :   0 ; 
 } 
 
 . p w a - p r o m p t . s h o w   { 
         t r a n s f o r m :   t r a n s l a t e X ( - 5 0 % )   t r a n s l a t e Y ( 0 ) ; 
         o p a c i t y :   1 ; 
 } 
 
 . p w a - p r o m p t - c o n t e n t   { 
         d i s p l a y :   f l e x ; 
         a l i g n - i t e m s :   c e n t e r ; 
         g a p :   v a r ( - - s p a c e - m d ) ; 
         f l e x :   1 ; 
 } 
 
 . p w a - p r o m p t - i c o n   { 
         w i d t h :   4 8 p x ; 
         h e i g h t :   4 8 p x ; 
         b o r d e r - r a d i u s :   v a r ( - - r a d i u s - s m ) ; 
         f l e x - s h r i n k :   0 ; 
 } 
 
 . p w a - p r o m p t - t e x t   { 
         f l e x :   1 ; 
 } 
 
 . p w a - p r o m p t - t e x t   s t r o n g   { 
         d i s p l a y :   b l o c k ; 
         f o n t - s i z e :   0 . 9 5 r e m ; 
         c o l o r :   v a r ( - - t e x t - p r i m a r y ) ; 
         m a r g i n - b o t t o m :   2 p x ; 
 } 
 
 . p w a - p r o m p t - t e x t   p   { 
         f o n t - s i z e :   0 . 7 5 r e m ; 
         c o l o r :   v a r ( - - t e x t - s e c o n d a r y ) ; 
         l i n e - h e i g h t :   1 . 3 ; 
 } 
 
 . p w a - p r o m p t - a c t i o n s   { 
         d i s p l a y :   f l e x ; 
         a l i g n - i t e m s :   c e n t e r ; 
         g a p :   v a r ( - - s p a c e - s m ) ; 
 } 
 
 . p w a - c l o s e - b t n   { 
         b a c k g r o u n d :   n o n e ; 
         b o r d e r :   n o n e ; 
         f o n t - s i z e :   1 . 5 r e m ; 
         l i n e - h e i g h t :   1 ; 
         c o l o r :   v a r ( - - t e x t - m u t e d ) ; 
         c u r s o r :   p o i n t e r ; 
         p a d d i n g :   0   4 p x ; 
 } 
 
 . p w a - c l o s e - b t n : h o v e r   { 
         c o l o r :   v a r ( - - c o l o r - f a i l ) ; 
 } 
 
 / *   M o b i l e   s p e c i f i c   s t y l i n g   * / 
 @ m e d i a   ( m a x - w i d t h :   6 0 0 p x )   { 
         . p w a - p r o m p t   { 
                 b o t t o m :   v a r ( - - s p a c e - m d ) ; 
                 p a d d i n g :   v a r ( - - s p a c e - s m )   v a r ( - - s p a c e - m d ) ; 
                 w i d t h :   c a l c ( 1 0 0 %   -   3 2 p x ) ; 
         } 
 } 
  
 