/* ════════════════════════════════════════════════════════════════
   SignSense Website — style.css
   Dark glassmorphic design, indigo accent, full responsive layout
   ════════════════════════════════════════════════════════════════ */

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

:root {
  --bg:            #080b14;
  --bg-card:       rgba(14, 18, 35, 0.85);
  --bg-card2:      rgba(20, 25, 48, 0.75);
  --border:        rgba(99, 102, 241, 0.18);
  --border2:       rgba(255,255,255,0.07);
  --accent:        #6366f1;
  --accent-bright: #818cf8;
  --accent-dim:    rgba(99,102,241,0.15);
  --success:       #34d399;
  --warning:       #fbbf24;
  --danger:        #f87171;
  --text:          #f1f5f9;
  --text2:         #94a3b8;
  --text3:         #475569;
  --radius:        14px;
  --radius-sm:     8px;
  --glow:          0 0 40px rgba(99,102,241,0.18);
  --t:             0.2s ease;
}

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 15% 10%, rgba(99,102,241,0.10) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 80%, rgba(139,92,246,0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(6,182,212,0.03) 0%, transparent 70%);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Navbar ──────────────────────────────────────────────────────── */
.navbar {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 40px;
  background: rgba(8,11,20,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

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

.nav-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--accent), #a78bfa);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  box-shadow: var(--glow);
}

.nav-title {
  font-size: 20px; font-weight: 800;
  background: linear-gradient(135deg, var(--accent-bright), #c4b5fd);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-tag {
  font-size: 11px; padding: 3px 10px;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--accent-bright);
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* Status pill */
.status-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 14px; border-radius: 99px;
  font-size: 12px; font-weight: 600;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  transition: var(--t);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text3); transition: background var(--t);
}
.status-pill.active   { border-color: rgba(52,211,153,0.4); color: var(--success); }
.status-pill.active   .status-dot { background: var(--success); box-shadow: 0 0 8px var(--success); }
.status-pill.loading  { border-color: rgba(251,191,36,0.4); color: var(--warning); }
.status-pill.loading  .status-dot { background: var(--warning); animation: blink 0.9s infinite; }
.status-pill.error    { border-color: rgba(248,113,113,0.4); color: var(--danger); }
.status-pill.error    .status-dot { background: var(--danger); }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }

/* ── Hero ─────────────────────────────────────────────────────────── */
.hero {
  text-align: center;
  padding: 52px 20px 36px;
  max-width: 700px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1.1;
  margin-bottom: 14px;
}

.gradient-text {
  background: linear-gradient(135deg, var(--accent-bright), #c4b5fd, #67e8f9);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 16px;
  color: var(--text2);
  max-width: 520px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ── App Container ────────────────────────────────────────────────── */
.app-container {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
  max-width: 1140px;
  margin: 0 auto 48px;
  padding: 0 32px;
}

/* ── Left Panel ───────────────────────────────────────────────────── */
.left-panel { display: flex; flex-direction: column; gap: 16px; }

/* Camera card */
.camera-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(12px);
  box-shadow: var(--glow);
}

.camera-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border2);
}

.card-label {
  font-size: 11px; font-weight: 700;
  color: var(--text3); text-transform: uppercase; letter-spacing: 0.8px;
}

.mb8 { margin-bottom: 8px; }

.toggle-btn {
  padding: 5px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  color: var(--text2);
  font-size: 12px; font-weight: 600; cursor: pointer;
  transition: var(--t);
}
.toggle-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-bright);
}
.toggle-btn:hover { opacity: 0.8; }

.video-wrapper {
  position: relative;
  width: 100%; aspect-ratio: 4/3;
  background: #030508;
}

#cameraFeed {
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: block;
}

/* Corner brackets overlay */
.cam-corners {
  position: absolute; inset: 0; pointer-events: none;
}
.cam-corners::before, .cam-corners::after {
  content: ''; position: absolute;
  width: 20px; height: 20px;
  border-color: var(--accent); border-style: solid;
}
.cam-corners::before { top: 8px; left: 8px; border-width: 2px 0 0 2px; border-radius: 4px 0 0 0; }
.cam-corners::after  { bottom: 8px; right: 8px; border-width: 0 2px 2px 0; border-radius: 0 0 4px 0; }

.no-camera {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  background: #030508; color: var(--text3); font-size: 13px;
}
.no-cam-icon { font-size: 48px; }
.hidden { display: none !important; }

/* Detection card */
.detection-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  backdrop-filter: blur(12px);
  display: flex; flex-direction: column; gap: 14px;
}

.det-row { display: flex; justify-content: space-between; align-items: flex-start; }
.det-label { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 4px; }
.det-sign  { font-size: 56px; font-weight: 900; color: var(--accent-bright); line-height: 1; letter-spacing: -2px; transition: color var(--t); }
.det-sign.command { font-size: 28px; color: var(--warning); }
.det-right { text-align: right; }
.frame-status { font-size: 12px; color: var(--text2); }

.conf-section { display: flex; flex-direction: column; gap: 5px; }
.conf-meta { display: flex; justify-content: space-between; }
.conf-pct  { font-size: 11px; color: var(--text3); }
.conf-track { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.05); overflow: hidden; }
.conf-fill  { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-bright)); transition: width 0.12s ease; width: 0%; }

/* Command reference card */
.command-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  backdrop-filter: blur(12px);
}

.cmd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.cmd-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  background: var(--bg-card2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 600;
  color: var(--text2);
}
.cmd-sign { font-size: 18px; }

/* ── Right Panel ──────────────────────────────────────────────────── */
.right-panel { display: flex; flex-direction: column; gap: 16px; }

.text-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  backdrop-filter: blur(12px);
}

.sentence-card { flex: 1; }

.text-card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}

.badge {
  font-size: 11px; padding: 2px 10px;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: 99px;
  color: var(--accent-bright); font-weight: 600;
}

.word-display {
  font-size: 38px; font-weight: 800;
  color: var(--text); letter-spacing: 5px;
  min-height: 48px; word-break: break-all;
}

.cursor {
  display: inline-block; width: 3px; height: 34px;
  background: var(--accent); margin-left: 3px;
  vertical-align: middle;
  animation: cursorBlink 1s step-end infinite;
}
@keyframes cursorBlink { 0%,100%{opacity:1} 50%{opacity:0} }

.sentence-display {
  font-size: 17px; color: var(--text2);
  min-height: 90px; max-height: 180px;
  overflow-y: auto; word-break: break-word; line-height: 1.8;
}

/* Suggestions */
.suggestions-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  backdrop-filter: blur(12px);
}

.suggestions-list { display: flex; flex-wrap: wrap; gap: 8px; }
.sugg-empty { font-size: 12px; color: var(--text3); }

.suggestion-chip {
  padding: 6px 16px; border-radius: 99px;
  border: 1px solid var(--border);
  background: var(--bg-card2);
  font-size: 13px; font-weight: 600;
  color: var(--accent-bright); cursor: pointer;
  transition: all var(--t);
}
.suggestion-chip:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  transform: translateY(-2px);
}

/* Actions */
.actions-row { display: flex; gap: 10px; }

.action-btn {
  flex: 1; padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card2);
  color: var(--text2);
  font-size: 14px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  transition: all var(--t);
}
.action-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); transform: translateY(-1px); }
.action-btn:active { transform: translateY(0); }
.action-btn.primary { background: var(--accent-dim); border-color: var(--accent); color: var(--accent-bright); }
.action-btn.primary:hover { background: var(--accent); color: #fff; box-shadow: var(--glow); }
.action-btn.danger  { background: rgba(248,113,113,0.10); border-color: rgba(248,113,113,0.30); color: var(--danger); }
.action-btn.danger:hover { background: rgba(248,113,113,0.20); }

/* Stats bar */
.stats-bar {
  display: flex; align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  backdrop-filter: blur(12px);
}

.stat-item { flex: 1; text-align: center; }
.stat-val  { display: block; font-size: 22px; font-weight: 800; color: var(--accent-bright); }
.stat-lbl  { font-size: 10px; font-weight: 700; color: var(--text3); text-transform: uppercase; letter-spacing: 0.6px; }
.stat-divider { width: 1px; height: 36px; background: var(--border); }

/* ── Footer ───────────────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 28px 20px 36px;
  border-top: 1px solid var(--border);
  color: var(--text3);
  font-size: 13px;
  line-height: 2;
}
.footer-sub { font-size: 12px; color: var(--text3); opacity: 0.7; }

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .app-container { grid-template-columns: 1fr; padding: 0 16px; }
  .navbar { padding: 12px 20px; }
  .hero   { padding: 36px 16px 24px; }
  .hero h1 { font-size: 32px; }
  .det-sign { font-size: 42px; }
}
