:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-tertiary: #1a1a25;
  --border: #2a2a3a;
  --text-primary: #e8e8f0;
  --text-secondary: #8888a0;
  --text-muted: #5555666;
  --accent-cyan: #00d4ff;
  --accent-purple: #a855f7;
  --accent-pink: #ec4899;
  --pass: #10b981;
  --pass-glow: rgba(16, 185, 129, 0.3);
  --fail: #ef4444;
  --fail-glow: rgba(239, 68, 68, 0.3);
  --unknown: #6b7280;
  --gradient-1: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  --gradient-2: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
}

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

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.background-grid {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.glow-1 {
  width: 600px;
  height: 600px;
  background: var(--accent-cyan);
  opacity: 0.08;
  top: -200px;
  right: -100px;
  animation: float 20s ease-in-out infinite;
}

.glow-2 {
  width: 500px;
  height: 500px;
  background: var(--accent-purple);
  opacity: 0.06;
  bottom: -150px;
  left: -100px;
  animation: float 25s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(30px, 20px); }
}

header {
  position: relative;
  z-index: 1;
  padding: 3rem 2rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(10, 10, 15, 0.9), rgba(10, 10, 15, 0.95));
  backdrop-filter: blur(10px);
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  color: var(--accent-cyan);
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.logo svg {
  opacity: 0.9;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  font-weight: 300;
}

main {
  position: relative;
  z-index: 1;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
}

.stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.stat {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
  transition: transform 0.2s, border-color 0.2s;
}

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

.stat-value {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.stat-value.pass { color: var(--pass); }
.stat-value.fail { color: var(--fail); }

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

#matrices-container {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.matrix-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.matrix-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 1rem;
}

.matrix-header h2 {
  font-size: 1.1rem;
  font-weight: 600;
}

.legend {
  display: flex;
  gap: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.dot.pass { background: var(--pass); box-shadow: 0 0 8px var(--pass-glow); }
.dot.fail { background: var(--fail); box-shadow: 0 0 8px var(--fail-glow); }
.dot.unknown { background: var(--unknown); }

.matrix-scroll {
  overflow-x: auto;
  padding: 1rem;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: center;
  border-radius: 6px;
}

th {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  font-weight: 500;
  white-space: nowrap;
}

.corner-cell {
  text-align: left;
  color: var(--text-muted);
  font-size: 0.75rem;
}

tbody th {
  text-align: right;
  background: var(--bg-tertiary);
}

td {
  background: var(--bg-primary);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: default;
  position: relative;
}

td:hover {
  transform: scale(1.1);
  z-index: 10;
}

td.pass {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(16, 185, 129, 0.1));
  color: var(--pass);
  box-shadow: inset 0 0 0 1px rgba(16, 185, 129, 0.3);
}

td.pass:hover {
  box-shadow: 0 0 20px var(--pass-glow), inset 0 0 0 1px var(--pass);
}

td.fail {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
  color: var(--fail);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.3);
}

td.fail:hover {
  box-shadow: 0 0 20px var(--fail-glow), inset 0 0 0 1px var(--fail);
}

td.unknown {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

.history-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}

.history-section h2 {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 1.1rem;
  font-weight: 600;
}

.history-list {
  max-height: 400px;
  overflow-y: auto;
}

.history-item {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

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

.history-item:hover {
  background: var(--bg-tertiary);
}

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

.history-status.pass { background: var(--pass); box-shadow: 0 0 8px var(--pass-glow); }
.history-status.fail { background: var(--fail); box-shadow: 0 0 8px var(--fail-glow); }
.history-status.error { background: var(--unknown); }

.history-versions {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.history-versions span {
  color: var(--text-secondary);
  margin: 0 0.25rem;
}

.history-versions strong {
  color: var(--text-primary);
  font-weight: 600;
}

.history-result {
  font-size: 0.8rem;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.history-result.pass {
  background: rgba(16, 185, 129, 0.15);
  color: var(--pass);
}

.history-result.fail {
  background: rgba(239, 68, 68, 0.15);
  color: var(--fail);
}

.history-result.error {
  background: rgba(107, 114, 128, 0.15);
  color: var(--unknown);
}

.history-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
}

.loading {
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary);
}

footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

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

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

#footer-links p {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
}

#footer-links p::before,
#footer-links p::after {
  content: '';
}

.copyright {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 2rem 1rem 1.5rem;
  }
  
  main {
    padding: 1rem;
  }
  
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .matrix-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .legend {
    flex-wrap: wrap;
    gap: 1rem;
  }
  
  .history-item {
    grid-template-columns: auto 1fr;
    gap: 0.5rem;
  }
  
  .history-result,
  .history-time {
    grid-column: 2;
  }
}

