/* ═══════════════════════════════════════════════════════════════
   Diagnostics Modal Styles
   ═══════════════════════════════════════════════════════════════ */

.diagnostics-modal {
  max-width: 800px !important;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

/* Controls */
.diag-controls {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #2a2a3a);
  background: var(--bg-secondary, rgba(255, 255, 255, 0.02));
}

.diag-control-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.diag-label {
  font-size: 13px;
  color: var(--text-muted, #999);
  font-weight: 600;
}

.diag-select {
  flex: 1;
  min-width: 150px;
  padding: 8px 12px;
  background: var(--bg-input, #0a0e1a);
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 6px;
  color: var(--text, #fff);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}

.diag-select:focus {
  border-color: var(--accent-primary, #4a9eff);
}

.diag-help {
  font-size: 12px;
  color: var(--text-muted, #999);
  margin-top: 8px;
  line-height: 1.5;
}

/* Body */
.diag-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.diag-placeholder {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted, #999);
  font-size: 14px;
}

.diag-running {
  text-align: center;
  padding: 40px 20px;
  color: var(--accent-primary, #4a9eff);
  font-size: 14px;
  animation: diag-pulse 1.5s ease-in-out infinite;
}

@keyframes diag-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Spinner */
.diag-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: diag-spin 0.6s linear infinite;
  margin-left: 6px;
  vertical-align: middle;
}

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

/* Summary */
.diag-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.diag-summary-card {
  text-align: center;
  padding: 14px 8px;
  border-radius: 8px;
  border: 1px solid var(--border, #2a2a3a);
  background: var(--bg-secondary, rgba(255,255,255,0.02));
}

.diag-summary-card.pass {
  border-color: rgba(72, 187, 120, 0.3);
  background: rgba(72, 187, 120, 0.05);
}

.diag-summary-card.fail {
  border-color: rgba(245, 101, 101, 0.3);
  background: rgba(245, 101, 101, 0.05);
}

.diag-summary-card.warn {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.05);
}

.diag-summary-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--text, #fff);
  margin-bottom: 4px;
}

.diag-summary-card.pass .diag-summary-num { color: #48bb78; }
.diag-summary-card.fail .diag-summary-num { color: #f56565; }
.diag-summary-card.warn .diag-summary-num { color: #fbbf24; }

.diag-summary-label {
  font-size: 11px;
  color: var(--text-muted, #999);
}

/* Symbol info bar */
.diag-symbol-info {
  font-size: 12px;
  color: var(--text-muted, #999);
  padding: 8px 12px;
  background: var(--bg-secondary, rgba(255,255,255,0.02));
  border-radius: 6px;
  margin-bottom: 12px;
  border: 1px solid var(--border, #2a2a3a);
}

.diag-symbol-info strong {
  color: var(--text, #fff);
}

/* Tests */
.diag-tests {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diag-test {
  background: var(--bg-secondary, rgba(255, 255, 255, 0.02));
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.diag-test-pass {
  border-left: 3px solid #48bb78;
}

.diag-test-fail {
  border-left: 3px solid #f56565;
  background: rgba(245, 101, 101, 0.03);
}

.diag-test-warn {
  border-left: 3px solid #fbbf24;
  background: rgba(251, 191, 36, 0.03);
}

.diag-test-skip {
  border-left: 3px solid #6b7280;
  opacity: 0.6;
}

.diag-test-header {
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border, rgba(255,255,255,0.05));
  background: var(--bg-card-solid, rgba(255,255,255,0.02));
}

.diag-test-status {
  font-size: 16px;
  flex-shrink: 0;
}

.diag-test-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #fff);
}

.diag-test-body {
  padding: 8px 14px 12px;
}

.diag-test-detail {
  font-size: 12px;
  color: var(--text-muted, #ccc);
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  padding: 3px 0 3px 24px;
  position: relative;
  word-break: break-word;
  line-height: 1.5;
}

.diag-test-detail::before {
  content: '•';
  position: absolute;
  right: 8px;
  color: var(--accent-primary, #4a9eff);
}

/* Action buttons */
.diag-result-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border, #2a2a3a);
  flex-wrap: wrap;
}

.diag-btn {
  padding: 8px 16px;
  border: 1px solid var(--border, #2a2a3a);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.diag-btn-primary {
  background: var(--accent-primary, #4a9eff);
  color: white;
  border-color: var(--accent-primary, #4a9eff);
}

.diag-btn-primary:hover:not(:disabled) {
  background: var(--accent-primary-hover, #3a8eef);
  transform: translateY(-1px);
}

.diag-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.diag-btn-secondary {
  background: var(--bg-secondary, #1a1a2a);
  color: var(--text, #fff);
}

.diag-btn-secondary:hover {
  background: var(--bg-hover, #252535);
}

/* ═══ Mobile responsive ═══ */
@media (max-width: 768px) {
  .diagnostics-modal {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  
  .diag-controls {
    padding: 12px 14px;
  }
  
  .diag-control-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .diag-select {
    width: 100% !important;
    font-size: 16px !important;  /* prevent iOS zoom */
  }
  
  .diag-btn-primary {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
  
  .diag-body {
    padding: 12px;
  }
  
  .diag-summary {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .diag-summary-num {
    font-size: 20px;
  }
  
  .diag-test-detail {
    font-size: 11px;
    padding-right: 18px;
  }
  
  .diag-result-actions {
    flex-direction: column;
  }
  
  .diag-btn {
    width: 100%;
    justify-content: center;
    min-height: 40px;
  }
}
