/* Sign&Connect AI - Blue & White Modern Design System */

:root {
  --bg-main: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --border-subtle: #e2e8f0;
  --border-focus: #3b82f6;

  --text-heading: #0f172a;
  --text-body: #334155;
  --text-muted: #64748b;
  --text-brand: #2563eb;

  --primary-blue: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  
  --accent-cyan: #0284c7;
  --accent-sky: #38bdf8;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

  --font-scale: 1;
}

/* High Contrast Mode Overrides */
body.high-contrast {
  --bg-main: #000000;
  --bg-surface: #121212;
  --bg-subtle: #1e1e1e;
  --border-subtle: #ffff00;
  --border-focus: #ffff00;

  --text-heading: #ffffff;
  --text-body: #ffffff;
  --text-muted: #ffff00;
  --text-brand: #ffff00;

  --primary-blue: #ffff00;
  --primary-hover: #e6e600;
  --primary-light: #333300;

  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --shadow-xl: none;
}

body {
  background-color: var(--bg-main);
  color: var(--text-body);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-size: calc(1rem * var(--font-scale));
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-subtle);
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Card & Surface Tokens */
.card-surface {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-md);
  border-radius: 1.25rem;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-surface:hover {
  box-shadow: var(--shadow-lg);
}

.high-contrast .card-surface {
  border: 2px solid #ffff00 !important;
}

/* Live Layout Grid & Responsive Columns */
.live-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.9fr);
  gap: 24px;
  align-items: start;
}

.live-layout > * {
  min-width: 0;
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .live-layout {
    grid-template-columns: 1fr;
  }
}

/* Camera Viewport & Stream Styling */
.camera-box, .camera-viewport {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #0f172a;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transform: scaleX(-1);
}

.camera-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  transform: scaleX(-1);
}

/* Scanning Overlay Animation */
.scan-line {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--primary-blue), transparent);
  box-shadow: 0 0 15px var(--primary-blue);
  animation: scan 2.5s infinite ease-in-out;
  pointer-events: none;
}

@keyframes scan {
  0% { top: 0%; opacity: 0.2; }
  50% { top: 95%; opacity: 1; }
  100% { top: 0%; opacity: 0.2; }
}

/* Rec Indicator Pulse */
.pulse-rec {
  animation: pulseRec 1.5s infinite;
}

@keyframes pulseRec {
  0% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; font-size: 0.95em; }
  100% { opacity: 1; transform: scale(1); }
}

/* Concept Cards Stepper Highlight */
.concept-card-item {
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.concept-card-item:hover {
  transform: translateY(-4px);
}

.concept-card-item.active-step {
  border-color: #2563eb;
  background-color: #eff6ff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.high-contrast .concept-card-item.active-step {
  background-color: #ffff00 !important;
  color: #000000 !important;
}

/* High Contrast Button Overrides */
.high-contrast button {
  border: 1px solid #ffff00 !important;
}

.high-contrast button:hover {
  background-color: #ffff00 !important;
  color: #000000 !important;
}

/* AI Sign Tutor Visual Avatar Glowing & Motion Animations */
@keyframes handPulse {
  0% { transform: scale(1); filter: drop-shadow(0 0 4px #38bdf8); }
  50% { transform: scale(1.08); filter: drop-shadow(0 0 10px #06b6d4); }
  100% { transform: scale(1); filter: drop-shadow(0 0 4px #38bdf8); }
}

.tutor-hand-active {
  animation: handPulse 2s infinite ease-in-out;
}

@keyframes arrowDash {
  to {
    stroke-dashoffset: -20;
  }
}

.tutor-arrow-animated {
  animation: arrowDash 1.5s linear infinite;
}

