/* ─── Reset & Base ───────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'DM Sans', sans-serif; background: white; color: #3d3d3d; }

/* ─── Header ─────────────────────────────────────────────────────── */
.header {
  background: white;
  border-bottom: 1px solid #e5e7eb;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-left { display: flex; align-items: center; gap: 12px; }
.header h1 { font-size: 17px; font-weight: 600; color: #3d3d3d; }
.header-logo {
  width: 28px; height: 28px; background: #1f7cf8; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
}
.header-logo svg { width: 16px; height: 16px; fill: white; }
.connection-status { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #747474; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; flex-shrink: 0; }
.status-dot.connected { background: #22c55e; }
.status-dot.error { background: #ef4444; }

/* ─── Main container ─────────────────────────────────────────────── */
.main { max-width: 960px; margin: 0 auto; padding: 24px 20px; position: relative; width: 100%; flex-shrink: 0; }

/* ─── PRE-INTERVIEW STATE ────────────────────────────────────────── */
#pre-interview { /* shown by default */ }
#interview-state { display: none; }

/* Avatar row */
.avatar-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 80px;
  padding: 40px 0 32px;
}
.avatar-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.avatar-col .label { font-size: 15px; font-weight: 600; color: #3d3d3d; }
.avatar-col .sublabel { font-size: 13px; color: #747474; }
.avatar-circle {
  width: 160px; height: 160px; border-radius: 50%;
  border: 4px solid white;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  display: flex; align-items: center; justify-content: center;
  background: #1f7cf8;
  overflow: hidden;
}
.avatar-circle.interviewer-avatar { background: white; }
.avatar-circle svg { width: 72px; height: 72px; fill: white; }
.avatar-circle .initials {
  font-size: 48px; font-weight: 700; color: white; line-height: 1;
}
.avatar-img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}

/* Case info */
.case-info { text-align: center; margin-bottom: 28px; }
.case-info h2 { font-size: 22px; font-weight: 700; margin-bottom: 8px; color: #3d3d3d; }
.case-info .summary { text-align: left; font-size: 15px; color: #747474; line-height: 1.6; max-width: 640px; margin: 0 auto; }

/* Info cards row */
.info-cards {
  display: flex; gap: 16px; margin-bottom: 28px; justify-content: center;
}
.info-card {
  flex: 1; max-width: 200px;
  background: #f4f6f9; border-radius: 8px;
  padding: 16px 12px; text-align: center;
}
.info-card .ic-icon { margin-bottom: 6px; }
.info-card .ic-icon svg { width: 22px; height: 22px; stroke: #747474; fill: none; }
.info-card .ic-value { font-size: 14px; font-weight: 600; color: #3d3d3d; }
.info-card .ic-label { font-size: 12px; color: #747474; margin-top: 2px; }

/* Start button */
.start-section { text-align: center; margin-bottom: 32px; display: flex; justify-content: center; gap: 12px; }

/* How this works */
.how-it-works {
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
  padding: 24px 28px; max-width: 640px; margin: 0 auto;
}
.how-it-works h3 { font-size: 16px; font-weight: 600; margin-bottom: 14px; text-align: center; color: #3d3d3d; }
.how-it-works p { font-size: 14px; color: #747474; margin-bottom: 8px; line-height: 1.6; }
.how-it-works p:last-child { margin-bottom: 0; }

/* ─── INTERVIEW STATE ────────────────────────────────────────────── */

/* Section header */
.interview-top {
  text-align: center; margin-bottom: 24px; width: 100%;
}
.interview-top h2 {
  font-size: 18px; font-weight: 600; color: #3d3d3d; margin-bottom: 4px;
}
.section-label {
  font-size: 14px; font-weight: 500; color: #1f7cf8; margin-bottom: 16px;
}

/* Interview layout: main content stays centered, timer floats right */
.interview-layout {
  position: relative; width: 100%;
}
.interview-main { width: 100%; }
.interview-avatars { width: 100%; }
.transcript-panels { width: 100%; }
.bottom-controls { width: 100%; }
.interview-sidebar {
  position: fixed; right: 24px; top: 80px;
  width: 160px; z-index: 10;
}
@media (max-width: 1200px) {
  .interview-sidebar {
    position: static; margin: 0 auto 20px;
  }
}

/* Timer (RHS sidebar) */
.timer-box {
  background: white; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 14px 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.timer-box-header {
  font-size: 12px; font-weight: 600; color: #9aa0a6;
  text-align: center; border-bottom: 1px solid #e5e7eb;
  padding-bottom: 8px; margin-bottom: 10px;
}
.timer-row { display: flex; flex-direction: column; gap: 14px; }
.timer-section { text-align: center; }
.timer-label { font-size: 11px; color: #9aa0a6; margin-bottom: 3px; }
.timer-value {
  font-size: 18px; font-weight: 600; color: #3d3d3d;
  font-family: 'Courier New', monospace;
}

/* Interview avatars (smaller, horizontal) */
.interview-avatars {
  display: flex; align-items: center; justify-content: center;
  gap: 64px; padding: 24px 0;
}
.int-avatar-col { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.int-avatar-col .label { font-size: 13px; font-weight: 500; color: #747474; }
.int-avatar-circle {
  width: 120px; height: 120px; border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  display: flex; align-items: center; justify-content: center;
  background: #1f7cf8; overflow: hidden;
}
.int-avatar-circle.interviewer-avatar { background: white; }
.int-avatar-circle svg { width: 52px; height: 52px; fill: white; }
.int-avatar-circle .initials { font-size: 36px; font-weight: 700; color: white; }
.int-avatar-circle .avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

/* Sound Bars */
.sound-bars {
  display: flex; align-items: center; justify-content: space-between;
  height: 20px; gap: 2px; width: 30px;
}
.bar { width: 5px; height: 20%; background-color: #D2D2D2; border-radius: 3px; }
.sound-bars.active .bar {
  animation: animateBar .66s infinite alternate;
  background-color: #1f7cf8; height: 100%;
}
.sound-bars.active.user-bars .bar { background-color: #22c55e; }
.sound-bars.active .bar-1 { animation-delay: 0s; }
.sound-bars.active .bar-2 { animation-delay: 0.15s; }
.sound-bars.active .bar-3 { animation-delay: 0.3s; }
@keyframes animateBar { from { height: 100%; } to { height: 20%; } }

/* Indicator slot — sound bars and thinking bar share the same space */
.indicator-slot {
  width: 30px; height: 20px; position: relative;
  display: flex; align-items: center; justify-content: center;
}
.thinking-bar {
  width: 30px; height: 3px; background: #e5e7eb; border-radius: 2px;
  overflow: hidden; display: none; position: absolute;
}
.thinking-bar.visible { display: block; }
.thinking-bar-fill {
  height: 100%; width: 0%; border-radius: 2px; background: #f59e0b;
}
.thinking-bar-fill.loading {
  animation: thinkingLoad 3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes thinkingLoad {
  0% { width: 0%; }
  60% { width: 70%; }
  85% { width: 88%; }
  100% { width: 95%; }
}
/* Status text under the indicator */
.status-text {
  font-size: 11px; font-weight: 500; white-space: nowrap;
  color: #9aa0a6; transition: color 0.3s;
}
.status-text.listening { color: #22c55e; }
.status-text.thinking { color: #f59e0b; }
.status-text.speaking { color: #1f7cf8; }

/* Exhibit area — carousel */
.exhibit-area {
  display: none;
  background: white; border-radius: 5px;
  box-shadow: 0 12px 24px 0 rgba(0,0,0,0.1);
  padding: 20px; margin-bottom: 20px;
}
.exhibit-area.visible { display: block; }
.exhibit-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;
}
.exhibit-header h3 {
  font-size: 13px; font-weight: 600; color: #747474; text-transform: uppercase;
  letter-spacing: 0.5px; margin: 0;
}
.exhibit-nav {
  display: flex; align-items: center; gap: 8px;
}
.exhibit-nav button {
  width: 28px; height: 28px; border-radius: 50%; border: none;
  background: #1f7cf8; color: white; font-size: 14px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; padding: 0;
}
.exhibit-nav button:disabled { background: #d1d5db; cursor: default; }
.exhibit-counter {
  font-size: 13px; font-weight: 500; color: #747474; min-width: 36px; text-align: center;
}
.exhibit-slides { position: relative; text-align: center; }
.exhibit-slide {
  display: none;
}
.exhibit-slide.active { display: block; }
.exhibit-slide a { display: inline-block; width: 75%; }
.exhibit-slide img {
  max-width: 100%; border: 1px solid #e5e7eb; border-radius: 5px; cursor: pointer;
}

/* Bottom controls (minimal) */
.bottom-controls {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 16px 0; margin-bottom: 16px;
}
.btn-done-speaking {
  padding: 10px 24px; background: #f59e0b; color: white; border: none;
  border-radius: 5px; font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.15s;
}
.btn-done-speaking:hover { background: #d97706; }
.btn-pause {
  padding: 10px 24px; background: white; color: #747474;
  border: 1px solid #d1d5db; border-radius: 5px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.btn-pause:hover { border-color: #9ca3af; color: #3d3d3d; }
.btn-pause.paused { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }
.btn-skip {
  padding: 10px 24px; background: white; color: #747474;
  border: 1px solid #d1d5db; border-radius: 5px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.15s;
}
.btn-skip:hover { border-color: #9ca3af; color: #3d3d3d; }
.btn-skip:disabled { opacity: 0.5; cursor: not-allowed; }
#controls-default { display: flex; gap: 12px; align-items: center; justify-content: center; }

/* Paused controls */
#controls-paused {
  display: flex; gap: 12px; align-items: center; justify-content: center;
}
#controls-paused .btn-primary {
  padding: 10px 24px; font-size: 14px; font-weight: 500;
}
.btn-end {
  padding: 10px 24px; background: white; color: #dc2626;
  border: 1px solid #fca5a5; border-radius: 5px;
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: all 0.15s;
}
.btn-end:hover { background: #fef2f2; }

/* Post-interview feedback modal */
.feedback-modal-overlay {
  position: fixed; inset: 0; background: rgba(20, 30, 50, 0.55);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px 20px 40px; overflow-y: auto; z-index: 2000;
}
.feedback-modal-card {
  background: #ffffff; border-radius: 10px; box-shadow: 0 20px 50px rgba(0,0,0,0.18);
  width: 100%; max-width: 580px; padding: 32px 36px 28px; position: relative;
  font-family: 'DM Sans', sans-serif; color: #3d3d3d;
}
.feedback-rocket {
  width: 56px; height: 56px; border-radius: 50%; background: #ffffff;
  border: 1px solid #e5e7eb; display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px; overflow: hidden;
}
.feedback-rocket img { width: 40px; height: 40px; object-fit: contain; }
.feedback-modal-card h2 {
  font-size: 20px; font-weight: 700; text-align: center; margin: 0 0 6px;
}
.feedback-sub {
  font-size: 13px; color: #747474; text-align: center; margin: 0 0 24px;
}
.feedback-section { margin-bottom: 22px; }
.feedback-section-label {
  font-size: 14px; font-weight: 600; color: #3d3d3d; margin-bottom: 10px; text-align: left;
}
.feedback-section-label.center { text-align: center; }
.feedback-section-label .muted { font-weight: 400; color: #747474; font-size: 13px; }

.rating-row {
  display: flex; justify-content: space-between; gap: 6px; margin-bottom: 4px;
}
.rating-btn {
  flex: 1 1 0; aspect-ratio: 1 / 1; min-width: 0;
  background: #ffffff; border: 1px solid #d2d2d2; border-radius: 50%;
  font-family: 'DM Sans', sans-serif; font-size: 14px; font-weight: 600; color: #3d3d3d;
  cursor: pointer; transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.rating-btn:hover { background: #f4f6f9; border-color: #a0a0a0; }
.rating-btn.selected {
  background: #1f7cf8; border-color: #1f7cf8; color: #ffffff;
}
.rating-poles {
  display: flex; justify-content: space-between; font-size: 12px; color: #747474; margin-top: 2px;
}

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px; background: #ffffff; border: 1px solid #d2d2d2; border-radius: 999px;
  font-family: 'DM Sans', sans-serif; font-size: 13px; color: #3d3d3d;
  cursor: pointer; transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.chip:hover { background: #f4f6f9; border-color: #a0a0a0; }
.chip.selected {
  background: #e8f1fe; border-color: #1f7cf8; color: #1451a3;
}

#feedback-text {
  width: 100%; min-height: 90px; resize: vertical;
  padding: 10px 12px; border: 1px solid #d2d2d2; border-radius: 6px;
  font-family: 'DM Sans', sans-serif; font-size: 14px; color: #3d3d3d;
  background: #ffffff; box-sizing: border-box;
}
#feedback-text:focus { outline: none; border-color: #1f7cf8; }

.feedback-actions {
  display: flex; justify-content: space-between; align-items: center; margin-top: 6px;
}
#feedback-skip {
  font-size: 14px; color: #747474; text-decoration: none;
}
#feedback-skip:hover { color: #3d3d3d; text-decoration: underline; }
#feedback-submit { padding: 10px 22px; font-size: 14px; }
#feedback-submit:disabled { background: #b8d3fb; cursor: not-allowed; }

/* LLM provider toggle */
.llm-toggle {
  display: flex; align-items: center; gap: 8px; font-size: 13px; color: #747474;
}
.llm-toggle .toggle-track {
  width: 44px; height: 24px; border-radius: 12px; background: #d4a574;
  position: relative; cursor: pointer; transition: background 0.2s;
}
.llm-toggle .toggle-track.anthropic { background: #d4a574; }
.llm-toggle .toggle-track.openai { background: #10a37f; }
.llm-toggle .toggle-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: white;
  position: absolute; top: 2px; left: 2px; transition: left 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.llm-toggle .toggle-track.openai .toggle-thumb { left: 22px; }
.llm-toggle .provider-label { font-weight: 600; min-width: 55px; }

/* ─── Loading state ──────────────────────────────────────────────── */
.case-loading {
  text-align: center; padding: 60px 20px; color: #747474; font-size: 15px;
}
.case-loading .spinner {
  width: 32px; height: 32px; border: 3px solid #e5e7eb;
  border-top-color: #1f7cf8; border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.case-error { color: #dc2626; text-align: center; padding: 40px; }