:root {
  --bg-primary: #090c13;
  --bg-card: rgba(16, 22, 36, 0.75);
  --bg-card-hover: rgba(22, 30, 48, 0.85);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-focus: #00f0ff;
  
  --accent-cyan: #00f0ff;
  --accent-purple: #8b5cf6;
  --accent-emerald: #10b981;
  --accent-rose: #f43f5e;
  --accent-amber: #f59e0b;

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

  --font-main: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* {
  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;
  display: flex;
  flex-direction: column;
}

.glow-bg {
  position: fixed;
  top: -20%;
  left: 10%;
  width: 80%;
  height: 60%;
  background: radial-gradient(circle, rgba(0, 240, 255, 0.07) 0%, rgba(139, 92, 246, 0.05) 50%, transparent 80%);
  filter: blur(80px);
  pointer-events: none;
  z-index: 0;
}

/* Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(9, 12, 19, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-card);
  padding: 0.85rem 1.5rem;
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-radar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(0, 240, 255, 0.4);
  background: radial-gradient(circle, rgba(0, 240, 255, 0.15) 0%, transparent 70%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radar-sweep {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border-top: 2px solid #00f0ff;
  border-right: 2px solid transparent;
  animation: radar-spin 2.5s linear infinite;
}

@keyframes radar-spin {
  100% { transform: rotate(360deg); }
}

.radar-dot {
  width: 6px;
  height: 6px;
  background-color: #00f0ff;
  border-radius: 50%;
  box-shadow: 0 0 8px #00f0ff;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.badge-tag {
  font-size: 0.65rem;
  font-weight: 700;
  background: rgba(0, 240, 255, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.online {
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.btn-auth {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-card);
}

.btn-auth:hover {
  background: rgba(0, 240, 255, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

/* Main Container */
.main-container {
  max-width: 1280px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  flex: 1;
  width: 100%;
  z-index: 1;
}

/* Navigation Tabs */
.nav-tabs-container {
  max-width: 1280px;
  margin: 1.25rem auto 0;
  padding: 0 1.5rem;
  width: 100%;
}

.nav-tabs {
  display: flex;
  gap: 0.4rem;
  border-bottom: 1px solid var(--border-card);
  padding-bottom: 0.5rem;
  overflow-x: auto;
}

.tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}

.tab-btn:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.tab-btn.active {
  background: rgba(0, 240, 255, 0.12);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.25);
}

/* Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.card-title {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.45;
  margin-bottom: 1.5rem;
}

.card-desc code {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* Telemetry Stats Grid (Camouflage view) */
.telemetry-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Presets */
.presets-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.presets-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.presets-list {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-card);
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preset-btn:hover {
  background: rgba(0, 240, 255, 0.1);
  border-color: rgba(0, 240, 255, 0.3);
  color: var(--accent-cyan);
}

/* Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.form-label {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input-field, .textarea-field, .select-field {
  background: rgba(10, 14, 24, 0.8);
  border: 1px solid var(--border-card);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
}

.select-field {
  font-family: var(--font-main);
  cursor: pointer;
}

.input-field:focus, .textarea-field:focus, .select-field:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.checkbox-group {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.checkbox-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
}

.checkbox-container input {
  display: none;
}

.custom-checkbox {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-card);
  border-radius: 4px;
  background: rgba(10, 14, 24, 0.8);
  position: relative;
  transition: all 0.2s ease;
}

.checkbox-container input:checked + .custom-checkbox {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.checkbox-container input:checked + .custom-checkbox::after {
  content: "✔";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #090c13;
  font-size: 10px;
  font-weight: 800;
}

.btn {
  background: linear-gradient(135deg, #00f0ff, #0284c7);
  color: #090c13;
  border: none;
  font-family: var(--font-main);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 0.85rem 1.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.35);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border: 1px solid var(--border-card);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.1);
}

.btn-small {
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(9, 12, 19, 0.3);
  border-top-color: #090c13;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Results */
.results-container {
  margin-top: 2rem;
  border-top: 1px solid var(--border-card);
  padding-top: 1.5rem;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.result-title {
  font-size: 1.05rem;
  font-weight: 600;
}

.timestamp {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.verdict-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.verdict-card {
  background: rgba(10, 14, 24, 0.7);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1.25rem;
  position: relative;
  overflow: hidden;
}

.verdict-card.alive { border-color: rgba(16, 185, 129, 0.35); }
.verdict-card.blocked { border-color: rgba(244, 63, 94, 0.45); }
.verdict-card.warning { border-color: rgba(245, 158, 11, 0.45); }
.verdict-card.down { border-color: rgba(245, 158, 11, 0.35); }

.verdict-badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.badge-alive { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-blocked { background: rgba(244, 63, 94, 0.15); color: #fb7185; }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.badge-down { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.verdict-metric {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 0.35rem;
}

.metric-label { color: var(--text-secondary); }
.metric-value { font-family: var(--font-mono); font-weight: 600; color: var(--text-primary); }

.evidence-box {
  background: rgba(10, 14, 24, 0.9);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Stealth Score Card */
.stealth-score-card {
  background: linear-gradient(135deg, rgba(16, 22, 36, 0.9), rgba(10, 14, 24, 0.95));
  border: 1px solid var(--border-card);
  border-radius: 16px;
  padding: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

.stealth-score-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.score-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  border: 4px solid var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.3);
}

.score-number { font-size: 1.75rem; line-height: 1; }
.score-max { font-size: 0.7rem; color: var(--text-muted); }

.stealth-score-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.stealth-score-info p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.stealth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* PMTU & Jitter */
.pmtu-verdict-box {
  background: rgba(10, 14, 24, 0.85);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.pmtu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.pmtu-cell {
  background: rgba(10, 14, 24, 0.7);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all 0.2s ease;
}

.pmtu-cell.passed {
  border-color: rgba(16, 185, 129, 0.4);
}

.pmtu-cell.failed {
  border-color: rgba(244, 63, 94, 0.4);
  opacity: 0.7;
}

.pmtu-cell-label { font-size: 0.82rem; font-weight: 600; }
.pmtu-cell-status { font-size: 0.75rem; font-family: var(--font-mono); }

.jitter-summary-box {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stat-box {
  background: rgba(10, 14, 24, 0.7);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 1rem;
}

.stat-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.stat-value { font-size: 1.3rem; font-family: var(--font-mono); font-weight: 700; color: var(--accent-cyan); }

.jitter-samples-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 90px;
  background: rgba(10, 14, 24, 0.8);
  border: 1px solid var(--border-card);
  border-radius: 10px;
  padding: 1rem;
}

.jitter-bar-col {
  flex: 1;
  background: linear-gradient(to top, rgba(0, 240, 255, 0.2), #00f0ff);
  border-radius: 3px;
  min-height: 4px;
  position: relative;
  transition: all 0.2s ease;
}

.jitter-bar-col:hover {
  filter: brightness(1.3);
}

/* Data Table (SNI Radar) */
.table-responsive {
  overflow-x: auto;
}

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

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

.data-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

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

.code-box {
  background: rgba(10, 14, 24, 0.95);
  border: 1px solid var(--border-card);
  border-radius: 8px;
  padding: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #38bdf8;
  overflow-x: auto;
  line-height: 1.5;
}

.opt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.opt-header h3 { font-size: 0.95rem; font-weight: 600; }

/* Subnet Heatmap */
.scan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 4px;
  margin-top: 1rem;
}

.ip-cell {
  aspect-ratio: 1;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ip-cell.alive {
  background: rgba(16, 185, 129, 0.25);
  border-color: rgba(16, 185, 129, 0.6);
  color: #34d399;
  font-weight: 700;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.3);
}

.ip-cell:hover {
  transform: scale(1.15);
  z-index: 10;
}

/* Docs */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

.doc-box {
  background: rgba(10, 14, 24, 0.7);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 1.5rem;
}

.doc-icon { font-size: 1.8rem; margin-bottom: 0.75rem; }
.doc-title { font-size: 1rem; font-weight: 600; margin-bottom: 0.5rem; }
.doc-text { font-size: 0.84rem; color: var(--text-secondary); line-height: 1.5; }
.doc-text code { font-family: var(--font-mono); color: var(--accent-cyan); background: rgba(0, 240, 255, 0.1); padding: 0.1rem 0.3rem; border-radius: 3px; }

/* Modal Login */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 6, 10, 0.85);
  backdrop-filter: blur(14px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-card {
  width: 100%;
  max-width: 420px;
  position: relative;
  margin: auto;
  animation: modal-in 0.25s ease-out;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-primary);
}

.login-error-msg {
  background: rgba(244, 63, 94, 0.15);
  border: 1px solid rgba(244, 63, 94, 0.4);
  color: #fb7185;
  padding: 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  margin-top: 0.5rem;
}

/* Footer */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-card);
  padding: 1.25rem 1.5rem;
  background: rgba(9, 12, 19, 0.85);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.footer-container {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.accent-link { color: var(--accent-cyan); text-decoration: none; }
.accent-link:hover { text-decoration: underline; }

.tab-content { display: none; }
.tab-content.active { display: block; }
