.netscanner-app {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #0a0f0a;
    color: #bfcfbf;
    font-size: 12px;
    font-family: "Cascadia Code", "Fira Code", monospace;
}

/* ── Header ── */
.netscanner-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: linear-gradient(180deg, #0f1a0f 0%, #0d140d 100%);
    border-bottom: 1px solid #1a3a1a;
    flex-shrink: 0;
}

.netscanner-title {
    font-size: 14px;
    font-weight: 700;
    color: #00cc44;
    letter-spacing: 1px;
    text-shadow: 0 0 6px rgba(0, 204, 68, 0.3);
}

.netscanner-subtitle {
    font-size: 10px;
    color: #446644;
    flex: 1;
}

/* ── Body Layout ── */
.netscanner-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.netscanner-left {
    width: 240px;
    flex-shrink: 0;
    border-right: 1px solid #1a3a1a;
    display: flex;
    flex-direction: column;
    background: #0d140d;
}

/* ── Target Input ── */
.netscanner-input-area {
    padding: 10px;
    border-bottom: 1px solid #1a3a1a;
}

.netscanner-input-label {
    font-size: 10px;
    color: #446644;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.netscanner-input {
    width: 100%;
    background: #060a06;
    border: 1px solid #1a3a1a;
    color: #00cc44;
    font-size: 12px;
    font-family: inherit;
    padding: 6px 8px;
    border-radius: 3px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.netscanner-input:focus {
    border-color: #00cc44;
    box-shadow: 0 0 6px rgba(0, 204, 68, 0.2);
}

/* ── Command Tabs ── */
.netscanner-cmd-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding: 8px 10px;
    border-bottom: 1px solid #1a3a1a;
}

.netscanner-cmd-tab {
    padding: 4px 7px;
    border: 1px solid #1a3a1a;
    background: transparent;
    color: #446644;
    cursor: pointer;
    font-size: 10px;
    font-family: inherit;
    border-radius: 3px;
    transition: all 0.2s;
    position: relative;
}

.netscanner-cmd-tab:hover {
    background: #1a3a1a;
    color: #8aaa8a;
    border-color: #2a5a2a;
}

.netscanner-cmd-tab.active {
    background: #0a2a0a;
    border-color: #00cc44;
    color: #00cc44;
    box-shadow: 0 0 4px rgba(0, 204, 68, 0.15);
}

.netscanner-cmd-tab.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 25%;
    right: 25%;
    height: 1px;
    background: #00cc44;
    box-shadow: 0 0 4px rgba(0, 204, 68, 0.5);
}

/* ── Port Selector ── */
.netscanner-port-selector {
    padding: 8px 10px;
    border-bottom: 1px solid #1a3a1a;
    display: none;
}

.netscanner-port-select {
    width: 100%;
    background: #060a06;
    border: 1px solid #1a3a1a;
    color: #00cc44;
    font-size: 11px;
    font-family: inherit;
    padding: 4px 6px;
    border-radius: 3px;
    outline: none;
    box-sizing: border-box;
}

/* ── Execute Button ── */
.netscanner-launch-btn {
    margin: 10px;
    padding: 8px;
    background: linear-gradient(180deg, #0d300d 0%, #0a2a0a 100%);
    border: 1px solid #00cc44;
    color: #00cc44;
    font-size: 12px;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    border-radius: 4px;
    letter-spacing: 1px;
    transition: all 0.2s;
    text-shadow: 0 0 4px rgba(0, 204, 68, 0.3);
    position: relative;
    overflow: hidden;
}

.netscanner-launch-btn:hover {
    background: linear-gradient(180deg, #164016 0%, #0d300d 100%);
    box-shadow: 0 0 8px rgba(0, 204, 68, 0.2);
}

.netscanner-launch-btn:disabled {
    opacity: 0.6;
    cursor: default;
    box-shadow: none;
}

.netscanner-launch-btn.scanning {
    color: #88cc88;
}

/* Progress bar inside execute button */
.ns-btn-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: #00cc44;
    box-shadow: 0 0 6px rgba(0, 204, 68, 0.6);
    transition: width 0.3s ease-out;
    border-radius: 0 1px 0 0;
}

/* ── Known Hosts List ── */
.netscanner-hosts-label {
    padding: 6px 10px;
    font-size: 10px;
    color: #446644;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid #1a3a1a;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.netscanner-hosts-label::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    background: #446644;
    border-radius: 50%;
}

.netscanner-host-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 6px;
}

.netscanner-host-item {
    padding: 6px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    color: #8aaa8a;
    border: 1px solid transparent;
    margin-bottom: 2px;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.netscanner-host-item:hover {
    background: #1a3a1a;
    color: #bfcfbf;
    border-color: #2a5a2a;
}

.netscanner-host-item.selected {
    background: #0a2a0a;
    border-color: #00cc44;
    color: #00cc44;
}

.ns-host-status {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ns-host-status.scanned { background: #446644; }
.ns-host-status.probed { background: #d29922; }
.ns-host-status.compromised { background: #f85149; box-shadow: 0 0 4px rgba(248, 81, 73, 0.4); }

.ns-host-info {
    flex: 1;
    min-width: 0;
}

.ns-host-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ns-host-ip {
    font-size: 9px;
    color: #446644;
}

.ns-host-ports {
    font-size: 9px;
    color: #335533;
    flex-shrink: 0;
}

/* ── Results Panel ── */
.netscanner-right {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
}

.netscanner-results-title {
    font-size: 11px;
    color: #446644;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    border-bottom: 1px solid #1a3a1a;
    padding-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.netscanner-results-title::before {
    content: "";
    display: inline-block;
    width: 3px;
    height: 12px;
    background: #00cc44;
    border-radius: 1px;
    box-shadow: 0 0 4px rgba(0, 204, 68, 0.3);
}

/* ── Scan Target Header ── */
.netscanner-target-header {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(0, 204, 68, 0.05) 0%, transparent 100%);
    border: 1px solid #1a3a1a;
    border-left: 3px solid #00cc44;
    border-radius: 0 4px 4px 0;
}

.netscanner-target-ip {
    font-size: 16px;
    font-weight: 700;
    color: #00cc44;
    text-shadow: 0 0 6px rgba(0, 204, 68, 0.2);
}

.netscanner-target-meta {
    font-size: 11px;
    color: #8aaa8a;
    margin-top: 3px;
}

.netscanner-diff-stars {
    color: #d29922;
    font-size: 11px;
    letter-spacing: 1px;
}

/* ── Port Table ── */
.netscanner-port-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12px;
    border: 1px solid #1a3a1a;
    border-radius: 4px;
    overflow: hidden;
}

.netscanner-port-table thead tr {
    background: linear-gradient(180deg, #0f1a0f 0%, #0d140d 100%);
}

.netscanner-port-table th {
    text-align: left;
    padding: 6px 10px;
    border-bottom: 1px solid #1a3a1a;
    font-size: 10px;
    color: #446644;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.netscanner-port-table td {
    text-align: left;
    padding: 5px 10px;
    border-bottom: 1px solid #111a11;
    font-size: 11px;
}

.netscanner-port-table tbody tr {
    transition: background 0.15s;
}

.netscanner-port-table tbody tr:hover {
    background: rgba(0, 204, 68, 0.03);
}

.netscanner-port-table tbody tr:last-child td {
    border-bottom: none;
}

.netscanner-port-table td.port-num {
    color: #58a6ff;
    font-weight: 600;
}

.netscanner-port-table td.port-service {
    color: #bfcfbf;
}

.netscanner-port-table td.port-version {
    color: #6a8a6a;
    font-size: 10px;
}

/* Probe button in table */
.ns-probe-link {
    cursor: pointer;
    color: #335533;
    font-size: 10px;
    padding: 2px 6px;
    border: 1px solid #1a3a1a;
    border-radius: 3px;
    transition: all 0.2s;
    display: inline-block;
    white-space: nowrap;
}

.ns-probe-link:hover {
    color: #00cc44;
    border-color: #00cc44;
    background: rgba(0, 204, 68, 0.08);
    box-shadow: 0 0 4px rgba(0, 204, 68, 0.15);
}

.ns-probed-check {
    color: #3fb950;
    font-size: 10px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.ns-probed-check::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    background: #3fb950;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(63, 185, 80, 0.4);
}

/* ── Vulnerability Badges ── */
.netscanner-vuln-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
}

.netscanner-vuln-badge.vuln-critical {
    background: rgba(248, 81, 73, 0.15);
    color: #f85149;
    border: 1px solid rgba(248, 81, 73, 0.4);
}

.netscanner-vuln-badge.vuln-high {
    background: rgba(210, 153, 34, 0.15);
    color: #d29922;
    border: 1px solid rgba(210, 153, 34, 0.4);
}

.netscanner-vuln-badge.vuln-medium {
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    border: 1px solid rgba(88, 166, 255, 0.3);
}

.netscanner-vuln-badge.vuln-low {
    background: rgba(63, 185, 80, 0.1);
    color: #3fb950;
    border: 1px solid rgba(63, 185, 80, 0.3);
}

/* Fallback for badges without severity class */
.netscanner-vuln-badge:not(.vuln-critical):not(.vuln-high):not(.vuln-medium):not(.vuln-low) {
    background: rgba(210, 153, 34, 0.15);
    color: #d29922;
    border: 1px solid rgba(210, 153, 34, 0.4);
}

/* ── Rewards Bar ── */
.netscanner-rewards {
    background: linear-gradient(180deg, #0f1a0f 0%, #0d140d 100%);
    border: 1px solid #1a3a1a;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 10px;
    font-size: 11px;
    color: #8aaa8a;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.netscanner-rewards .xp { color: #58a6ff; font-weight: 600; }
.netscanner-rewards .alert { color: #f85149; }
.netscanner-rewards .ns-reward-sep { color: #1a3a1a; }

/* ── Info Grid (probe, nslookup, ifconfig) ── */
.netscanner-info-grid {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0;
    font-size: 11px;
    background: #0d140d;
    border: 1px solid #1a3a1a;
    border-radius: 4px;
    overflow: hidden;
}

.netscanner-info-key {
    color: #446644;
    padding: 6px 10px;
    border-bottom: 1px solid #111a11;
    background: rgba(0, 0, 0, 0.15);
}

.netscanner-info-val {
    color: #bfcfbf;
    padding: 6px 10px;
    border-bottom: 1px solid #111a11;
}

.netscanner-info-val.highlight { color: #00cc44; }
.netscanner-info-val.danger { color: #f85149; }

/* ── Traceroute ── */
.netscanner-hop-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid #1a3a1a;
    border-radius: 4px;
    overflow: hidden;
}

.netscanner-hop-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 10px;
    border-bottom: 1px solid #111a11;
    font-size: 11px;
    transition: background 0.15s;
}

.netscanner-hop-item:hover {
    background: rgba(0, 204, 68, 0.03);
}

.netscanner-hop-item:last-child {
    border-bottom: none;
}

.netscanner-hop-num { color: #335533; width: 20px; text-align: right; font-weight: 600; }
.netscanner-hop-ip { color: #00cc44; width: 130px; }
.netscanner-hop-name { color: #6a8a6a; flex: 1; font-size: 10px; }
.netscanner-hop-latency { color: #d29922; width: 50px; text-align: right; }

.netscanner-latency-bar {
    height: 4px;
    background: #1a3a1a;
    border-radius: 2px;
    overflow: hidden;
    width: 60px;
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
}

.netscanner-latency-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease-out;
}

.netscanner-latency-fill.lat-low { background: #3fb950; }
.netscanner-latency-fill.lat-med { background: #d29922; }
.netscanner-latency-fill.lat-high { background: #f85149; }

/* Fallback */
.netscanner-latency-fill:not(.lat-low):not(.lat-med):not(.lat-high) { background: #d29922; }

/* ── Netstat ── */
.netscanner-conn-table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid #1a3a1a;
    border-radius: 4px;
    overflow: hidden;
}

.netscanner-conn-table th,
.netscanner-conn-table td {
    text-align: left;
    padding: 5px 10px;
    border-bottom: 1px solid #111a11;
    font-size: 11px;
}

.netscanner-conn-table thead tr {
    background: linear-gradient(180deg, #0f1a0f 0%, #0d140d 100%);
}

.netscanner-conn-table th { color: #446644; font-weight: 600; font-size: 10px; text-transform: uppercase; }

.netscanner-conn-table tbody tr { transition: background 0.15s; }
.netscanner-conn-table tbody tr:hover { background: rgba(0, 204, 68, 0.03); }
.netscanner-conn-table tbody tr:last-child td { border-bottom: none; }

.netscanner-state-established { color: #3fb950; font-weight: 600; }
.netscanner-state-listen { color: #d29922; }

/* ── Placeholder ── */
.netscanner-placeholder {
    text-align: center;
    color: #335533;
    padding: 50px 20px;
    font-size: 11px;
}

.netscanner-placeholder-icon {
    font-size: 36px;
    margin-bottom: 12px;
    opacity: 0.6;
}

.netscanner-placeholder-hint {
    margin-top: 8px;
    font-size: 10px;
    color: #223322;
}

/* ── Ping Animation ── */
.netscanner-ping-anim {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: rgba(0, 204, 68, 0.04);
    border: 1px solid #1a3a1a;
    border-radius: 4px;
}

.netscanner-ping-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00cc44;
    animation: netscanner-ping 1.2s ease-in-out infinite;
    box-shadow: 0 0 4px rgba(0, 204, 68, 0.4);
}

.netscanner-ping-dot:nth-child(2) { animation-delay: 0.15s; }
.netscanner-ping-dot:nth-child(3) { animation-delay: 0.30s; }
.netscanner-ping-dot:nth-child(4) { animation-delay: 0.45s; }

@keyframes netscanner-ping {
    0%, 80%, 100% { opacity: 0.15; transform: scale(0.6); }
    40% { opacity: 1; transform: scale(1.1); }
}

.ns-ping-status {
    color: #3fb950;
    font-size: 11px;
    font-weight: 600;
    margin-left: 4px;
}

.ns-ping-status.down { color: #f85149; }

/* Ping reply rows */
.ns-ping-row {
    display: flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 11px;
    border-left: 2px solid transparent;
    transition: all 0.15s;
}

.ns-ping-row:hover {
    background: rgba(0, 204, 68, 0.03);
    border-left-color: #00cc44;
}

.ns-ping-seq {
    width: 22px;
    color: #335533;
    font-size: 10px;
}

.ns-ping-from {
    color: #00cc44;
    flex: 1;
}

.ns-ping-time {
    color: #d29922;
    font-size: 10px;
}

/* ── Node Detail Panel ── */
.ns-node-panel {
    border: 1px solid #1a3a1a;
    border-radius: 4px;
    margin-bottom: 12px;
    background: #0d140d;
    overflow: hidden;
}

.ns-node-panel-header {
    padding: 7px 10px;
    font-size: 11px;
    font-weight: 700;
    color: #00cc44;
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s;
}

.ns-node-panel-header:hover {
    background: #1a3a1a;
}

.ns-panel-arrow {
    display: inline-block;
    transition: transform 0.25s ease;
    font-size: 9px;
    color: #446644;
}

.ns-panel-arrow.open {
    transform: rotate(90deg);
}

.ns-node-panel-body {
    border-top: 1px solid #1a3a1a;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
    padding: 0 10px;
}

.ns-node-panel-body.open {
    max-height: 300px;
    opacity: 1;
    padding: 8px 10px;
}

.ns-node-panel-grid {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 4px 10px;
    font-size: 11px;
}

/* ── Browse Link ── */
.ns-browse-link {
    padding: 6px 10px;
    font-size: 11px;
    color: #58a6ff;
    cursor: pointer;
    margin-top: 6px;
    border: 1px solid rgba(88, 166, 255, 0.2);
    border-radius: 4px;
    transition: all 0.2s;
    display: inline-block;
}

.ns-browse-link:hover {
    color: #79c0ff;
    background: rgba(88, 166, 255, 0.08);
    border-color: rgba(88, 166, 255, 0.4);
}

/* ── Result History Nav ── */
.ns-history-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.ns-history-btn {
    background: transparent;
    border: 1px solid #1a3a1a;
    color: #446644;
    font-size: 10px;
    font-family: inherit;
    padding: 2px 6px;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.15s;
}

.ns-history-btn:hover:not(:disabled) {
    background: #1a3a1a;
    color: #8aaa8a;
    border-color: #2a5a2a;
}

.ns-history-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.ns-history-counter {
    font-size: 9px;
    color: #335533;
    min-width: 30px;
    text-align: center;
}

/* ── Scanning Overlay ── */
.ns-scanning-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
}

.ns-scan-spinner {
    width: 40px;
    height: 40px;
    border: 2px solid #1a3a1a;
    border-top: 2px solid #00cc44;
    border-radius: 50%;
    animation: ns-spin 0.8s linear infinite;
    box-shadow: 0 0 8px rgba(0, 204, 68, 0.15);
}

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

.ns-scan-label {
    color: #446644;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.ns-scan-dots::after {
    content: "";
    animation: ns-dots 1.5s steps(4, end) infinite;
}

@keyframes ns-dots {
    0% { content: ""; }
    25% { content: "."; }
    50% { content: ".."; }
    75% { content: "..."; }
    100% { content: ""; }
}

.ns-scan-progress {
    width: 160px;
    height: 3px;
    background: #1a3a1a;
    border-radius: 2px;
    overflow: hidden;
}

.ns-scan-progress-fill {
    height: 100%;
    background: #00cc44;
    border-radius: 2px;
    box-shadow: 0 0 6px rgba(0, 204, 68, 0.4);
    animation: ns-progress 1.8s ease-in-out infinite;
}

@keyframes ns-progress {
    0% { width: 0%; margin-left: 0%; }
    50% { width: 60%; margin-left: 20%; }
    100% { width: 0%; margin-left: 100%; }
}

/* ── Result Fade-in ── */
.ns-result-enter {
    animation: ns-fadeIn 0.3s ease-out;
}

@keyframes ns-fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Tier Message ── */
.netscanner-tier-msg {
    border: 1px solid #d29922;
    color: #d29922;
    background: rgba(210, 153, 34, 0.06);
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Scrollbar ── */
.netscanner-right::-webkit-scrollbar,
.netscanner-host-list::-webkit-scrollbar {
    width: 5px;
}

.netscanner-right::-webkit-scrollbar-track,
.netscanner-host-list::-webkit-scrollbar-track {
    background: transparent;
}

.netscanner-right::-webkit-scrollbar-thumb,
.netscanner-host-list::-webkit-scrollbar-thumb {
    background: #1a3a1a;
    border-radius: 3px;
}

.netscanner-right::-webkit-scrollbar-thumb:hover,
.netscanner-host-list::-webkit-scrollbar-thumb:hover {
    background: #2a5a2a;
}

/* ── First-scan badge ── */
.ns-first-scan {
    display: inline-block;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 600;
    background: rgba(88, 166, 255, 0.1);
    color: #58a6ff;
    border: 1px solid rgba(88, 166, 255, 0.3);
    margin-left: 8px;
    letter-spacing: 0.3px;
}
