:root {
  --bg-primary: #07090e;
  --bg-card: rgba(14, 20, 33, 0.75);
  --bg-card-hover: rgba(20, 29, 48, 0.85);
  --bg-glass-input: rgba(15, 23, 42, 0.6);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(56, 189, 248, 0.25);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --font-main: 'Outfit', -apple-system, blinkmacsystemfont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-main);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  line-height: 1.5;
}

/* background ambient effects */
.bg-glow {
  position: fixed;
  top: -150px;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 500px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.12) 0%, rgba(99, 102, 241, 0.08) 45%, transparent 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px 60px;
  position: relative;
  z-index: 1;
}

/* header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(99, 102, 241, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

.header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #ffffff, #93c5fd);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-color);
  font-size: 0.8125rem;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-emerald);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

/* search section */
.search-section {
  margin-bottom: 32px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-glass-input);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px 12px 8px 18px;
  transition: all 0.25s ease;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

.search-box:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

.search-icon {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-main);
  font-size: 1rem;
  color: var(--text-primary);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-main);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #04101d;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: rgba(51, 65, 85, 0.9);
  color: var(--text-primary);
}

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

.btn-icon {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.05);
}

/* preset chips */
.preset-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip-label {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.chip {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chip:hover {
  border-color: var(--accent-cyan);
  color: var(--text-primary);
  background: rgba(6, 182, 212, 0.1);
}

.chip.chip-active {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.15);
}

/* state containers */
.loading-container, .error-container {
  padding: 48px;
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(6, 182, 212, 0.15);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.error-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--accent-rose);
  background: rgba(244, 63, 94, 0.05);
  border-color: rgba(244, 63, 94, 0.2);
}

.hidden {
  display: none !important;
}

/* dashboard */
.dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* hero card */
.hero-card {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(11, 15, 25, 0.85));
  backdrop-filter: blur(16px);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.4);
}

.hero-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.hero-tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.hero-ip-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-ip-row h2 {
  font-size: 2.25rem;
  font-weight: 800;
  font-family: var(--font-mono);
  letter-spacing: -0.03em;
  color: #ffffff;
}

.hero-hostname {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 4px;
}

.hero-badges {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.badge-clean {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
}

.badge-clean .badge-dot {
  background: var(--accent-emerald);
  box-shadow: 0 0 8px var(--accent-emerald);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-amber);
}

.badge-warning .badge-dot {
  background: var(--accent-amber);
  box-shadow: 0 0 8px var(--accent-amber);
}

.badge-danger {
  background: rgba(244, 63, 94, 0.12);
  border: 1px solid rgba(244, 63, 94, 0.3);
  color: var(--accent-rose);
}

.badge-danger .badge-dot {
  background: var(--accent-rose);
  box-shadow: 0 0 8px var(--accent-rose);
}

.badge-asn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* quick grid */
.hero-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.quick-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quick-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.quick-val {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.font-mono {
  font-family: var(--font-mono);
}

/* 4 pillars leak grid */
.leak-grid-card {
  border-color: rgba(6, 182, 212, 0.25);
}

.leak-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.leak-card-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all 0.2s ease;
}

.leak-card-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.12);
}

.leak-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.leak-item-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  color: #ffffff;
}

.leak-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.leak-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.leak-item-detail {
  font-size: 0.8125rem;
  color: var(--accent-cyan);
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.04);
  word-break: break-all;
}

/* fingerprint suite card */
.fingerprint-suite-card {
  border-color: rgba(99, 102, 241, 0.25);
}

.fp-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}

.fp-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fp-box-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fp-box-val {
  font-size: 1.125rem;
  font-weight: 700;
  color: #ffffff;
}

.font-glow {
  color: var(--accent-cyan);
  text-shadow: 0 0 12px rgba(6, 182, 212, 0.4);
}

.fp-box-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* cards common */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: border-color 0.25s ease;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.0625rem;
  font-weight: 600;
  color: #f1f5f9;
}

.card-title svg {
  color: var(--accent-cyan);
}

.card-badge {
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
}

/* grid layout */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.grid-col {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* map */
.map-container {
  height: 240px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 18px;
  border: 1px solid var(--border-color);
  z-index: 1;
}

/* details list */
.location-details-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.detail-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.detail-name {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.detail-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

/* security grid */
.security-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sec-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px;
  transition: all 0.2s ease;
}

.sec-icon {
  font-size: 1.25rem;
}

.sec-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sec-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sec-status {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent-emerald);
}

.sec-item.is-detected {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.3);
}

.sec-item.is-detected .sec-status {
  color: var(--accent-rose);
}

/* comparison table */
.table-responsive {
  overflow-x: auto;
}

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.compare-table th {
  text-align: left;
  padding: 12px 14px;
  color: var(--text-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.compare-table td {
  padding: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
}

.compare-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.source-badge {
  font-weight: 700;
  color: var(--accent-cyan);
}

.match-high {
  color: var(--accent-emerald);
  font-weight: 600;
}

.match-diverge {
  color: var(--accent-amber);
}

/* raw json viewer */
.json-viewer {
  background: #040711;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  max-height: 360px;
  overflow-y: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: #93c5fd;
  line-height: 1.6;
}

/* toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--accent-cyan);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  color: var(--text-primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 9999;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* responsive */
@media (max-width: 900px) {
  .content-grid {
    grid-template-columns: 1fr;
  }
  .hero-ip-row h2 {
    font-size: 1.75rem;
  }
}
