/* ═══════════════════════════════════════════════════
   SignAI — Premium Sign Language Translator
   Design System & Stylesheet
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Syne:wght@400;500;600;700;800&family=DM+Mono:wght@300;400;500&display=swap');

/* ─── CSS VARIABLES ─────────────────────────────── */
:root {
  --bg-void:       #03040a;
  --bg-deep:       #070b14;
  --bg-surface:    #0d1220;
  --bg-glass:      rgba(13, 18, 32, 0.65);
  --bg-card:       rgba(255, 255, 255, 0.03);

  --accent-cyan:   #00e5ff;
  --accent-blue:   #3b82f6;
  --accent-purple: #7c3aed;
  --accent-pink:   #ec4899;
  --accent-green:  #10b981;
  --accent-red:    #ef4444;
  --accent-amber:  #f59e0b;

  --text-primary:  #f0f4ff;
  --text-secondary:#8b99b8;
  --text-muted:    #4a5568;
  --text-accent:   #00e5ff;

  --border-subtle: rgba(0, 229, 255, 0.08);
  --border-glow:   rgba(0, 229, 255, 0.25);
  --border-card:   rgba(255, 255, 255, 0.06);

  --shadow-glow:   0 0 40px rgba(0, 229, 255, 0.15);
  --shadow-deep:   0 25px 80px rgba(0, 0, 0, 0.8);
  --shadow-card:   0 8px 32px rgba(0, 0, 0, 0.5);

  --font-display:  'Bebas Neue', sans-serif;
  --font-body:     'Syne', sans-serif;
  --font-mono:     'DM Mono', monospace;

  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-lg:     20px;
  --radius-xl:     28px;

  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:   cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-cinematic:cubic-bezier(0.77, 0, 0.175, 1);
}

/* ─── RESET ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg-void);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  cursor: default;
}

/* ─── THREE.JS CANVAS ───────────────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ─── APP WRAPPER ───────────────────────────────── */
#root {
  position: relative;
  z-index: 1;
}

/* ─── SCROLLBAR ─────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg-void); }
::-webkit-scrollbar-thumb { background: var(--accent-blue); border-radius: 4px; }

/* ══════════════════════════════════════════════════
   SPLASH SCREEN
   ══════════════════════════════════════════════════ */
.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-void);
  transition: opacity 0.8s var(--ease-cinematic), transform 0.8s var(--ease-cinematic);
}

.splash.hiding {
  opacity: 0;
  transform: scale(1.05);
  pointer-events: none;
}

.splash-logo {
  position: relative;
  margin-bottom: 24px;
}

.splash-logo-ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 2px solid transparent;
  background: linear-gradient(var(--bg-void), var(--bg-void)) padding-box,
              linear-gradient(135deg, var(--accent-cyan), var(--accent-purple)) border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: ringPulse 2s ease-in-out infinite;
  position: relative;
}

.splash-logo-ring::after {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1px solid var(--accent-cyan);
  opacity: 0.2;
  animation: ringExpand 2s ease-out infinite;
}

.splash-logo-inner {
  font-size: 40px;
  line-height: 1;
}

.splash-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 80px);
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #fff 0%, var(--accent-cyan) 50%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fadeUp 0.6s var(--ease-out-expo) 0.2s both;
}

.splash-tagline {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-top: 8px;
  animation: fadeUp 0.6s var(--ease-out-expo) 0.35s both;
}

.splash-loader {
  margin-top: 48px;
  width: 200px;
  animation: fadeUp 0.6s var(--ease-out-expo) 0.5s both;
}

.splash-loader-bar {
  height: 2px;
  background: var(--bg-surface);
  border-radius: 2px;
  overflow: hidden;
}

.splash-loader-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 2px;
  animation: loadFill 2s var(--ease-cinematic) 0.6s both;
}

.splash-loader-text {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
  text-align: center;
  letter-spacing: 0.1em;
}

/* ══════════════════════════════════════════════════
   NAVIGATION
   ══════════════════════════════════════════════════ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to bottom, rgba(3,4,10,0.9) 0%, transparent 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-brand-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.nav-brand-name {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.1em;
  background: linear-gradient(135deg, #fff, var(--accent-cyan));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  font-family: var(--font-body);
  letter-spacing: 0.02em;
}

.nav-link:hover, .nav-link.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-link.active {
  color: var(--accent-cyan);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: var(--font-mono);
}

.nav-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.3s;
}

.nav-status-dot.active {
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 1.5s ease-in-out infinite;
}

/* ══════════════════════════════════════════════════
   MAIN LAYOUT
   ══════════════════════════════════════════════════ */
.main-app {
  min-height: 100vh;
  padding-top: 80px;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── HERO SECTION ──────────────────────────────── */
.hero {
  padding: 60px 0 40px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 100px;
  border: 1px solid var(--border-glow);
  background: rgba(0, 229, 255, 0.05);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-cyan);
  margin-bottom: 24px;
}

.hero-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-cyan);
  animation: pulse 1.5s infinite;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(52px, 8vw, 100px);
  line-height: 0.9;
  letter-spacing: 0.05em;
  margin-bottom: 20px;
}

.hero-title-line1 {
  display: block;
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title-line2 {
  display: block;
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── GRID LAYOUT ─────────────────────────────────── */
.workspace {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 20px;
  padding: 0 0 40px;
}

@media (max-width: 1024px) {
  .workspace {
    grid-template-columns: 1fr;
  }
}

/* ══════════════════════════════════════════════════
   GLASS CARD
   ══════════════════════════════════════════════════ */
.glass-card {
  background: var(--bg-glass);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-xl);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  overflow: hidden;
  position: relative;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.glass-card:hover {
  border-color: var(--border-subtle);
}

.glass-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, transparent 60%);
  pointer-events: none;
}

.glass-card.glow-active {
  border-color: var(--border-glow);
  box-shadow: var(--shadow-glow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-card);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.card-title-icon {
  font-size: 16px;
}

/* ══════════════════════════════════════════════════
   CAMERA SECTION
   ══════════════════════════════════════════════════ */
.camera-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.camera-viewport {
  position: relative;
  aspect-ratio: 4/3;
  background: #000;
  overflow: hidden;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-card);
}

.camera-viewport.active {
  border-color: var(--border-glow);
  box-shadow: 0 0 0 1px var(--border-glow), var(--shadow-glow);
}

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

.camera-overlay-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: scaleX(-1);
}

/* Camera placeholder */
.camera-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: radial-gradient(ellipse at center, rgba(59,130,246,0.08) 0%, transparent 70%);
}

.camera-placeholder-icon {
  font-size: 64px;
  opacity: 0.3;
  animation: floatY 3s ease-in-out infinite;
}

.camera-placeholder-text {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Camera corner borders */
.camera-corners {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--accent-cyan);
  border-style: solid;
  opacity: 0;
  transition: opacity 0.4s;
}

.camera-viewport.active .corner { opacity: 1; }

.corner-tl { top: 16px; left: 16px; border-width: 2px 0 0 2px; border-radius: 4px 0 0 0; }
.corner-tr { top: 16px; right: 16px; border-width: 2px 2px 0 0; border-radius: 0 4px 0 0; }
.corner-bl { bottom: 16px; left: 16px; border-width: 0 0 2px 2px; border-radius: 0 0 0 4px; }
.corner-br { bottom: 16px; right: 16px; border-width: 0 2px 2px 0; border-radius: 0 0 4px 0; }

/* Recording indicator */
.rec-indicator {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  color: var(--accent-green);
  font-family: var(--font-mono);
  opacity: 0;
  transition: opacity 0.3s;
}

.rec-indicator.visible { opacity: 1; }

.rec-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: pulse 1s infinite;
}

/* Gesture overlay */
.gesture-hint {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  background: rgba(0,0,0,0.75);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  font-family: var(--font-mono);
  opacity: 0;
  transition: opacity 0.3s;
}

.gesture-hint.visible { opacity: 1; }

/* ─── Camera Controls ───────────────────────────── */
.camera-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease-out-expo);
  position: relative;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  user-select: none;
}

.btn:active { transform: scale(0.96); }

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background 0.2s;
}

.btn:hover::after { background: rgba(255,255,255,0.05); }

/* Primary */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-blue) 100%);
  color: #000;
  border-color: transparent;
  box-shadow: 0 4px 20px rgba(0, 229, 255, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 4px 32px rgba(0, 229, 255, 0.5);
  transform: translateY(-1px);
}

/* Danger */
.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--accent-red);
  border-color: rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.2);
  box-shadow: 0 4px 20px rgba(239, 68, 68, 0.2);
}

/* Ghost */
.btn-ghost {
  background: var(--bg-card);
  color: var(--text-secondary);
  border-color: var(--border-card);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

/* Icon button */
.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  flex: none;
  font-size: 16px;
}

/* Disabled */
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* Select dropdown */
.select-wrapper {
  position: relative;
  flex: 1;
}

.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  font-size: 12px;
}

.select {
  width: 100%;
  padding: 12px 32px 12px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s;
}

.select:focus {
  outline: none;
  border-color: var(--border-glow);
}

.select option {
  background: var(--bg-surface);
  color: var(--text-primary);
}

/* ══════════════════════════════════════════════════
   TRANSLATION PANEL
   ══════════════════════════════════════════════════ */
.translation-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Current detection */
.detection-display {
  text-align: center;
  padding: 32px 24px;
}

.detection-sign {
  font-family: var(--font-display);
  font-size: clamp(64px, 10vw, 96px);
  line-height: 1;
  letter-spacing: 0.05em;
  background: linear-gradient(135deg, #fff 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all 0.3s var(--ease-spring);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detection-sign.uncertain {
  font-size: 18px;
  color: var(--text-muted);
  -webkit-text-fill-color: var(--text-muted);
  font-family: var(--font-body);
  font-weight: 500;
}

.detection-category {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.detection-word {
  font-size: 14px;
  color: var(--accent-cyan);
  font-weight: 600;
  margin-top: 8px;
}

/* Confidence bar */
.confidence-wrapper {
  padding: 0 24px 24px;
}

.confidence-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.confidence-value {
  color: var(--text-secondary);
  transition: color 0.3s;
}

.confidence-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s var(--ease-out-expo), background 0.4s;
}

.confidence-fill.high   { background: linear-gradient(90deg, var(--accent-cyan), var(--accent-blue)); }
.confidence-fill.medium { background: linear-gradient(90deg, var(--accent-amber), #f97316); }
.confidence-fill.low    { background: linear-gradient(90deg, var(--accent-red), #f97316); }

/* Translation output */
.translation-output {
  padding: 20px 24px;
}

.translation-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.translation-text {
  font-size: 20px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 60px;
  word-break: break-word;
}

.translation-text.empty {
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 400;
  font-style: italic;
}

.translation-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* TTS controls */
.tts-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  flex-wrap: wrap;
}

.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.toggle-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.toggle {
  position: relative;
  width: 36px;
  height: 20px;
  cursor: pointer;
}

.toggle input { display: none; }

.toggle-track {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
  border: 1px solid var(--border-card);
  transition: background 0.2s;
}

.toggle input:checked + .toggle-track {
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s var(--ease-spring);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.toggle input:checked ~ .toggle-thumb { transform: translateX(16px); }

/* Speed slider */
.speed-slider {
  flex: 1;
  min-width: 80px;
  -webkit-appearance: none;
  height: 3px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  outline: none;
}

.speed-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0,229,255,0.5);
}

/* ══════════════════════════════════════════════════
   RIGHT SIDEBAR
   ══════════════════════════════════════════════════ */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* History */
.history-list {
  max-height: 280px;
  overflow-y: auto;
  padding: 12px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  transition: all 0.2s;
  cursor: default;
}

.history-item:hover {
  background: var(--bg-card);
  border-color: var(--border-card);
}

.history-sign {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1;
  color: var(--text-secondary);
  min-width: 40px;
  text-align: center;
}

.history-details {
  flex: 1;
  min-width: 0;
}

.history-word {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.history-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.history-conf {
  font-size: 11px;
  font-weight: 600;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(0,229,255,0.08);
  color: var(--accent-cyan);
  border: 1px solid rgba(0,229,255,0.15);
}

.history-empty {
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* ══════════════════════════════════════════════════
   PRACTICE MODE
   ══════════════════════════════════════════════════ */
.practice-target {
  text-align: center;
  padding: 24px;
}

.practice-sign-display {
  font-family: var(--font-display);
  font-size: 80px;
  line-height: 1;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.practice-sign-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.practice-sign-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.practice-feedback {
  padding: 16px 24px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  border-top: 1px solid var(--border-card);
  transition: all 0.3s;
}

.practice-feedback.correct { color: var(--accent-green); }
.practice-feedback.almost  { color: var(--accent-amber); }
.practice-feedback.wrong   { color: var(--accent-red); }
.practice-feedback.waiting { color: var(--text-muted); font-weight: 400; }

.practice-score {
  padding: 0 24px 20px;
}

.score-bar {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  overflow: hidden;
  margin-top: 8px;
}

.score-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), var(--accent-cyan));
  border-radius: 6px;
  transition: width 0.6s var(--ease-spring);
}

.practice-nav {
  display: flex;
  gap: 10px;
  padding: 0 20px 20px;
}

/* Practice categories */
.practice-cats {
  display: flex;
  gap: 8px;
  padding: 16px 20px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border-card);
}

.practice-cat {
  padding: 6px 14px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border-card);
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  font-family: var(--font-body);
}

.practice-cat.active, .practice-cat:hover {
  background: rgba(0,229,255,0.1);
  border-color: var(--border-glow);
  color: var(--accent-cyan);
}

/* ══════════════════════════════════════════════════
   UPLOAD MODE
   ══════════════════════════════════════════════════ */
.upload-zone {
  margin: 20px;
  border: 2px dashed var(--border-card);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.upload-zone:hover, .upload-zone.drag-over {
  border-color: var(--border-glow);
  background: rgba(0,229,255,0.03);
}

.upload-icon { font-size: 40px; opacity: 0.4; margin-bottom: 12px; }
.upload-text { font-size: 14px; color: var(--text-secondary); font-weight: 500; }
.upload-sub  { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

.upload-input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-preview {
  margin: 0 20px 20px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-card);
  position: relative;
}

.upload-preview img, .upload-preview video {
  width: 100%;
  display: block;
  max-height: 280px;
  object-fit: contain;
  background: #000;
}

.upload-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.upload-remove:hover {
  background: rgba(239,68,68,0.3);
  border-color: var(--accent-red);
}

/* ══════════════════════════════════════════════════
   HAND REFERENCE GUIDE
   ══════════════════════════════════════════════════ */
.sign-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 8px;
  padding: 16px;
}

.sign-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.2s;
}

.sign-cell:hover {
  border-color: var(--border-glow);
  background: rgba(0,229,255,0.05);
  transform: translateY(-2px);
}

.sign-cell-char {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--text-primary);
  line-height: 1;
}

.sign-cell-label {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* ══════════════════════════════════════════════════
   PRIVACY NOTICE
   ══════════════════════════════════════════════════ */
.privacy-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(59,130,246,0.05);
  border: 1px solid rgba(59,130,246,0.15);
  border-radius: var(--radius-lg);
  margin: 0 0 16px;
}

.privacy-icon { font-size: 18px; flex-shrink: 0; margin-top: 2px; }

.privacy-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
}

.privacy-text strong { color: var(--text-secondary); }

/* ══════════════════════════════════════════════════
   TABS
   ══════════════════════════════════════════════════ */
.tabs {
  display: flex;
  gap: 4px;
  padding: 16px 20px 0;
}

.tab {
  padding: 8px 16px;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-body);
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: var(--accent-cyan);
  border-bottom-color: var(--accent-cyan);
}

.tab:hover:not(.active) {
  color: var(--text-secondary);
}

/* ══════════════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════════════ */
.footer {
  padding: 32px;
  text-align: center;
  border-top: 1px solid var(--border-card);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.8;
}

.disclaimer {
  max-width: 600px;
  margin: 0 auto 8px;
  font-style: italic;
}

/* ══════════════════════════════════════════════════
   ANIMATED SCAN LINE
   ══════════════════════════════════════════════════ */
.camera-viewport.active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-cyan), transparent);
  animation: scanLine 3s linear infinite;
  pointer-events: none;
  opacity: 0.4;
}

/* ══════════════════════════════════════════════════
   LOADING SPINNER
   ══════════════════════════════════════════════════ */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(0,229,255,0.2);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════
   SECTION DIVIDER / LABEL
   ══════════════════════════════════════════════════ */
.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 20px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-card);
}

/* ══════════════════════════════════════════════════
   KEYFRAME ANIMATIONS
   ══════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

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

@keyframes ringPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,229,255,0.3); }
  50%       { box-shadow: 0 0 0 12px rgba(0,229,255,0); }
}

@keyframes ringExpand {
  0%   { transform: scale(1); opacity: 0.3; }
  100% { transform: scale(1.4); opacity: 0; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes scanLine {
  0%   { top: -2px; }
  100% { top: 100%; }
}

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

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.8); }
  60%  { transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}

/* ══════════════════════════════════════════════════
   TOAST NOTIFICATION
   ══════════════════════════════════════════════════ */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-surface);
  border: 1px solid var(--border-glow);
  border-radius: 100px;
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-glow), var(--shadow-card);
  transition: transform 0.4s var(--ease-spring), opacity 0.3s;
  opacity: 0;
  white-space: nowrap;
}

.toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ══════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .nav { padding: 16px; }
  .nav-links { display: none; }
  .container { padding: 0 16px; }
  .hero { padding: 40px 0 24px; }
  .camera-controls { flex-wrap: wrap; }
  .tts-panel { flex-wrap: wrap; }
  .toggle-wrap { margin-left: 0; }
}

@media (max-width: 480px) {
  .btn { padding: 10px 14px; font-size: 12px; }
  .sign-grid { grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); }
  .detection-sign { font-size: 64px; }
}

/* Smooth entrance for main app */
.main-app {
  animation: fadeIn 0.6s var(--ease-out-expo) 0.2s both;
}

/* Utility */
.hidden  { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
