/* EMS Entropy Testing Dashboard Styles */

:root {
  --yellow: #FFFF00;
  --red: #fc2848;
  --maroon: #a52848;
  --black: #000;
  --dark-gray: #111;
  --light-gray: #222;
  --green: #00ff88;
  --cyan: #0ff;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, var(--black) 0%, var(--dark-gray) 50%, var(--light-gray) 100%);
  color: #ffffff;
  line-height: 1.6;
  min-height: 100vh;
  padding: 20px;
}

.header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(102, 126, 234, 0.1);
  box-shadow: 0 4px 30px rgba(102, 126, 234, 0.1);
  margin-bottom: 2rem;
  border-radius: 1rem;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 4rem;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.logo-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  overflow: hidden;
}

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.ems-badge {
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 2px solid rgba(102, 126, 234, 0.3);
  font-weight: 600;
  color: #667eea;
  font-size: 1.2rem;
}

.nav-links {
  display: flex;
  gap: 1rem;
}

.nav-btn {
  background: linear-gradient(135deg, var(--yellow) 0%, var(--red) 100%);
  color: var(--black);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 255, 0, 0.3);
}

.dashboard {
  max-width: 1400px;
  margin: 0 auto;
  display: grid;
  gap: 2rem;
  grid-template-columns: 1fr 1fr;
}

.main-panel {
  grid-column: 1 / -1;
}

.panel {
  background: linear-gradient(135deg, rgba(17, 17, 17, 0.95) 0%, rgba(34, 34, 34, 0.9) 100%);
  backdrop-filter: blur(10px);
  border-radius: 1rem;
  box-shadow: 0 8px 32px 0 rgba(252, 40, 72, 0.15);
  border: 1px solid rgba(255, 255, 0, 0.2);
  padding: 2rem;
  transition: all 0.3s ease;
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px 0 rgba(252, 40, 72, 0.25);
  border-color: rgba(252, 40, 72, 0.4);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(252, 40, 72, 0.3);
}

.panel-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--yellow);
  background: linear-gradient(90deg, var(--yellow), var(--red));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.confidence-badge {
  background: rgba(0, 255, 136, 0.2);
  color: var(--green);
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.confidence-badge.medium {
  background: rgba(255, 255, 0, 0.2);
  color: var(--yellow);
  border-color: rgba(255, 255, 0, 0.3);
}

.confidence-badge.low {
  background: rgba(252, 40, 72, 0.2);
  color: var(--red);
  border-color: rgba(252, 40, 72, 0.3);
}

/* Heatmap Integration Styles */
.heatmap-controls {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  align-items: center;
}

.heatmap-controls label {
  color: var(--yellow);
  font-weight: bold;
}

.heatmap-controls select {
  padding: 0.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.25rem;
}

.heatmap-container {
  background: rgba(0, 0, 0, 0.5);
  border-radius: 0.5rem;
  padding: 1rem;
  margin: 1rem 0;
  border: 1px solid #333;
  text-align: center;
}

.heatmap-container h4 {
  color: var(--cyan);
  margin-bottom: 1rem;
}

.heatmap-canvas-wrapper {
  overflow: auto;
  max-height: 400px;
  border: 1px solid #444;
  border-radius: 0.25rem;
  background: #0a0a0a;
  padding: 0.5rem;
  margin: 1rem 0;
}

#liveHeatmapCanvas {
  border: 1px solid var(--green);
  image-rendering: pixelated;
  transition: transform 0.3s ease;
  min-width: 300px;
  min-height: 300px;
}

.zoom-controls {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
  align-items: center;
}

.zoom-btn {
  padding: 0.25rem 0.5rem;
  background: rgba(0, 255, 136, 0.2);
  color: var(--green);
  border: 1px solid rgba(0, 255, 136, 0.3);
  border-radius: 0.25rem;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}

.zoom-btn:hover {
  background: rgba(0, 255, 136, 0.3);
}

.zoom-info {
  color: #ccc;
  margin-left: 1rem;
  font-size: 0.9rem;
}

.heatmap-status {
  color: var(--yellow);
  margin-top: 1rem;
  font-style: italic;
}

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

.stat-item {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.75rem;
  border-radius: 0.25rem;
  text-align: center;
  border: 1px solid #333;
}

.stat-value {
  display: block;
  font-weight: bold;
  color: var(--green);
  font-size: 1.1rem;
}

.stat-label {
  font-size: 0.8rem;
  color: #ccc;
  text-transform: uppercase;
}

/* Quality meter and existing styles */
.quality-meter-container {
  margin-bottom: 2rem;
}

.quality-meter {
  position: relative;
  background: #2c2c2c;
  border-radius: 15px;
  height: 40px;
  overflow: hidden;
  margin: 1rem 0;
  border: 2px solid rgba(255, 255, 0, 0.3);
}

.quality-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green) 0%, var(--yellow) 50%, var(--red) 100%);
  border-radius: 13px;
  transition: width 0.8s ease;
  position: relative;
  overflow: hidden;
}

.quality-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

.quality-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

.quality-score {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--green);
  text-shadow: 0 0 10px rgba(0, 255, 136, 0.3);
}

.quality-trend {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--green);
}

.data-requirements {
  background: rgba(255, 255, 0, 0.1);
  border: 1px solid rgba(255, 255, 0, 0.2);
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
}

.data-requirements h4 {
  color: var(--yellow);
  margin-bottom: 0.5rem;
}

.data-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.5rem;
}

.data-bar {
  flex: 1;
  height: 8px;
  background: #444;
  border-radius: 4px;
  margin-right: 1rem;
  overflow: hidden;
}

.data-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--yellow), var(--green));
  border-radius: 4px;
  transition: width 0.5s ease;
}

.test-grid {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.test-grid th,
.test-grid td {
  border: 1px solid #444;
  padding: 0.75rem;
  text-align: left;
}

.test-grid th {
  background: rgba(0, 0, 0, 0.5);
  color: var(--yellow);
  font-weight: 600;
}

.test-grid tr:hover {
  background: rgba(255, 255, 0, 0.05);
}

.test-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.test-status.passed { color: var(--green); }
.test-status.warning { color: var(--yellow); }
.test-status.failed { color: var(--red); }
.test-status.insufficient { color: #888; }

.overall-assessment {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 0, 0.1);
  border-radius: 0.5rem;
}

.pattern-visualization {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0.5rem;
  padding: 1.5rem;
  margin-top: 1rem;
  border: 1px solid #333;
}

.pattern-visualization h4 {
  color: var(--cyan);
  margin-bottom: 1rem;
}

.pattern-display {
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.4;
  color: var(--green);
  background: rgba(0, 0, 0, 0.5);
  padding: 1rem;
  border-radius: 0.25rem;
  border: 1px solid #333;
  white-space: pre;
  overflow-x: auto;
}

.pattern-analysis {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(0, 255, 136, 0.1);
  border-radius: 0.25rem;
  border: 1px solid rgba(0, 255, 136, 0.2);
}

.source-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.source-card {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 0.5rem;
  padding: 1rem;
  border: 1px solid #333;
  text-align: center;
}

.source-name {
  color: var(--cyan);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.source-grade {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0.5rem 0;
}

.source-grade.a-plus { color: var(--green); }
.source-grade.a { color: var(--yellow); }
.source-grade.a-minus { color: #ffa500; }

.source-desc {
  font-size: 0.8rem;
  color: #888;
}

.crypto-assessment {
  margin-top: 1.5rem;
  padding: 1rem;
  background: rgba(0, 255, 136, 0.1);
  border-radius: 0.5rem;
}

.controls, .result-controls {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
  flex-wrap: wrap;
  justify-content: space-between;
}

.btn {
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--yellow) 0%, var(--red) 100%);
  color: var(--black);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-success {
  background: linear-gradient(135deg, var(--green) 0%, #00aa66 100%);
 color: var(--black);
 font-weight: bold;
}

.btn:hover {
 transform: translateY(-2px);
 box-shadow: 0 8px 25px rgba(255, 255, 0, 0.3);
}

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

.advanced-toggle {
 color: var(--cyan);
 cursor: pointer;
 margin-top: 1rem;
 padding: 0.5rem;
 border-radius: 0.25rem;
 transition: all 0.3s ease;
 display: inline-block;
}

.advanced-toggle:hover {
 background: rgba(0, 255, 255, 0.1);
 transform: translateX(5px);
}

.advanced-section {
 display: none;
 margin-top: 1rem;
 background: rgba(0, 0, 0, 0.3);
 padding: 1rem;
 border-radius: 0.5rem;
 border: 1px solid #333;
}

.advanced-section.show {
 display: block;
 animation: slideDown 0.3s ease;
}

@keyframes slideDown {
 from { opacity: 0; transform: translateY(-10px); }
 to { opacity: 1; transform: translateY(0); }
}

.entropy-type {
 margin-top: 1rem;
 font-style: italic;
 color: #999;
 padding: 0.5rem;
 background: rgba(255, 255, 255, 0.05);
 border-radius: 0.25rem;
}

.data-input {
 margin-top: 2rem;
 padding: 1.5rem;
 background: rgba(0, 0, 0, 0.3);
 border-radius: 0.5rem;
 border: 2px dashed rgba(255, 255, 0, 0.3);
}

.data-input h4 {
 color: var(--yellow);
 margin-bottom: 0.5rem;
}

.file-input {
 width: 100%;
 padding: 1rem;
 background: rgba(255, 255, 255, 0.1);
 border: 1px solid rgba(255, 255, 255, 0.2);
 border-radius: 0.5rem;
 color: #ffffff;
 margin-top: 1rem;
}

.file-input::file-selector-button {
 background: linear-gradient(135deg, var(--yellow) 0%, var(--red) 100%);
 color: var(--black);
 border: none;
 padding: 0.5rem 1rem;
 border-radius: 0.25rem;
 margin-right: 1rem;
 cursor: pointer;
}

@media (max-width: 768px) {
 .dashboard {
   grid-template-columns: 1fr;
 }
 
 .header-content {
   flex-direction: column;
   height: auto;
   padding: 1rem;
   gap: 1rem;
 }

 .controls, .heatmap-controls {
   flex-direction: column;
 }

 .source-comparison {
   grid-template-columns: 1fr;
 }

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

 .zoom-controls {
   flex-wrap: wrap;
   justify-content: center;
 }
}
