/* CSS Design System - BrowserTools.com (Comprehensive Diagnostic Portal) */

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

body {
  background-color: #ebedf0;
  color: #2b303c;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  padding: 20px 0;
}

/* Page Container (Centered tech portal box) */
.page-container {
  max-width: 1020px;
  margin: 0 auto;
  background-color: #ffffff;
  border: 1px solid #b8c2cc;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  padding: 20px;
}

/* Header */
.site-header {
  border-bottom: 4px solid #2b4c7e;
  padding-bottom: 16px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.logo-area h1 {
  font-size: 28px;
  color: #2b4c7e;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-area .tagline {
  font-size: 12px;
  color: #5b6575;
  margin-top: 3px;
}

.system-summary {
  font-size: 12px;
  color: #2b4c7e;
  background-color: #eef3f9;
  border: 1px solid #c8d6e5;
  padding: 6px 12px;
  font-weight: bold;
}

/* Navigation Tabs (Classic border property style) */
.nav-bar {
  display: flex;
  background-color: #f0f4f8;
  border: 1px solid #c8d6e5;
  padding: 6px 6px 0 6px;
  gap: 4px;
  margin-bottom: 24px;
}

.nav-tab {
  background-color: #dbe3ec;
  border: 1px solid #c8d6e5;
  border-bottom: none;
  padding: 10px 18px;
  font-family: inherit;
  font-size: 12px;
  font-weight: bold;
  color: #4b5262;
  cursor: pointer;
  transition: background-color 0.1s ease;
}

.nav-tab:hover {
  background-color: #cbd5e1;
  color: #2b4c7e;
}

.nav-tab.active {
  background-color: #ffffff;
  border-bottom: 1.5px solid #ffffff;
  margin-bottom: -1px;
  color: #2b4c7e;
  position: relative;
  z-index: 10;
}

/* Main Content Panel */
.main-content {
  padding: 0;
}

h2 {
  font-size: 19px;
  color: #2b4c7e;
  margin-bottom: 12px;
  border-bottom: 2px solid #e2e8f0;
  padding-bottom: 6px;
}

.description {
  font-size: 12px;
  color: #5b6575;
  margin-bottom: 20px;
}

/* Data Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 24px;
}

.data-table th, .data-table td {
  border: 1px solid #dcdfe6;
  padding: 12px;
  text-align: left;
  font-size: 12px;
}

.data-table th {
  background-color: #f4f7fa;
  color: #2b4c7e;
  font-weight: bold;
}

.data-table tbody tr:nth-child(even) {
  background-color: #fafbfc;
}

.word-break {
  word-break: break-all;
}

.accent-text {
  color: #2b4c7e;
  font-weight: bold;
}

/* Content Panels and Spacing */
.quick-start-box, .instructions-box, .picker-panel, .control-box {
  background-color: #f7fafc;
  border: 1px solid #e2e8f0;
  border-top: 3px solid #2b4c7e;
  padding: 20px;
  margin-bottom: 24px;
}

.quick-start-box h3, .instructions-box h3, .picker-panel h3, .control-box h3 {
  font-size: 14px;
  color: #2b4c7e;
  margin-bottom: 12px;
  font-weight: bold;
}

.quick-start-box ul, .instructions-box ol {
  padding-left: 20px;
}

.quick-start-box li, .instructions-box li {
  margin-bottom: 8px;
  font-size: 12px;
}

/* Buttons */
.btn-action {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  color: #4a5568;
  padding: 8px 18px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-action:hover:not(:disabled) {
  background-color: #f1f5f9;
  border-color: #94a3b8;
}

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

.btn-action.primary {
  background-color: #2b4c7e;
  border-color: #1d3557;
  color: #ffffff;
}

.btn-action.primary:hover:not(:disabled) {
  background-color: #1d3557;
}

.btn-action.danger {
  background-color: #ef4444;
  border-color: #dc2626;
  color: #ffffff;
}

.btn-action.danger:hover:not(:disabled) {
  background-color: #dc2626;
}

.button-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.param-row {
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.progress-bar-bg {
  width: 100%;
  height: 22px;
  background-color: #e2e8f0;
  border: 1px solid #cbd5e1;
  margin-top: 14px;
  margin-bottom: 12px;
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background-color: #10b981;
}

.status-output {
  font-family: monospace;
  font-size: 11px;
  color: #1d3557;
  background-color: #f1f5f9;
  border-left: 4px solid #2b4c7e;
  padding: 12px;
}

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

.result-card {
  border: 1px solid #e2e8f0;
  border-top: 2px solid #2b4c7e;
  background-color: #ffffff;
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-label {
  font-size: 10px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: bold;
  margin-bottom: 6px;
}

.card-val {
  font-size: 22px;
  font-weight: bold;
  color: #2b4c7e;
}

/* Input Specific styles */
.keyboard-matrix-container {
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 12px;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-x: auto;
}

.keyboard-row {
  display: flex;
  gap: 4px;
  justify-content: flex-start;
  white-space: nowrap;
}

.key-cap {
  display: inline-block;
  width: 44px;
  height: 40px;
  background-color: #ffffff;
  border: 1px solid #94a3b8;
  border-radius: 4px;
  text-align: center;
  line-height: 38px;
  font-size: 11px;
  font-weight: bold;
  color: #334155;
  cursor: default;
  user-select: none;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
  transition: all 0.05s ease;
}

.key-cap.wide { width: 80px; }
.key-cap.wider { width: 100px; }
.key-cap.widest { width: 130px; }
.key-cap.spacebar { flex-grow: 1; min-width: 280px; }

.key-cap.pressed {
  background-color: #10b981;
  color: #ffffff;
  border-color: #059669;
  transform: translateY(1px);
  box-shadow: none;
}

#mouse-tracking-target {
  width: 100%;
  height: 140px;
  border: 2px dashed #cbd5e1;
  background-color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-weight: bold;
  font-family: monospace;
  cursor: crosshair;
  user-select: none;
}

/* Audio Suite Canvas */
.canvas-frame {
  background-color: #0f172a;
  border: 1px solid #cbd5e1;
  padding: 4px;
}

/* Color selection rows */
.preset-colors {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.color-btn {
  border: 1px solid #cbd5e1;
  padding: 10px 20px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
}

.color-btn.white { background-color: #ffffff; color: #000; }
.color-btn.black { background-color: #000000; color: #fff; }
.color-btn.red { background-color: #ff0000; color: #fff; }
.color-btn.green { background-color: #00ff00; color: #000; }
.color-btn.blue { background-color: #0000ff; color: #fff; }

.custom-color-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.custom-color-row input[type="color"] {
  border: 1px solid #cbd5e1;
  background: none;
  cursor: pointer;
  width: 36px;
  height: 36px;
}

.custom-color-row input[type="text"] {
  padding: 8px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
}

/* Fullscreen Panels Overlay */
.fullscreen-panel {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 9999;
}

.display-overlay-hud, .touch-hud {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(15, 23, 42, 0.95);
  border: 1px solid #475569;
  color: #ffffff;
  padding: 8px 20px;
  font-size: 11px;
  font-weight: bold;
  pointer-events: none;
  z-index: 10005;
}

.touch-hud {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}

.hud-close-btn {
  background-color: #ef4444;
  color: #ffffff;
  border: none;
  padding: 3px 10px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
}

#touch-grid-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: grid;
  z-index: 9999;
  pointer-events: none;
  background-color: #0b0f19;
}

.touch-cell {
  border: 1.5px solid rgba(255, 255, 255, 0.16) !important;
  box-sizing: border-box;
}

.touch-cell.touched {
  background-color: rgba(16, 185, 129, 0.55) !important;
  border-color: rgba(16, 185, 129, 0.7) !important;
}

#touch-paint-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  cursor: crosshair;
}

/* Backlight Bleed guide lines */
.bleed-guide-line {
  position: absolute;
  background-color: rgba(255, 255, 255, 0.08);
}
.bleed-guide-line.horizontal {
  left: 0;
  width: 100%;
  height: 1px;
}
.bleed-guide-line.vertical {
  top: 0;
  width: 1px;
  height: 100%;
}

/* Panel Response Chasing block */
.ghosting-track {
  position: absolute;
  left: 0;
  width: 100%;
  height: 80px;
  background-color: #1e293b;
  border-top: 2px solid #334155;
  border-bottom: 2px solid #334155;
}

.ghosting-ufo {
  position: absolute;
  top: 15px;
  left: 0;
  width: 50px;
  height: 50px;
  background-color: #22c55e;
  box-shadow: 0 0 12px #22c55e;
}

.ghosting-ufo.light {
  background-color: #3b82f6;
  box-shadow: 0 0 12px #3b82f6;
}

.ghosting-hud-speed {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffffff;
  background-color: rgba(15, 23, 42, 0.9);
  border: 1px solid #475569;
  padding: 6px 16px;
  font-size: 11px;
  font-weight: bold;
}

/* Tab visibility rules */
.tab-content {
  display: none !important;
}

.tab-content.active {
  display: block !important;
}

/* Footer layout */
.site-footer {
  border-top: 1px solid #e2e8f0;
  padding-top: 16px;
  margin-top: 32px;
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
}

/* Responsive details */
@media (max-width: 768px) {
  .page-container {
    margin: 0;
    border: none;
    box-shadow: none;
    padding: 12px;
  }
  .results-grid {
    grid-template-columns: 1fr !important;
  }
  .button-row {
    flex-direction: column;
  }
  .nav-bar {
    flex-wrap: wrap;
  }
  .nav-tab {
    flex-grow: 1;
    text-align: center;
  }
}
