:root {
    --bg: #060816;
    --bg-2: #0b1020;
    --panel: rgba(255, 255, 255, 0.06);
    --panel-strong: rgba(255, 255, 255, 0.1);
    --border: rgba(255, 255, 255, 0.12);
    --text: #edf2ff;
    --muted: #aab3cf;
    --accent: #6ee7ff;
    --accent-2: #8b5cf6;
    --accent-3: #22c55e;
    --warning: #f59e0b;
    --danger: #fb7185;
    --shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    --radius: 22px;
    --container: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background:
        radial-gradient(circle at top right, rgba(139, 92, 246, 0.18), transparent 20%),
        radial-gradient(circle at bottom left, rgba(34, 197, 94, 0.15), transparent 20%),
        linear-gradient(180deg, var(--bg), var(--bg-2));
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(100% - 32px, var(--container));
    margin-inline: auto;
}

.hidden {
    display: none !important;
}

.page {
    min-height: 100vh;
}

/* Background blobs */
.bg-blobs {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.blob {
    position: absolute;
    border-radius: 999px;
    filter: blur(60px);
    opacity: 0.35;
    animation: floatBlob 16s ease-in-out infinite;
}

.blob-1 {
    width: 320px;
    height: 320px;
    top: 8%;
    right: 8%;
    background: #7c3aed;
}

.blob-2 {
    width: 360px;
    height: 360px;
    bottom: 10%;
    left: 5%;
    background: #06b6d4;
    animation-delay: -5s;
}

.blob-3 {
    width: 260px;
    height: 260px;
    top: 35%;
    left: 40%;
    background: #22c55e;
    animation-delay: -9s;
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(circle at center, black, transparent 85%);
    -webkit-mask-image: radial-gradient(circle at center, black, transparent 85%);
}

@keyframes floatBlob {

    0%,
    100% {
        transform: translateY(0) translateX(0) scale(1);
    }

    25% {
        transform: translateY(-20px) translateX(12px) scale(1.05);
    }

    50% {
        transform: translateY(18px) translateX(-10px) scale(0.98);
    }

    75% {
        transform: translateY(-8px) translateX(20px) scale(1.02);
    }
}

/* Glass */
.glass {
    background: var(--panel);
    border: 1px solid var(--border);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

/* Layout */
.hero-section {
    padding: 42px 0 50px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 22px 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.brand {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.brand span {
    color: var(--accent);
}

.brand-sub {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.stats-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(110, 231, 255, 0.15), rgba(139, 92, 246, 0.16));
    border: 1px solid rgba(110, 231, 255, 0.2);
    color: var(--text);
    font-weight: 600;
}

#statsCount {
    color: var(--accent);
    font-weight: 800;
    font-size: 1.05rem;
}

.scanner-grid {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 24px;
    align-items: start;
}

.scanner-panel,
.scanner-card {
    padding: 28px;
}

.eyebrow {
    color: var(--accent);
    font-size: 0.9rem;
    margin: 0 0 12px;
    letter-spacing: 1px;
}

.scanner-panel h1 {
    font-size: clamp(2rem, 4vw, 3.6rem);
    line-height: 1.12;
    margin: 0 0 14px;
}

.hero-desc {
    color: var(--muted);
    line-height: 1.9;
    margin: 0 0 24px;
    max-width: 640px;
}

.mini-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.stat {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 16px;
    text-align: center;
}

.stat-num {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    color: var(--muted);
    font-size: 0.92rem;
}

/* Card */
.card-head {
    margin-bottom: 20px;
}

.card-head h2 {
    margin: 0 0 8px;
    font-size: 1.4rem;
}

.card-head p {
    margin: 0;
    color: var(--muted);
}

.input-group {
    margin-bottom: 18px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text);
    font-size: 0.95rem;
}

.subtitle {
    font-weight: 400;
    font-size: 0.8rem;
    color: var(--muted);
}

input[type="text"],
input[type="number"] {
    width: 100%;
    min-height: 50px;
    padding: 0 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    font-size: 1rem;
    transition: 0.25s ease;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-family: inherit;
    outline: none;
}

input::placeholder {
    color: #95a0c0;
}

input:focus {
    border-color: rgba(110, 231, 255, 0.45);
    box-shadow: 0 0 0 4px rgba(110, 231, 255, 0.08);
    background: rgba(255, 255, 255, 0.06);
}

.ip-row {
    display: flex;
    gap: 10px;
}

.actions {
    display: flex;
    gap: 14px;
    margin-top: 24px;

    /* new: clip any stray button edges */
    position: relative;
    /* overflow: hidden;
    border-radius: 18px;
    padding: 2px 0; */
    /* small vertical padding so clipping looks natural */
}


/* Buttons */
.btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 20px;
    border-radius: 16px;
    transition: transform 0.22s ease, box-shadow 0.25s ease, border-color 0.25s ease, background 0.25s ease;
    border: 1px solid transparent;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.95rem;
    font-family: inherit;
    flex: 1;
    letter-spacing: 0.2px;
    isolation: isolate;
    box-shadow: inset 0 0 0 0 rgba(255, 255, 255, 0);
}


.btn-label {
    position: relative;
    z-index: 2;
}

.btn-shine {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    border-radius: inherit;
}

.btn-shine::before {
    content: "";
    position: absolute;
    top: -20%;
    left: -130%;
    width: 70%;
    height: 140%;
    transform: rotate(18deg);
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.18),
            transparent);
    transition: left 0.7s ease;
}

.btn:hover:not(:disabled) .btn-shine::before {
    left: 140%;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #08111f;
    box-shadow:
        0 12px 30px rgba(110, 231, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:hover:not(:disabled) {
    box-shadow:
        0 16px 40px rgba(110, 231, 255, 0.22),
        0 0 0 1px rgba(110, 231, 255, 0.12);
}

.btn-secondary {
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.03));
    white-space: nowrap;
    flex: 0 0 auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.btn-secondary:hover:not(:disabled) {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.05));
    border-color: rgba(110, 231, 255, 0.18);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), var(--danger));
    color: #fff;
    box-shadow:
        0 12px 30px rgba(245, 158, 11, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-warning:hover:not(:disabled) {
    box-shadow:
        0 16px 38px rgba(251, 113, 133, 0.18),
        0 0 0 1px rgba(251, 113, 133, 0.12);
}

.btn.is-loading {
    pointer-events: none;
}

.btn.is-loading .btn-label::after {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 10px;
    vertical-align: -2px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-top-color: rgba(255, 255, 255, 0.95);
    animation: spin 0.8s linear infinite;
}

/* Messages */
.status-box {
    margin-top: 20px;
    border-radius: 18px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.loading-box {
    background:
        linear-gradient(180deg, rgba(110, 231, 255, 0.08), rgba(139, 92, 246, 0.08));
    border: 1px solid rgba(110, 231, 255, 0.16);
    box-shadow:
        0 14px 34px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.loading-top {
    display: flex;
    align-items: center;
    gap: 16px;
}

.scan-orb {
    position: relative;
    width: 58px;
    height: 58px;
    flex: 0 0 58px;
    display: grid;
    place-items: center;
}

.scan-orb-core {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle, #ffffff 0%, var(--accent) 60%, #3b82f6 100%);
    box-shadow:
        0 0 18px rgba(110, 231, 255, 0.9),
        0 0 36px rgba(139, 92, 246, 0.35);
    animation: pulseCore 1.6s ease-in-out infinite;
}

.scan-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(110, 231, 255, 0.35);
    animation: radarPulse 2.6s ease-out infinite;
}

.ring-1 {
    width: 28px;
    height: 28px;
    animation-delay: 0s;
}

.ring-2 {
    width: 42px;
    height: 42px;
    animation-delay: 0.45s;
}

.ring-3 {
    width: 58px;
    height: 58px;
    animation-delay: 0.9s;
}

.loading-copy {
    min-width: 0;
    flex: 1;
}

.loading-title {
    font-weight: 800;
    color: #e6f7ff;
    margin-bottom: 4px;
    font-size: 1rem;
    letter-spacing: 0.2px;
}

.loading-subtitle {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.6;
    min-height: 22px;
}

.loading-progress {
    width: 100%;
    height: 10px;
    margin-top: 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
    position: relative;
}

.loading-bar {
    width: 8%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), var(--accent-2), #60a5fa);
    background-size: 200% 100%;
    box-shadow: 0 0 18px rgba(110, 231, 255, 0.28);
    animation: loadingGradient 2.2s linear infinite;
    transition: width 0.45s ease;
}

.loading-steps {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.loading-step {
    font-size: 0.78rem;
    font-weight: 700;
    color: #97a3c8;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: 0.25s ease;
}

.loading-step.active {
    color: #eafcff;
    background: rgba(110, 231, 255, 0.14);
    border-color: rgba(110, 231, 255, 0.28);
    box-shadow: 0 0 0 1px rgba(110, 231, 255, 0.08);
}

.loading-step.done {
    color: #bbf7d0;
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.18);
}

.error-msg {
    background: rgba(251, 113, 133, 0.12);
    color: #ffd5dc;
    border: 1px solid rgba(251, 113, 133, 0.24);
    font-weight: 600;
}

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

@keyframes pulseCore {

    0%,
    100% {
        transform: scale(0.95);
        opacity: 0.95;
    }

    50% {
        transform: scale(1.15);
        opacity: 1;
    }
}

@keyframes radarPulse {
    0% {
        transform: scale(0.72);
        opacity: 0.9;
    }

    70% {
        transform: scale(1.08);
        opacity: 0.22;
    }

    100% {
        transform: scale(1.18);
        opacity: 0;
    }
}

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

    100% {
        background-position: 200% 50%;
    }
}

/* Results */
.result-port {
    font-weight: 700;
    color: var(--text);
}

.result-enter {
    animation: resultIn 0.45s ease both;
}

@keyframes resultIn {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


.results-container {
    margin-top: 24px;
    padding: 18px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.results-head h3 {
    margin: 0 0 14px;
    font-size: 1.08rem;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

li {
    padding: 14px 16px;
    margin-bottom: 10px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    transition: 0.25s ease;
}

li:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.07);
}

li:last-child {
    margin-bottom: 0;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.open .status-badge {
    background: rgba(34, 197, 94, 0.14);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.closed .status-badge {
    background: rgba(251, 113, 133, 0.14);
    color: #fda4af;
    border: 1px solid rgba(251, 113, 133, 0.2);
}

.filtered .status-badge {
    background: rgba(245, 158, 11, 0.14);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Footer */
.site-footer {
    padding-top: 24px;
}

.footer-wrap {
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    flex-wrap: wrap;
}

.footer-wrap h3 {
    margin: 0 0 6px;
}

.footer-wrap p {
    margin: 0;
    color: var(--muted);
}

.footer-links {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--muted);
    transition: 0.2s ease;
}

.footer-links a:hover {
    color: var(--text);
}

/* Responsive */
@media (max-width: 950px) {
    .scanner-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .mini-stats {
        grid-template-columns: 1fr;
    }

    .actions,
    .ip-row {
        flex-direction: column;
    }

    .topbar,
    .scanner-panel,
    .scanner-card,
    .footer-wrap {
        padding: 18px;
    }

    li {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }

    .result-enter {
        opacity: 1 !important;
        transform: none !important;
    }
}
