/* The IP Hunter - v2 theme
   Same palette as mycssDark.css (#363636 / #636262 / #fafafa / gray / white),
   modernized: cards, soft shadows, radar loader, report dashboard. */

:root {
    --charcoal: #363636;
    --charcoal-deep: #2a2a2a;
    --slate: #636262;
    --slate-light: #8a8989;
    --bg: #fafafa;
    --surface: #ffffff;
    --text: #3d3d3d;
    --muted: #8c8c8c;
    --line: #e7e7e7;
    --line-soft: #f1f1f1;
    --danger: #b83d3d;
    --danger-soft: #fbeaea;
    --safe: #3f7d5c;
    --safe-soft: #e8f3ec;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .05), 0 18px 48px rgba(0, 0, 0, .12);
    --mono: "JetBrains Mono", Consolas, "Courier New", monospace;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
p { color: var(--muted); }
a { color: var(--slate); }
a:hover { color: var(--charcoal); }
::selection { background: var(--charcoal); color: #fff; }

/* ---------- Header ---------- */
.topbar {
    background: linear-gradient(120deg, var(--charcoal-deep) 0%, var(--charcoal) 55%, #444 100%);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1030;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
}
.topbar-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 28px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
}
.brand img {
    height: 54px;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, .45));
    transition: transform .35s cubic-bezier(.2, .8, .2, 1.4);
}
.brand:hover img { transform: rotate(-4deg) scale(1.06); }
.brand-title {
    margin: 0;
    font-size: 19px;
    font-weight: 800;
    letter-spacing: .18em;
    color: #fff;
}
.brand-sub {
    display: block;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .02em;
    color: #c9c9c9;
    margin-top: 2px;
}
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.subbar {
    background: var(--slate);
    color: #f2f2f2;
    font-size: 13px;
    padding: 7px 28px;
    letter-spacing: .01em;
}
#google_translate_element .goog-te-gadget { color: #cfcfcf !important; font-size: 11px; }
#google_translate_element select {
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .08);
    color: #fff;
    padding: 3px 6px;
}
#google_translate_element select option { color: #333; }

/* ---------- Layout ---------- */
.main { flex: 1; padding: 26px 28px 10px; }
.panel {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--line-soft);
    padding: 22px;
    height: 100%;
    animation: rise .5s ease both;
}
.col-center .panel { animation-delay: .06s; min-height: 72vh; }
.col-side .panel { animation-delay: .12s; }
@keyframes rise {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}
.panel-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--slate);
    margin: 0 0 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.panel-title svg { width: 16px; height: 16px; }
.sticky-col { position: sticky; top: 104px; }

/* ---------- Search panel ---------- */
.ip-input {
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.6;
    min-height: 210px;
    resize: vertical;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fcfcfc;
    color: var(--text);
    padding: 12px 14px;
    transition: border-color .2s, box-shadow .2s, background .2s;
}
.ip-input:focus {
    border-color: var(--slate);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99, 98, 98, .12);
    outline: none;
}
.ip-input.is-bad { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(184, 61, 61, .1); }
.ip-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 2px 16px;
    font-size: 12px;
    color: var(--muted);
}
.ip-count {
    font-weight: 600;
    color: var(--charcoal);
    background: var(--line-soft);
    border-radius: 999px;
    padding: 3px 10px;
    transition: background .2s, color .2s;
}
.ip-count.over { background: var(--danger-soft); color: var(--danger); }
.ip-hint { color: var(--danger); font-size: 12px; min-height: 18px; margin: -8px 2px 10px; }

.btn-hunter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    border: 0;
    border-radius: var(--radius-sm);
    padding: 11px 16px;
    font-weight: 600;
    font-size: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--slate) 0%, var(--charcoal) 100%);
    box-shadow: 0 6px 16px rgba(54, 54, 54, .25);
    transition: transform .15s, box-shadow .2s, filter .2s;
    cursor: pointer;
}
.btn-hunter:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(54, 54, 54, .3); color: #fff; filter: brightness(1.08); }
.btn-hunter:active { transform: translateY(0); }
.btn-hunter:focus { outline: none; box-shadow: 0 0 0 4px rgba(99, 98, 98, .25); }
.btn-hunter svg { width: 16px; height: 16px; }
.btn-ghost {
    background: transparent;
    color: var(--slate);
    border: 1.5px solid var(--line);
    box-shadow: none;
    margin-top: 10px;
}
.btn-ghost:hover { color: var(--charcoal); border-color: var(--slate-light); box-shadow: none; filter: none; }
#btnExportToCsv { margin-top: 10px; animation: rise .4s ease both; }

/* ---------- Idle / welcome state ---------- */
.hero { text-align: center; padding: 26px 10px 8px; }
.hero-logo {
    width: 190px;
    filter: drop-shadow(0 12px 22px rgba(0, 0, 0, .18));
    animation: float 6s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}
.hero h1 {
    font-size: 26px;
    font-weight: 800;
    color: var(--charcoal);
    margin: 18px 0 10px;
    letter-spacing: -.01em;
}
.hero-lead {
    max-width: 640px;
    margin: 0 auto 26px;
    font-size: 15.5px;
    line-height: 1.7;
}
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 720px; margin: 0 auto; }
.step {
    text-align: left;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 16px;
    transition: transform .2s, box-shadow .2s, border-color .2s;
}
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; }
.step-num {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    background: var(--charcoal);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 10px;
}
.step h6 { margin: 0 0 4px; font-weight: 700; color: var(--charcoal); font-size: 14px; }
.step p { margin: 0; font-size: 13px; line-height: 1.5; }

/* ---------- Loading (radar) ---------- */
#waitmessage2 { text-align: center; padding: 40px 10px; animation: rise .35s ease both; }
.radar {
    position: relative;
    width: 190px;
    height: 190px;
    margin: 10px auto 26px;
    border-radius: 50%;
    background:
        radial-gradient(circle, transparent 30%, rgba(99, 98, 98, .12) 31%, transparent 32%),
        radial-gradient(circle, transparent 54%, rgba(99, 98, 98, .12) 55%, transparent 56%),
        radial-gradient(circle, #fff 0%, #f3f3f3 100%);
    border: 2px solid rgba(99, 98, 98, .25);
    box-shadow: inset 0 0 30px rgba(0, 0, 0, .06), var(--shadow);
    overflow: hidden;
}
.radar::before, .radar::after {
    content: "";
    position: absolute;
    background: rgba(99, 98, 98, .15);
}
.radar::before { left: 50%; top: 0; bottom: 0; width: 1px; }
.radar::after { top: 50%; left: 0; right: 0; height: 1px; }
.radar-sweep {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: conic-gradient(from 0deg, rgba(54, 54, 54, .55), rgba(54, 54, 54, 0) 28%);
    animation: sweep 2.2s linear infinite;
}
@keyframes sweep { to { transform: rotate(360deg); } }
.radar-blip {
    position: absolute;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--charcoal);
    opacity: 0;
    animation: blip 2.2s ease-out infinite;
}
.radar-blip:nth-child(2) { top: 28%; left: 64%; animation-delay: .35s; }
.radar-blip:nth-child(3) { top: 62%; left: 26%; animation-delay: 1.1s; }
.radar-blip:nth-child(4) { top: 70%; left: 70%; animation-delay: 1.6s; background: var(--danger); }
@keyframes blip {
    0% { opacity: 0; transform: scale(.4); }
    10% { opacity: 1; transform: scale(1.3); }
    60% { opacity: .5; transform: scale(1); }
    100% { opacity: 0; }
}
.radar-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 64px;
    transform: translate(-50%, -50%);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .25));
}
#waitmessage {
    font-size: 19px;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 6px;
}
.scan-status {
    height: 22px;
    font-size: 14px;
    color: var(--slate);
    transition: opacity .3s;
}
.scan-meta {
    display: inline-flex;
    gap: 10px;
    margin: 18px 0 14px;
}
.scan-meta span {
    font-size: 12px;
    font-weight: 600;
    color: var(--charcoal);
    background: var(--line-soft);
    border-radius: 999px;
    padding: 5px 12px;
}
.scan-bar {
    width: 260px;
    height: 4px;
    margin: 0 auto 18px;
    border-radius: 4px;
    background: var(--line);
    overflow: hidden;
    position: relative;
}
.scan-bar::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 40%;
    border-radius: 4px;
    background: linear-gradient(90deg, transparent, var(--charcoal), transparent);
    animation: indeterminate 1.4s ease-in-out infinite;
}
@keyframes indeterminate {
    from { transform: translateX(-100%); }
    to { transform: translateX(260%); }
}
.scan-note { font-size: 13px; line-height: 1.6; }

/* ---------- Report ---------- */
.report-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}
.report-title {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    color: var(--charcoal);
    letter-spacing: -.01em;
}
.report-title span {
    display: inline-block;
    opacity: 0;
    transform: translateY(10px);
    animation: letter .45s cubic-bezier(.2, .8, .2, 1.2) forwards;
}
@keyframes letter { to { opacity: 1; transform: none; } }
.report-date { font-size: 13px; color: var(--muted); margin: 0; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.stat {
    border-radius: var(--radius-sm);
    padding: 14px 16px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #fff, #fbfbfb);
    animation: rise .45s ease both;
}
.stat:nth-child(2) { animation-delay: .08s; }
.stat:nth-child(3) { animation-delay: .16s; }
.stat-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.stat-value { font-size: 30px; font-weight: 800; color: var(--charcoal); line-height: 1.2; font-variant-numeric: tabular-nums; }
.stat-bad .stat-value { color: var(--danger); }
.stat-good .stat-value { color: var(--safe); }
.stat-track { height: 4px; border-radius: 4px; background: var(--line-soft); margin-top: 8px; overflow: hidden; }
.stat-track i { display: block; height: 100%; width: 0; border-radius: 4px; transition: width 1s cubic-bezier(.2, .8, .2, 1); }
.stat-bad .stat-track i { background: var(--danger); }
.stat-good .stat-track i { background: var(--safe); }
.stat-total .stat-track i { background: var(--charcoal); }

.report-tools { display: flex; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.report-search {
    flex: 1;
    min-width: 180px;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 8px 12px 8px 34px;
    font-size: 14px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238c8c8c' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 11px center;
}
.report-search:focus { outline: none; border-color: var(--slate); box-shadow: 0 0 0 4px rgba(99, 98, 98, .12); }
.chip-filter {
    border: 1.5px solid var(--line);
    background: #fff;
    color: var(--slate);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.chip-filter:hover { border-color: var(--slate-light); }
.chip-filter.active { background: var(--charcoal); border-color: var(--charcoal); color: #fff; }
.chip-filter:focus { outline: none; }

#divwithtable {
    max-height: 56vh;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}
.report-table { margin: 0; font-size: 13px; color: var(--text); }
.report-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--slate);
    color: #fff;
    border: 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 11px 10px;
    white-space: nowrap;
}
.report-table th:first-child, .report-table td:first-child { padding-left: 14px; }
.report-table td {
    padding: 10px 10px;
    vertical-align: middle;
    border-top: 1px solid var(--line-soft);
}
.report-table tbody tr {
    animation: rowin .35s ease both;
    transition: background .15s;
}
.report-table tbody tr:hover { background: #f6f6f6; }
@keyframes rowin {
    from { opacity: 0; transform: translateX(-6px); }
    to { opacity: 1; transform: none; }
}
.report-table .ip {
    font-family: var(--mono);
    font-weight: 600;
    color: var(--charcoal);
    cursor: copy;
    white-space: nowrap;
}
.report-table .ip:hover { text-decoration: underline dotted; }
.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-bad { background: var(--danger-soft); color: var(--danger); }
.pill-good { background: var(--safe-soft); color: var(--safe); }
.tag {
    display: inline-block;
    font-size: 12px;
    background: var(--line-soft);
    color: var(--slate);
    border-radius: 6px;
    padding: 2px 8px;
}
.tag:empty { display: none; }
.cell-muted { color: var(--muted); }
.no-match { text-align: center; padding: 22px; color: var(--muted); display: none; }

.toast-copy {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 20px);
    background: var(--charcoal);
    color: #fff;
    font-size: 13px;
    padding: 9px 16px;
    border-radius: 999px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: all .25s;
    z-index: 2000;
}
.toast-copy.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Error message ---------- */
#errormessage {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    max-width: 560px;
    margin: 20px auto;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--danger-soft);
    border: 1px solid rgba(184, 61, 61, .25);
    animation: shake .45s ease both;
}
#errormessage p { color: var(--danger); margin: 0; font-weight: 500; text-align: left; }
#errormessage::before {
    content: "!";
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--danger);
    color: #fff;
    font-weight: 800;
    font-size: 13px;
    display: grid;
    place-items: center;
}
@keyframes shake {
    20%, 60% { transform: translateX(-5px); }
    40%, 80% { transform: translateX(5px); }
}

/* ---------- Side panel ---------- */
.tip { display: flex; gap: 10px; margin-bottom: 16px; }
.tip-icon {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--line-soft);
    color: var(--charcoal);
    display: grid;
    place-items: center;
}
.tip-icon svg { width: 15px; height: 15px; }
.tip h6 { margin: 2px 0 2px; font-size: 13px; font-weight: 700; color: var(--charcoal); }
.tip p { margin: 0; font-size: 12.5px; line-height: 1.5; }
.tip code { font-family: var(--mono); font-size: 11.5px; color: var(--charcoal); background: var(--line-soft); padding: 1px 5px; border-radius: 4px; }

/* ---------- Terms drawer ---------- */
#termsconditions {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(560px, 92vw);
    background: #fff;
    z-index: 1050;
    box-shadow: var(--shadow-lg);
    transform: translateX(-102%);
    transition: transform .35s cubic-bezier(.2, .8, .2, 1);
    display: flex;
    flex-direction: column;
}
#termsconditions.open { transform: none; }
.drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
}
.drawer-head h5 { margin: 0; font-weight: 700; color: var(--charcoal); }
#closeid {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--slate);
    font-size: 20px;
    cursor: pointer;
    transition: background .2s;
    text-decoration: none;
}
#closeid:hover { background: var(--line-soft); }
#termstext { overflow-y: auto; padding: 20px 28px; }
#termstext p { font-size: 13px; line-height: 1.7; color: #666; }
#termstext strong { color: var(--charcoal); }
.drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(30, 30, 30, .4);
    backdrop-filter: blur(2px);
    z-index: 1040;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }

/* ---------- Footer ---------- */
.site-footer {
    text-align: center;
    padding: 18px 10px 22px;
    font-size: 13px;
    color: var(--muted);
}
.site-footer a { color: var(--slate); font-weight: 600; text-decoration: none; }
.site-footer a:hover { color: var(--charcoal); text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .main { padding: 16px; }
    .topbar-inner, .subbar { padding-left: 16px; padding-right: 16px; }
    .sticky-col { position: static; }
    .col-center .panel { min-height: 0; }
}
@media (max-width: 575.98px) {
    .steps, .stats { grid-template-columns: 1fr; }
    .brand-title { font-size: 15px; }
    .brand-sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .report-title span { opacity: 1; transform: none; }
}
