/* Yandex Fingerprint Tests - Styles */
:root {
  --bg: #0d1117;
  --bg-card: #161b22;
  --border: #30363d;
  --text: #c9d1d9;
  --text-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #79b8ff;
  --success: #3fb950;
  --warning: #d29922;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 1rem 2rem;
  display: flex;
  gap: 2rem;
  align-items: center;
}

nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

nav a:hover {
  color: var(--accent-hover);
}

nav .active {
  border-bottom: 2px solid var(--accent);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.loading-msg {
  color: var(--text-muted);
  padding: 2rem;
}

/* Test grid */
.test-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.test-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  transition: border-color 0.2s;
}

.test-card:hover {
  border-color: var(--accent);
}

.test-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  color: var(--text);
  display: flex;
  align-items: flex-start;
  gap: 0.35rem;
}
.test-card .param-code-hint {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.test-card .param-code-hint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.1em;
  height: 1.1em;
  font-size: 0.7em;
  font-weight: 600;
  color: var(--accent);
  background: rgba(88, 166, 255, 0.15);
  border-radius: 50%;
  cursor: help;
}
.test-card .param-code-hint-icon:hover {
  background: rgba(88, 166, 255, 0.3);
}
.test-card .param-code-tooltip {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  margin-top: 0.25rem;
  padding: 1rem 1.2rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text);
  white-space: normal;
  max-width: 960px;
  min-width: 400px;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.test-card .param-code-tooltip-row {
  display: block;
  margin-bottom: 0.35rem;
}
.test-card .param-code-tooltip code {
  font-family: var(--font-mono);
  font-size: 0.95em;
  word-break: break-all;
  display: block;
  margin: 0.5rem 0 0.6rem;
  padding: 0.5rem;
  background: rgba(0,0,0,0.2);
  border-radius: 4px;
}
.test-card .param-code-copy-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.3rem;
  color: var(--accent);
  cursor: pointer;
  border-radius: 4px;
}
.test-card .param-code-copy-icon:hover {
  background: rgba(88, 166, 255, 0.2);
  color: var(--accent-hover);
}
.test-card .param-code-copy-icon.param-code-copy-done {
  color: var(--success);
}
.test-card .param-code-hint:hover .param-code-tooltip {
  display: block;
}

.test-card .param-id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.test-card .param-what,
.test-card .param-how {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  line-height: 1.35;
}
.test-card .param-how {
  font-size: 0.75rem;
}

.test-card .ref-norm {
  font-size: 0.7rem;
  margin-top: 0.25rem;
  padding: 0.2rem 0;
}

.test-card .ref-desktop {
  color: var(--accent);
}

.test-card .ref-tablet {
  color: var(--success);
}

.test-card .ref-mobile {
  color: var(--warning);
}

.test-card .ref-norm:first-of-type {
  margin-top: 0.35rem;
  padding-top: 0.25rem;
  border-top: 1px dashed var(--border);
}

.test-card .result {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  background: rgba(0,0,0,0.3);
  padding: 0.5rem;
  border-radius: 4px;
  word-break: break-all;
  min-height: 2rem;
  margin-bottom: 0.5rem;
}

.test-card .result.loading {
  color: var(--text-muted);
}

.test-card .result.error {
  color: #f85149;
}

.test-card button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.8rem;
}

.test-card button:hover {
  background: var(--accent-hover);
}

.run-all-btn {
  background: var(--success);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
}

.run-all-btn:hover {
  opacity: 0.9;
}

.run-all-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.save-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

.save-btn:hover {
  background: var(--accent-hover);
}

.test-card button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Category sections */
.category {
  margin-bottom: 2.5rem;
}

.category h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  color: var(--accent);
}

/* Knowledge base */
.kb-search {
  width: 100%;
  max-width: 500px;
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1rem;
}

.kb-search:focus {
  outline: none;
  border-color: var(--accent);
}

.kb-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.kb-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  cursor: pointer;
  transition: border-color 0.2s;
}

.kb-item:hover {
  border-color: var(--accent);
}

.kb-item h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.kb-item .desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.kb-item .source-tag {
  font-size: 0.7rem;
  color: var(--accent);
  margin-right: 0.5rem;
}

.kb-item .github-links {
  margin-top: 0.5rem;
}

.kb-item .github-links a {
  font-size: 0.8rem;
  color: var(--accent);
  margin-right: 1rem;
  text-decoration: none;
}

.kb-item .github-links a:hover {
  text-decoration: underline;
}

/* Detail modal/panel */
.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 100;
}

.detail-panel h2 {
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.detail-panel .close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
}

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

.landing-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.landing-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.landing-card h2 {
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.landing-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Stats */
.stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.stats span {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.stats strong {
  color: var(--success);
}
