/**
 * GigHz Precision Styles
 */

/* v12.21.34 — Inter self-hosted (was Google Fonts CDN in v12.21.33).
 * Faster first paint: one local woff2 (~47KB) for all weights vs four
 * separate requests across the network. Also removes external dependency —
 * one less request from a clinical app, and a cleaner HIPAA story for any
 * future audit (no third-party CDN call to render the UI).
 *
 * The file is a Inter variable font (latin subset, weights 100-900 in a
 * single binary). font-display: swap shows the system fallback instantly
 * while the local woff2 paints — no flash of invisible text.
 */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900; /* variable font — supports the full range */
  font-display: swap;
  src: url('fonts/inter-variable.woff2') format('woff2-variations'),
       url('fonts/inter-variable.woff2') format('woff2');
}

/* Apply Inter inside the app container — leaves the rest of the host site
 * unaffected. Everything that uses `fontFamily: 'inherit'` in inline React
 * styles picks this up automatically. */
.radreport-container,
.radreport-container * {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Keep monospace where it's intentionally chosen (column-aligned dictation /
 * report views). Monospace is the radiologist convention for these surfaces. */
.radreport-container [style*="monospace"],
.radreport-container [style*="Courier"],
.radreport-container pre,
.radreport-container code {
  font-family: 'JetBrains Mono', 'Cascadia Mono', Consolas, 'Courier New', monospace !important;
}

/* Animations */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.02); }
}

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

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; visibility: hidden; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes loadingBar {
  from { width: 0%; }
  to { width: 100%; }
}

@keyframes blinkDisclaimer {
  0%, 100% { background-color: #dc2626; transform: scale(1); }
  50% { background-color: #f97316; transform: scale(1.05); }
}

.blink-disclaimer {
  animation: blinkDisclaimer 0.3s ease-in-out 5;
}

/* Base */
.radreport-container {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.radreport-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
  color: #888;
  font-size: 14px;
}

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

::-webkit-scrollbar-track {
  background: #1a1a1a;
}

::-webkit-scrollbar-thumb {
  background: #4a4a4a;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #5a5a5a;
}

/* Selections */
::selection {
  background: #d4af37;
  color: #1a1a1a;
}

/* Focus states */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: #d4af37 !important;
  box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

/* Button hover states */
button:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

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

/* Transitions */
button, input, select, textarea {
  transition: all 0.15s ease;
}

/* Report highlighting */
.highlight-positive {
  background-color: rgba(234, 179, 8, 0.3);
  padding: 0 2px;
  border-radius: 2px;
}

.highlight-recommendation {
  background-color: rgba(59, 130, 246, 0.3);
  padding: 0 2px;
  border-radius: 2px;
}

/* Quality score animation */
.quality-score-enter {
  animation: fadeIn 0.3s ease;
}

/* Recording pulse */
.recording-indicator {
  animation: pulse 1s infinite;
}

/* Responsive */
@media (max-width: 1200px) {
  .radreport-container > div:nth-child(2) {
    grid-template-columns: 280px 1fr !important;
  }
  .radreport-container > div:nth-child(2) > div:last-child {
    display: none;
  }
}

@media (max-width: 900px) {
  .radreport-container > div:nth-child(2) {
    grid-template-columns: 1fr !important;
  }
}

/* Print styles */
@media print {
  .radreport-container {
    background: white !important;
    color: black !important;
  }
  
  button, .voice-controls, .sidebar {
    display: none !important;
  }
  
  .report-output {
    border: 1px solid #ccc !important;
  }
}

/* Macro category badges */
.macro-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 9px;
  text-transform: uppercase;
  font-weight: bold;
}

.macro-badge-criteria { background: #3b82f6; color: white; }
.macro-badge-normal { background: #22c55e; color: white; }
.macro-badge-ir { background: #a855f7; color: white; }
.macro-badge-recommendation { background: #f59e0b; color: white; }
.macro-badge-personal { background: #d4af37; color: #1a1a1a; }

/* Tooltip */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #2a2a2a;
  color: #e5e5e5;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 100;
}

.tooltip:hover::after {
  opacity: 1;
}

/* Stats number animation */
.stat-number {
  transition: transform 0.3s ease;
}

.stat-number:hover {
  transform: scale(1.1);
}

/* Streak fire animation */
.streak-fire {
  display: inline-block;
  animation: bounce 1s ease infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

/* ========== DEMO FULLWIDTH FIX ========== */
/* When demo is inside a theme's narrow container, break out to full width */
/* This works even without the fullwidth-demo.php template */

#radreport-demo-container {
  /* Break out of parent container */
  width: 100vw !important;
  max-width: 100vw !important;
  position: relative !important;
  left: 50% !important;
  right: 50% !important;
  margin-left: -50vw !important;
  margin-right: -50vw !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  background: #1a1a1a !important;
}

/* Ensure the React app inside fills the container */
#radreport-demo-container #radreport-root {
  width: 100% !important;
  max-width: none !important;
}

/* When using the fullwidth template, these aren't needed but won't hurt */
body.radreport-demo-page #radreport-demo-container {
  left: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

