/* ============================================
   Finlatics Voice Interview — Avatar Edition
   Dark premium theme
============================================ */

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

:root {
  --bg: #0a0a0b;
  --surface: #131316;
  --surface-2: #1a1a1f;
  --surface-3: #22222a;
  --border: #26262c;
  --border-hover: #3a3a42;
  --text: #f0f0f2;
  --text-muted: #8b8b93;
  --text-dim: #56565e;

  --accent: #3b82f6;
  --accent-hover: #2563eb;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(ellipse at top, rgba(59, 130, 246, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at bottom, rgba(139, 92, 246, 0.04) 0%, transparent 50%),
    var(--bg);
  min-height: 100vh;
}

.screen { display: none; min-height: 100vh; }
.screen.active { display: block; }

.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.container.narrow { max-width: 560px; margin: 60px auto; }
.container.center { text-align: center; padding-top: 40px; }

h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 4px; }
h2 { font-size: 18px; font-weight: 600; margin-bottom: 14px; }
.subtitle { color: var(--text-muted); font-size: 15px; margin-bottom: 32px; }
.muted { color: var(--text-muted); }
.fine-print { text-align: center; color: var(--text-dim); font-size: 13px; margin-top: 20px; }

header { text-align: center; margin-bottom: 32px; }
.brand {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  color: white;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700;
  margin: 0 auto 20px;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 16px;
}

.field { margin-bottom: 18px; }
.field label {
  display: block; color: var(--text-muted);
  font-size: 13px; font-weight: 500;
  margin-bottom: 6px; letter-spacing: 0.2px;
}
input, select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 15px; font-family: inherit;
  transition: border-color 0.15s, background 0.15s;
}
input:focus, select:focus {
  outline: none; border-color: var(--accent); background: var(--surface);
}

.btn-primary, .btn-ghost, .btn-ghost-danger {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px; border: none;
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 500; font-family: inherit;
  cursor: pointer; transition: all 0.15s;
  width: 100%; margin-top: 12px;
}
.btn-primary {
  background: var(--accent); color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--accent-hover); }
.btn-primary:disabled {
  background: var(--surface-2); color: var(--text-dim); cursor: not-allowed;
}
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { border-color: var(--border-hover); background: var(--surface-2); }
.btn-ghost-danger {
  background: transparent; color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.btn-ghost-danger:hover { background: rgba(239, 68, 68, 0.08); border-color: var(--danger); }

.browser-check {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  margin: 16px 0 4px;
  font-size: 13px; color: var(--text-muted);
}
.browser-check .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-dim);
}
.browser-check.ok { color: var(--success); }
.browser-check.ok .dot { background: var(--success); }
.browser-check.fail { color: var(--danger); }
.browser-check.fail .dot { background: var(--danger); }

.interview-layout-v2 {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 20px;
  padding: 20px;
  max-width: 1600px;
  margin: 0 auto;
  min-height: 100vh;
}

.avatar-panel { display: flex; flex-direction: column; gap: 12px; }

.avatar-container {
  flex: 1;
  background: linear-gradient(180deg, #1a1a22 0%, #0f0f13 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  min-height: 600px;
}

#avatar-canvas {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0; left: 0;
}

#avatar-canvas canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.avatar-loading {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
  font-size: 14px;
  z-index: 10;
}
.avatar-loading.hidden { display: none; }

.avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 40px;
  color: var(--text);
}
.orb-wrap {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.orb {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(59, 130, 246, 0.6), rgba(139, 92, 246, 0.3) 40%, transparent 70%);
  filter: blur(8px);
  animation: orbPulse 4s ease-in-out infinite;
}
.orb-1 { width: 240px; height: 240px; opacity: 0.5; animation-delay: 0s; }
.orb-2 { width: 180px; height: 180px; opacity: 0.7; animation-delay: 1s; background: radial-gradient(circle at 30% 30%, rgba(139, 92, 246, 0.7), rgba(59, 130, 246, 0.4) 40%, transparent 70%); }
.orb-3 { width: 130px; height: 130px; opacity: 0.9; animation-delay: 2s; background: radial-gradient(circle at 30% 30%, rgba(59, 130, 246, 0.9), rgba(139, 92, 246, 0.5) 40%, transparent 70%); }

@keyframes orbPulse {
  0%, 100% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

.orb-center {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 8px 40px rgba(59, 130, 246, 0.5);
  z-index: 2;
}

.fallback-name {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.fallback-sub {
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

.avatar-container.speaking .orb { animation-duration: 1.2s; }
.avatar-container.speaking .orb-center {
  animation: speakGlow 0.8s ease-in-out infinite;
}
@keyframes speakGlow {
  0%, 100% { box-shadow: 0 8px 40px rgba(59, 130, 246, 0.5); }
  50% { box-shadow: 0 8px 60px rgba(59, 130, 246, 0.9); }
}

.avatar-nameplate {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  text-align: center;
}
.avatar-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}
.avatar-title {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 2px;
}

.control-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 40px);
}

.control-header {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.candidate-info-v2 {
  display: flex; align-items: center; gap: 10px;
}
.avatar-sm {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  color: white; font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.candidate-name { font-size: 14px; font-weight: 600; }
.candidate-role { font-size: 12px; color: var(--text-muted); }

.timer { text-align: right; }
.timer-label {
  font-size: 10px; color: var(--text-muted);
  letter-spacing: 1.5px;
}
.timer-value {
  font-size: 22px; font-weight: 700;
  font-family: 'SF Mono', Menlo, Monaco, monospace;
  color: var(--text);
}

.live-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.status-chips {
  display: flex; gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-muted);
}
.chip-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-dim);
}
.chip.active .chip-dot { background: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
.chip.listening .chip-dot { background: var(--danger); animation: pulse 1.2s ease-in-out infinite; }
.chip.speaking .chip-dot { background: var(--success); animation: pulse 1s ease-in-out infinite; }

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

.current-question {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 15px;
  line-height: 1.5;
  min-height: 80px;
  color: var(--text);
  border-left: 3px solid var(--accent);
}

.mic-zone {
  display: flex; align-items: center; gap: 16px;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.mic-button-v2 {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: white;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
  flex-shrink: 0;
}
.mic-button-v2:hover:not(:disabled) {
  background: var(--accent-hover); transform: scale(1.05);
}
.mic-button-v2:disabled {
  background: var(--surface-2); color: var(--text-dim);
  cursor: not-allowed; box-shadow: none;
}
.mic-button-v2.recording {
  background: var(--danger);
  animation: pulse-red 1.5s ease-in-out infinite;
}
@keyframes pulse-red {
  0%, 100% { box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 4px 24px rgba(239, 68, 68, 0.7); }
}

.mic-prompt-v2 {
  color: var(--text-muted);
  font-size: 13px;
  flex: 1;
}

.live-transcript-v2 {
  min-height: 40px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-muted);
  display: none;
}
.live-transcript-v2.active { display: block; }

.conversation-log {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  flex: 1;
  min-height: 200px;
  max-height: 320px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.conversation-log-header {
  font-size: 11px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 10px;
  font-weight: 600;
}

.conversation-log-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 4px;
}

.log-item {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.5;
  animation: fadeIn 0.3s ease-out;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.log-item.ai {
  background: var(--surface-2);
}
.log-item.student {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(59, 130, 246, 0.05));
  border-left: 2px solid var(--accent);
}
.log-item .speaker {
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.report-header { text-align: center; margin-bottom: 32px; }
.recommendation-card { text-align: center; }
.rec-label {
  font-size: 11px; color: var(--text-muted);
  letter-spacing: 1.5px; margin-bottom: 8px;
  text-transform: uppercase;
}
.rec-value {
  font-size: 32px; font-weight: 700; margin-bottom: 8px;
}
.rec-value.strong_hire { color: var(--success); }
.rec-value.hire { color: var(--success); }
.rec-value.borderline { color: var(--warning); }
.rec-value.no_hire { color: var(--danger); }
.rec-rationale { color: var(--text-muted); max-width: 600px; margin: 0 auto; }

.scores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}
.score-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}
.score-label {
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 8px; text-transform: capitalize;
}
.score-bar {
  height: 6px; background: var(--border);
  border-radius: 999px;
  margin-bottom: 8px; overflow: hidden;
}
.score-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #8b5cf6);
  border-radius: 999px;
  transition: width 0.6s ease-out;
}
.score-value {
  font-size: 20px; font-weight: 700;
  font-family: 'SF Mono', Menlo, Monaco, monospace;
}

ul { list-style: none; }
ul li {
  padding: 10px 0 10px 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
ul li:last-child { border-bottom: none; }
ul li::before {
  content: '•';
  position: absolute;
  left: 0; color: var(--accent); font-weight: 700;
}

.improvement-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 10px;
}
.improvement-item .area {
  font-weight: 600; margin-bottom: 6px; color: var(--warning);
}
.improvement-item .obs {
  color: var(--text-muted); font-size: 14px; margin-bottom: 6px;
}
.improvement-item .sug { font-size: 14px; }

.transcript-card summary {
  cursor: pointer; list-style: none; user-select: none;
}
.transcript-card summary::-webkit-details-marker { display: none; }
.transcript-card[open] summary { margin-bottom: 14px; }
.transcript-card pre {
  white-space: pre-wrap;
  font-family: 'SF Mono', Menlo, Monaco, monospace;
  font-size: 13px; color: var(--text-muted);
  max-height: 400px; overflow-y: auto;
  padding: 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.actions { text-align: center; margin-top: 24px; }
.actions button { max-width: 300px; }

@media (max-width: 1100px) {
  .interview-layout-v2 {
    grid-template-columns: 1fr;
  }
  .avatar-container { min-height: 400px; }
  .control-panel { max-height: none; }
}

@media (max-width: 640px) {
  .interview-layout-v2 { padding: 12px; gap: 12px; }
  .avatar-container { min-height: 320px; }
}

/* Q-by-Q Breakdown */
.qa-breakdown-card { padding: 0; overflow: hidden; }
.qa-header { padding: 24px 28px 20px; border-bottom: 1px solid var(--border); }
.qa-header h2 { margin: 0 0 4px 0; font-size: 20px; font-weight: 600; color: var(--text); }
.qa-subtitle { color: var(--text-muted); font-size: 14px; line-height: 1.5; }
.qa-status { padding: 16px 28px; }
.qa-loading { display: flex; align-items: center; gap: 12px; color: var(--text-muted); font-size: 14px; }
.qa-spinner { width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.1); border-top-color: var(--accent); border-radius: 50%; animation: qa-spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes qa-spin { to { transform: rotate(360deg); } }
.qa-note { padding: 12px 16px; background: rgba(255, 255, 255, 0.03); border-radius: 8px; color: var(--text-muted); font-size: 13px; margin-top: 8px; }
.qa-note-warn { background: rgba(251, 191, 36, 0.1); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.2); }
.btn-inline { background: transparent; border: 1px solid currentColor; color: inherit; padding: 4px 12px; border-radius: 6px; font-size: 12px; cursor: pointer; margin-left: 8px; }
.btn-inline:hover { background: rgba(255, 255, 255, 0.05); }
.qa-list { padding: 0 28px 28px; }
.qa-item { border: 1px solid var(--border); border-radius: 12px; background: rgba(255, 255, 255, 0.02); margin-bottom: 12px; overflow: hidden; transition: border-color 0.15s ease; }
.qa-item:hover { border-color: rgba(255, 255, 255, 0.15); }
.qa-item.expanded { border-color: rgba(59, 130, 246, 0.3); }
.qa-summary { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; cursor: pointer; user-select: none; gap: 16px; }
.qa-summary:hover { background: rgba(255, 255, 255, 0.02); }
.qa-summary-main { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.qa-num { background: rgba(59, 130, 246, 0.15); color: var(--accent); font-weight: 600; font-size: 12px; padding: 4px 10px; border-radius: 6px; flex-shrink: 0; letter-spacing: 0.5px; }
.qa-question-preview { color: var(--text); font-size: 14px; line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-summary-meta { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.qa-score-badge { padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 600; letter-spacing: 0.3px; }
.qa-score-badge.positive { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.qa-score-badge.neutral { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.qa-score-badge.negative { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.qa-chevron { color: var(--text-muted); transition: transform 0.2s ease; }
.qa-item.expanded .qa-chevron { transform: rotate(180deg); }
.qa-body { max-height: 0; overflow: hidden; transition: max-height 0.3s ease; }
.qa-item.expanded .qa-body { max-height: 5000px; padding: 8px 20px 20px; }
.qa-question-full { margin-bottom: 16px; padding: 12px 16px; background: rgba(255, 255, 255, 0.03); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; }
.qa-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }
.qa-question-text { font-size: 14px; color: var(--text); line-height: 1.6; }
.qa-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 20px; }
.qa-column { padding: 14px 16px; border-radius: 8px; border: 1px solid var(--border); }
.qa-column-yours { background: rgba(59, 130, 246, 0.04); border-color: rgba(59, 130, 246, 0.2); }
.qa-column-ideal { background: rgba(16, 185, 129, 0.04); border-color: rgba(16, 185, 129, 0.2); }
.qa-column-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.qa-column-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }
.qa-column-yours .qa-column-label { color: var(--accent); }
.qa-column-ideal .qa-column-label { color: #10b981; }
.qa-answer-text { font-size: 13px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.qa-feedback { margin-top: 12px; padding: 14px 16px; border-radius: 8px; border: 1px solid transparent; }
.qa-feedback-header { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.qa-feedback ul { margin: 0; padding-left: 24px; }
.qa-feedback li { font-size: 13px; line-height: 1.6; color: var(--text); margin-bottom: 4px; }
.qa-strengths { background: rgba(16, 185, 129, 0.05); border-color: rgba(16, 185, 129, 0.15); }
.qa-strengths .qa-feedback-header { color: #10b981; }
.qa-missing { background: rgba(239, 68, 68, 0.05); border-color: rgba(239, 68, 68, 0.15); }
.qa-missing .qa-feedback-header { color: #ef4444; }
.qa-suggestions { background: rgba(139, 92, 246, 0.05); border-color: rgba(139, 92, 246, 0.15); }
.qa-suggestions .qa-feedback-header { color: #a78bfa; }
@media (max-width: 720px) {
  .qa-header { padding: 20px; }
  .qa-status, .qa-list { padding-left: 20px; padding-right: 20px; }
  .qa-columns { grid-template-columns: 1fr; }
  .qa-summary { padding: 14px 16px; }
  .qa-question-preview { font-size: 13px; }
  .qa-item.expanded .qa-body { padding: 8px 16px 16px; }
}

/* Video Recording Consent */
.video-consent { margin: 20px 0 16px; padding: 16px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); border-radius: 10px; }
.consent-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; user-select: none; }
.consent-row input[type="checkbox"] { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); cursor: pointer; flex-shrink: 0; }
.consent-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.consent-text strong { color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.4; }
.consent-text small { color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.video-preview-wrap { margin-top: 14px; padding: 12px; background: #000; border-radius: 8px; position: relative; overflow: hidden; }
.video-preview-wrap.hidden { display: none; }
#video-preview { width: 100%; max-height: 200px; object-fit: cover; border-radius: 4px; display: block; transform: scaleX(-1); }
.preview-label { margin-top: 8px; font-size: 11px; color: rgba(255, 255, 255, 0.6); text-align: center; font-weight: 500; letter-spacing: 0.3px; }
.video-error { margin-top: 10px; padding: 10px 12px; background: rgba(239, 68, 68, 0.1); border: 1px solid rgba(239, 68, 68, 0.2); border-radius: 6px; color: #fca5a5; font-size: 13px; line-height: 1.5; }
.video-error.hidden { display: none; }
.video-unsupported { padding: 10px 12px; background: rgba(251, 191, 36, 0.08); border-radius: 6px; color: var(--text-muted); }
.video-unsupported small { font-size: 12px; line-height: 1.5; }

/* Video Replay Player */
.video-replay-card { padding: 0; overflow: hidden; }
.video-replay-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 24px 28px 20px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.video-replay-header h2 { margin: 0 0 4px 0; font-size: 20px; font-weight: 600; color: var(--text); }
.video-replay-meta { color: var(--text-muted); font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.video-replay-meta .sep { color: rgba(255, 255, 255, 0.2); }
.video-replay-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-ghost-sm { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border); color: var(--text); border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.15s ease; }
.btn-ghost-sm:hover { background: rgba(255, 255, 255, 0.06); border-color: rgba(255, 255, 255, 0.2); }
.btn-ghost-sm.btn-danger-sm:hover { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); color: #fca5a5; }
.video-player-wrap { background: #000; padding: 0; display: flex; align-items: center; justify-content: center; }
#video-player { width: 100%; max-height: 500px; display: block; background: #000; outline: none; }
.video-markers { padding: 20px 28px 16px; background: rgba(255, 255, 255, 0.01); border-top: 1px solid var(--border); }
.video-markers-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); font-weight: 600; margin-bottom: 10px; }
.video-markers-list { display: flex; flex-wrap: wrap; gap: 8px; }
.video-marker-btn { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; background: rgba(59, 130, 246, 0.08); border: 1px solid rgba(59, 130, 246, 0.2); color: var(--text); border-radius: 8px; cursor: pointer; font-size: 13px; transition: all 0.15s ease; font-family: inherit; }
.video-marker-btn:hover { background: rgba(59, 130, 246, 0.15); border-color: rgba(59, 130, 246, 0.4); transform: translateY(-1px); }
.marker-label { font-weight: 600; color: var(--accent); font-size: 12px; letter-spacing: 0.3px; }
.marker-time { font-size: 12px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.video-privacy-note { display: flex; align-items: center; gap: 8px; padding: 14px 28px; background: rgba(16, 185, 129, 0.05); border-top: 1px solid rgba(16, 185, 129, 0.1); font-size: 12px; color: #86efac; }
.video-privacy-note svg { flex-shrink: 0; color: #10b981; }
@media (max-width: 720px) {
  .video-replay-header { padding: 20px; }
  .video-markers, .video-privacy-note { padding-left: 20px; padding-right: 20px; }
  .video-replay-actions { width: 100%; }
  .btn-ghost-sm { flex: 1; justify-content: center; }
  .video-marker-btn { flex: 1; justify-content: center; min-width: calc(50% - 4px); }
}

/* Sentiment Analysis */
.sentiment-card { padding: 0; overflow: hidden; }
.sentiment-header { padding: 24px 28px 20px; border-bottom: 1px solid var(--border); }
.sentiment-header h2 { margin: 0 0 4px 0; font-size: 20px; font-weight: 600; color: var(--text); }
.sentiment-subtitle { margin: 0; color: var(--text-muted); font-size: 14px; }
.sentiment-gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; padding: 24px 28px 16px; }
.gauge { display: flex; flex-direction: column; gap: 8px; }
.gauge-header { display: flex; justify-content: space-between; align-items: baseline; }
.gauge-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); font-weight: 600; }
.gauge-value { font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.gauge-value span { font-size: 22px; font-weight: 700; color: var(--accent); }
.gauge-bar { height: 10px; background: rgba(255, 255, 255, 0.05); border-radius: 5px; overflow: hidden; position: relative; }
.gauge-fill { height: 100%; border-radius: 5px; transition: width 0.8s ease-out; }
.gauge-fill-confidence { background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%); }
.gauge-fill-clarity { background: linear-gradient(90deg, #10b981 0%, #34d399 100%); }
.gauge-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.sentiment-tone-row { display: flex; align-items: center; gap: 12px; padding: 14px 28px; margin: 0 28px; background: rgba(139, 92, 246, 0.06); border: 1px solid rgba(139, 92, 246, 0.15); border-radius: 8px; }
.tone-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); font-weight: 600; }
.tone-value { font-size: 15px; color: #c4b5fd; font-weight: 600; text-transform: capitalize; }
.sentiment-summary { padding: 16px 28px; margin: 0; font-size: 14px; color: var(--text); line-height: 1.7; }
.sentiment-metrics-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 0 28px 24px; }
.sm-metric { background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); border-radius: 10px; padding: 14px 12px; text-align: center; }
.sm-value { font-size: 24px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.2; }
.sm-unit { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.sm-label { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.sentiment-insights { padding: 20px 28px 28px; border-top: 1px solid var(--border); }
.insights-header { font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); font-weight: 600; margin-bottom: 12px; }
.sentiment-insights-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.sentiment-insight { padding: 12px 14px; border-radius: 8px; border: 1px solid transparent; }
.sentiment-insight-strength { background: rgba(16, 185, 129, 0.06); border-color: rgba(16, 185, 129, 0.15); }
.sentiment-insight-improvement { background: rgba(251, 191, 36, 0.06); border-color: rgba(251, 191, 36, 0.15); }
.sentiment-insight-header { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.5; }
.sentiment-insight-strength .sentiment-insight-header { color: #6ee7b7; }
.sentiment-insight-improvement .sentiment-insight-header { color: #fcd34d; }
.sentiment-insight-header svg { flex-shrink: 0; margin-top: 3px; }
.sentiment-insight-obs { color: var(--text); font-weight: 500; }
.sentiment-insight-tip { font-size: 13px; color: var(--text-muted); margin-top: 6px; margin-left: 24px; line-height: 1.6; }
.sentiment-no-insights { padding: 10px; color: var(--text-muted); font-size: 13px; }
@media (max-width: 720px) {
  .sentiment-header, .sentiment-summary, .sentiment-insights { padding-left: 20px; padding-right: 20px; }
  .sentiment-gauges { grid-template-columns: 1fr; padding: 20px; gap: 20px; }
  .sentiment-tone-row { margin: 0 20px; padding: 12px 16px; }
  .sentiment-metrics-grid { grid-template-columns: 1fr 1fr; padding: 0 20px 20px; }
}

/* Integrity & Anti-Cheating */
.integrity-consent { background: rgba(251, 191, 36, 0.05); border: 1px solid rgba(251, 191, 36, 0.2); border-radius: 10px; padding: 14px 16px; margin: 16px 0; }
.integrity-consent .consent-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.integrity-consent .consent-row input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; width: 18px; height: 18px; cursor: pointer; }
.integrity-consent .consent-text strong { display: block; color: var(--text); font-size: 14px; margin-bottom: 4px; }
.integrity-consent .consent-text small { display: block; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.integrity-banner { position: sticky; top: 0; z-index: 100; padding: 12px 20px; text-align: center; font-size: 14px; font-weight: 500; animation: slideDown 0.3s ease-out; margin: 0 0 12px 0; border-radius: 0 0 8px 8px; }
@keyframes slideDown { from { transform: translateY(-100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.integrity-warn { background: rgba(251, 191, 36, 0.15); border: 1px solid rgba(251, 191, 36, 0.4); color: #fcd34d; }
.integrity-critical { background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.4); color: #fca5a5; }
.integrity-card { padding: 0; overflow: hidden; }
.integrity-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 24px 28px 16px; border-bottom: 1px solid var(--border); }
.integrity-header h2 { margin: 0 0 4px 0; font-size: 20px; font-weight: 600; color: var(--text); }
.integrity-subtitle { margin: 0; color: var(--text-muted); font-size: 14px; }
.integrity-risk-badge { padding: 6px 14px; border-radius: 20px; font-size: 12px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; }
.integrity-risk-low { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; border: 1px solid rgba(16, 185, 129, 0.3); }
.integrity-risk-medium { background: rgba(251, 191, 36, 0.15); color: #fcd34d; border: 1px solid rgba(251, 191, 36, 0.3); }
.integrity-risk-high { background: rgba(249, 115, 22, 0.15); color: #fdba74; border: 1px solid rgba(249, 115, 22, 0.3); }
.integrity-risk-critical { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }
.integrity-score-row { display: flex; justify-content: space-between; align-items: baseline; padding: 18px 28px 10px; }
.integrity-score-label { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }
.integrity-score-value-wrap { font-size: 14px; color: var(--text-muted); }
.integrity-score-value-wrap span { font-size: 28px; font-weight: 700; color: var(--text); }
.integrity-score-bar { height: 10px; background: rgba(255, 255, 255, 0.05); border-radius: 5px; margin: 0 28px 24px; overflow: hidden; }
.integrity-score-fill { height: 100%; border-radius: 5px; transition: width 0.8s ease-out, background 0.3s; }
.integrity-fill-low { background: linear-gradient(90deg, #10b981 0%, #34d399 100%); }
.integrity-fill-medium { background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%); }
.integrity-fill-high { background: linear-gradient(90deg, #f97316 0%, #fb923c 100%); }
.integrity-fill-critical { background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%); }
.integrity-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; padding: 0 28px 24px; }
.im-metric { background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); border-radius: 10px; padding: 14px 12px; text-align: center; }
.im-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.im-value { font-size: 20px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.integrity-flags-section { padding: 18px 28px 24px; border-top: 1px solid var(--border); }
.integrity-flags-header { font-size: 12px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); font-weight: 600; margin-bottom: 10px; }
.integrity-flags-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.integrity-flag { padding: 10px 14px; background: rgba(251, 191, 36, 0.06); border: 1px solid rgba(251, 191, 36, 0.15); border-radius: 6px; color: #fcd34d; font-size: 13px; }
.integrity-no-flags { padding: 10px 14px; color: #6ee7b7; font-size: 13px; background: rgba(16, 185, 129, 0.06); border-radius: 6px; }
@media (max-width: 720px) {
  .integrity-header { padding: 20px 20px 14px; flex-direction: column; gap: 8px; }
  .integrity-score-row { padding: 16px 20px 8px; }
  .integrity-score-bar { margin: 0 20px 20px; }
  .integrity-metrics { grid-template-columns: 1fr 1fr; padding: 0 20px 20px; }
  .integrity-flags-section { padding: 16px 20px 20px; }
}


/* ================================================
   Project Defense UI
   ================================================ */

.interview-type-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 8px;
}

.type-option {
  cursor: pointer;
}

.type-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.type-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 2px solid var(--border);
  border-radius: 10px;
  transition: all 0.2s ease;
}

.type-option input[type="radio"]:checked + .type-card {
  background: rgba(59, 130, 246, 0.08);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.type-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.type-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.project-defense-section {
  background: rgba(139, 92, 246, 0.04);
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
  animation: pd-slideDown 0.3s ease-out;
}

.project-defense-section .section-title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(139, 92, 246, 0.15);
}

.project-defense-section .section-title span {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.project-defense-section .section-title small {
  font-size: 12px;
  color: var(--text-muted);
}

.project-defense-section .field {
  margin-bottom: 14px;
}

.project-defense-section textarea {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  resize: vertical;
  box-sizing: border-box;
}

.project-defense-section textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.file-upload-zone {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.file-upload-btn {
  display: inline-block;
  padding: 14px 20px;
  background: rgba(139, 92, 246, 0.08);
  border: 2px dashed rgba(139, 92, 246, 0.3);
  border-radius: 10px;
  color: #c4b5fd;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  transition: all 0.2s;
}

.file-upload-btn:hover {
  background: rgba(139, 92, 246, 0.12);
  border-color: rgba(139, 92, 246, 0.5);
}

.file-upload-btn.file-selected {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
  border-style: solid;
}

.file-upload-hint {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

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

@media (max-width: 720px) {
  .interview-type-selector {
    grid-template-columns: 1fr;
  }
}
