/* FakeVisitor - Professional Browser Fingerprint Analysis */

:root {
  /* Dark theme - professional and readable */
  --bg-primary: #0f0f17;
  --bg-secondary: #161621;
  --bg-card: #1a1a2e;
  --bg-input: #232336;
  --bg-hover: #2a2a42;

  --border: #2d2d44;
  --border-light: #3d3d5c;

  --text: #e4e4eb;
  --text-dim: #9999a8;
  --text-bright: #ffffff;
  --text-muted: #6b6b7b;

  --accent: #4ecca3;
  --accent-hover: #45b892;
  --blue: #5c8aff;
  --green: #4ecca3;
  --yellow: #ffcc4d;
  --orange: #ff9f43;
  --red: #ff6b6b;
  --purple: #a855f7;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
}

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

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: var(--accent-hover); }

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

/* Header */
.header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-bright);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.logo:hover { color: var(--text-bright); }

.nav {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: all 0.2s;
}
.nav-link:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.nav-link.active {
  color: var(--accent);
  background: rgba(78, 204, 163, 0.1);
}

/* Main */
.main {
  padding: 40px 0 60px;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 40px 0 48px;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 12px;
  letter-spacing: -0.03em;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--accent);
  color: var(--bg-primary);
}
.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(78, 204, 163, 0.3);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

/* Progress Bar */
.progress-bar {
  margin-top: 24px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
  min-height: 24px;
}
.progress-bar:empty { display: none; }
.progress-bar.running { color: var(--yellow); }
.progress-bar.done { color: var(--green); }
.progress-bar.error { color: var(--red); }

/* Score Section */
.score-section:empty { display: none; }

.score-overview {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
}

.score-item {
  text-align: center;
}

.score-value {
  font-size: 3rem;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  margin-bottom: 8px;
}
.score-value.good { color: var(--green); }
.score-value.moderate { color: var(--yellow); }
.score-value.bad { color: var(--red); }

.score-label {
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.score-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.score-badge.real { background: rgba(78, 204, 163, 0.15); color: var(--green); }
.score-badge.uncertain { background: rgba(255, 204, 77, 0.15); color: var(--yellow); }
.score-badge.fake { background: rgba(255, 107, 107, 0.15); color: var(--red); }

.device-id {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.device-id-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.device-id-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  background: var(--bg-input);
  padding: 8px 16px;
  border-radius: var(--radius);
  display: inline-block;
  word-break: break-all;
}

/* Report Link */
.report-link-container:empty { display: none; }
.report-link-container {
  text-align: center;
  margin-bottom: 32px;
}
.report-link-container a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--blue);
  color: white;
  border-radius: var(--radius);
  font-weight: 500;
}
.report-link-container a:hover {
  background: #4a7ae8;
}

/* Results Grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-bottom: 32px;
}

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

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--bg-input);
  border-bottom: 1px solid var(--border);
}

.card-header.collapsible {
  cursor: pointer;
  user-select: none;
}
.card-header.collapsible:hover {
  background: var(--bg-hover);
}

.card-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-bright);
}

.toggle-icon {
  font-size: 1.2rem;
  color: var(--text-dim);
  font-weight: 300;
}

.card-body {
  padding: 20px;
}

.card-body.collapsed {
  display: none;
}

/* Icons */
.icon {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: white;
}

.icon-network { background: var(--blue); }
.icon-network::before { content: "IP"; }
.icon-lock { background: var(--purple); }
.icon-lock::before { content: "TLS"; }
.icon-browser { background: var(--accent); }
.icon-browser::before { content: "UA"; }
.icon-webrtc { background: var(--orange); }
.icon-webrtc::before { content: "RTC"; }
.icon-dns { background: var(--yellow); color: var(--bg-primary); }
.icon-dns::before { content: "DNS"; }
.icon-canvas { background: #e91e63; }
.icon-canvas::before { content: "2D"; }
.icon-webgl { background: #00bcd4; }
.icon-webgl::before { content: "GL"; }
.icon-audio { background: #9c27b0; }
.icon-audio::before { content: "AU"; }
.icon-fonts { background: #795548; }
.icon-fonts::before { content: "Aa"; }
.icon-bot { background: var(--red); }
.icon-bot::before { content: "BOT"; font-size: 0.6rem; }
.icon-privacy { background: #607d8b; }
.icon-privacy::before { content: "PRI"; font-size: 0.6rem; }
.icon-cpu { background: #ff5722; }
.icon-cpu::before { content: "HW"; }
.icon-media { background: #8bc34a; }
.icon-media::before { content: "MED"; font-size: 0.6rem; }
.icon-api { background: #3f51b5; }
.icon-api::before { content: "API"; font-size: 0.6rem; }
.icon-http { background: #009688; }
.icon-http::before { content: "HTTP"; font-size: 0.55rem; }
.icon-json { background: #ffc107; color: var(--bg-primary); }
.icon-json::before { content: "{ }"; }

/* Status Badges */
.status-badge:empty { display: none; }

.status-badge {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.status-badge.ok { background: rgba(78, 204, 163, 0.15); color: var(--green); }
.status-badge.warn { background: rgba(255, 204, 77, 0.15); color: var(--yellow); }
.status-badge.bad { background: rgba(255, 107, 107, 0.15); color: var(--red); }
.status-badge.info { background: rgba(92, 138, 255, 0.15); color: var(--blue); }
.status-badge.na { background: rgba(107, 107, 123, 0.15); color: var(--text-muted); }

/* Placeholder */
.placeholder {
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-style: italic;
}

/* IP Display */
.ip-display {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.ip-flag {
  font-size: 2.5rem;
  line-height: 1;
}

.ip-info { flex: 1; }

.ip-address {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-bright);
}

.ip-location {
  color: var(--text);
  font-size: 0.95rem;
  margin-top: 4px;
}

.ip-asn {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-top: 2px;
}

.ip-tags {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.ip-tag {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
}
.ip-tag.tor { background: rgba(255, 107, 107, 0.2); color: var(--red); }
.ip-tag.hosting { background: rgba(255, 159, 67, 0.2); color: var(--orange); }
.ip-tag.vpn { background: rgba(255, 204, 77, 0.2); color: var(--yellow); }
.ip-tag.proxy { background: rgba(255, 107, 107, 0.2); color: var(--red); }

/* Data Grid */
.data-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.data-item {
  padding: 12px;
  background: var(--bg-input);
  border-radius: var(--radius);
}

.data-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.data-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  word-break: break-all;
}
.data-value.good { color: var(--green); }
.data-value.warn { color: var(--yellow); }
.data-value.bad { color: var(--red); }

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table tr {
  border-bottom: 1px solid var(--border);
}
.data-table tr:last-child { border: none; }

.data-table td {
  padding: 10px 0;
  font-size: 0.9rem;
}

.data-table td:first-child {
  color: var(--text-dim);
  width: 40%;
}

.data-table td:last-child {
  font-family: var(--font-mono);
  text-align: right;
  color: var(--text);
}

/* Hash Display */
.hash {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  background: var(--bg-input);
  padding: 6px 10px;
  border-radius: var(--radius);
  display: inline-block;
  color: var(--text-dim);
  word-break: break-all;
}

/* TLS Fingerprints */
.tls-grid {
  display: grid;
  gap: 16px;
}

.tls-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--bg-input);
  border-radius: var(--radius);
}

.tls-label {
  font-weight: 600;
  color: var(--text);
}

.tls-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
}

.tls-value.na {
  color: var(--text-muted);
  font-style: italic;
}

.tls-note {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(255, 204, 77, 0.1);
  border: 1px solid rgba(255, 204, 77, 0.2);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--yellow);
}

/* Fingerprint Result */
.fp-result {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fp-hash-display {
  padding: 16px;
  background: var(--bg-input);
  border-radius: var(--radius);
  text-align: center;
}

.fp-hash-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.fp-hash-value {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--accent);
  word-break: break-all;
}

.fp-details { margin-top: 8px; }

/* Detection List */
.detection-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.detection-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: var(--radius);
}

.detection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.detection-dot.ok { background: var(--green); }
.detection-dot.warn { background: var(--yellow); }
.detection-dot.bad { background: var(--red); }
.detection-dot.na { background: var(--text-muted); }

.detection-name {
  flex: 1;
  font-size: 0.9rem;
}

.detection-value {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

/* API Status Grid */
.api-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.api-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: var(--radius);
  font-size: 0.8rem;
}

.api-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.api-dot.yes { background: var(--green); }
.api-dot.no { background: var(--red); }
.api-dot.partial { background: var(--yellow); }

/* Code Block */
.code-block {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 500px;
  overflow-y: auto;
  color: var(--text-dim);
}

/* Details Section */
.details-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  margin-top: 40px;
}

.footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-nav {
  display: flex;
  gap: 24px;
}

.footer-nav a {
  color: var(--text-dim);
  font-size: 0.85rem;
}
.footer-nav a:hover { color: var(--text); }

/* Loading Spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

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

  .score-overview {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  html { font-size: 13px; }

  .container { padding: 0 16px; }

  .hero h1 { font-size: 1.8rem; }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn { justify-content: center; }

  .score-overview {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .ip-display {
    flex-direction: column;
    text-align: center;
  }

  .ip-tags {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .data-grid {
    grid-template-columns: 1fr;
  }

  .footer .container {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}

/* Print styles */
@media print {
  .header, .footer, .hero-actions, .progress-bar { display: none; }
  .card-body.collapsed { display: block; }
  body { background: white; color: black; }
  .card { border: 1px solid #ccc; }
}
