/* ========================================
   AI Interview Caller — Admin Dashboard
   Clean white aesthetic, professional HR-tool feel
   ======================================== */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --white: #ffffff;
  --gray-50: #fafafa;
  --gray-100: #f5f5f5;
  --gray-200: #e8e8e8;
  --gray-300: #d4d4d4;
  --gray-400: #a3a3a3;
  --gray-500: #737373;
  --gray-600: #525252;
  --gray-700: #404040;
  --gray-800: #262626;
  --gray-900: #171717;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-light: #eff6ff;

  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --danger-light: #fef2f2;

  --amber: #f59e0b;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;

  --green: #16a34a;
  --green-bg: #f0fdf4;
  --green-border: #bbf7d0;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
  --shadow-card-hover: 0 4px 12px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
  --shadow-modal: 0 16px 48px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.04);

  --transition: 150ms ease;
  --transition-smooth: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

html,
body {
  background: var(--gray-50);
  color: var(--gray-900);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#root {
  min-height: 100vh;
}

/* --- App Layout --- */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Top Bar --- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 56px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

/* --- Content Area --- */
.content {
  flex: 1;
  padding: 2rem;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.content-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.content-subtitle {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-top: 0.125rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: var(--font-sans);
  line-height: 1.4;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-smooth);
  white-space: nowrap;
  gap: 0.375rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* L2: Focus-visible outlines for keyboard navigation */
.btn:focus-visible,
.link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.2);
}

.btn-outline {
  background: var(--white);
  color: var(--gray-700);
  border-color: var(--gray-300);
}

.btn-outline:hover:not(:disabled) {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.btn-ghost {
  background: transparent;
  color: var(--gray-600);
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--gray-100);
  color: var(--gray-800);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-xs {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
}

.btn-danger {
  background: var(--danger);
  color: var(--white);
  border-color: var(--danger);
}

.btn-danger:hover:not(:disabled) {
  background: var(--danger-hover);
  border-color: var(--danger-hover);
}

.btn-danger-text {
  color: var(--danger);
}

.btn-danger-text:hover:not(:disabled) {
  background: var(--danger-light);
  color: var(--danger-hover);
}

/* --- Login Page --- */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--gray-50);
}

.login-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.375rem;
}

.login-subtitle {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.login-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-700);
}

.login-input {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--gray-900);
  transition: border-color var(--transition);
  outline: none;
}

.login-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-error {
  font-size: 0.8125rem;
  color: var(--danger);
  padding: 0.5rem 0.75rem;
  background: var(--danger-light);
  border-radius: var(--radius-sm);
}

.login-btn {
  margin-top: 0.25rem;
}

/* --- Job Cards --- */
.jobs-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.job-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow var(--transition-smooth), transform var(--transition-smooth);
}

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

.job-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: var(--white);
  border-bottom: 1px solid var(--gray-100);
}

.job-header-left {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  min-width: 0;
}

.job-name {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--gray-900);
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.job-meta-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.job-candidate-count {
  font-size: 0.8125rem;
  color: var(--gray-500);
  font-weight: 500;
}

.job-status-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot-pending { background: var(--gray-400); }
.status-dot-invited { background: var(--amber); }
.status-dot-completed { background: var(--green); }

.job-status-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gray-600);
  padding: 0.125rem 0;
}

.job-header-right {
  display: flex;
  gap: 0.375rem;
  flex-shrink: 0;
}

/* --- Confirm Bar --- */
.confirm-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1.5rem;
  background: var(--danger-light);
  border-bottom: 1px solid #fecaca;
  font-size: 0.875rem;
  color: var(--danger);
  font-weight: 500;
}

.confirm-actions {
  display: flex;
  gap: 0.5rem;
}

.confirm-actions .btn-ghost {
  color: var(--gray-600);
}

.confirm-actions .btn-ghost:hover {
  color: var(--gray-800);
}

/* --- Job Sections (inside card) --- */
.job-section {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
}

.job-section:last-of-type {
  border-bottom: none;
}

.section-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.625rem;
}

/* --- Description Display/Editor --- */
.desc-empty {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.desc-empty-text {
  font-size: 0.875rem;
  color: var(--gray-400);
  font-style: italic;
}

.desc-display {
  position: relative;
}

.desc-text {
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--gray-700);
  white-space: pre-wrap;
  max-height: 4.5em;
  overflow: hidden;
  position: relative;
}

.desc-display .btn-ghost {
  position: absolute;
  top: -0.25rem;
  right: -0.5rem;
}

.desc-editor {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.desc-textarea {
  width: 100%;
  padding: 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  line-height: 1.6;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  resize: vertical;
  outline: none;
  color: var(--gray-900);
  background: var(--white);
  transition: border-color var(--transition);
}

.desc-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.desc-actions {
  display: flex;
  gap: 0.5rem;
}

/* --- Forms --- */
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.375rem;
}

.form-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 0.25rem;
  line-height: 1.4;
}

.form-input {
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-family: var(--font-sans);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background: var(--white);
  color: var(--gray-900);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-error {
  font-size: 0.8125rem;
  color: var(--danger);
  padding: 0.375rem 0.625rem;
  background: var(--danger-light);
  border-radius: var(--radius-sm);
  margin-top: 0.25rem;
}

/* --- Add Candidate Form --- */
.add-candidate-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.add-candidate-form .form-input {
  flex: 1;
  min-width: 0;
}

.add-candidate-form .form-input:last-of-type {
  flex: 1.2;
}

/* --- Bulk Upload --- */
.bulk-upload-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px dashed var(--gray-200);
}

.file-input {
  font-size: 0.8125rem;
  color: var(--gray-600);
}

.file-input::file-selector-button {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
  font-family: var(--font-sans);
  font-weight: 500;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--gray-700);
  cursor: pointer;
  transition: all var(--transition);
  margin-right: 0.5rem;
}

.file-input::file-selector-button:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
}

.upload-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--green);
  font-weight: 500;
  margin-top: 0.5rem;
}

.upload-result-dismiss {
  background: none;
  border: none;
  color: var(--gray-400);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
  transition: color var(--transition);
}

.upload-result-dismiss:hover {
  color: var(--gray-700);
}

/* --- Action Messages --- */
.action-message {
  padding: 0.625rem 1rem;
  font-size: 0.8125rem;
  border-radius: var(--radius-sm);
  margin: 0 1.5rem;
}

.action-message-error {
  color: var(--danger);
  background: var(--danger-light);
}

.inline-error {
  font-size: 0.75rem;
  color: var(--danger);
  margin-top: 0.375rem;
}

/* --- Candidate Table --- */
.candidate-table-wrapper {
  overflow-x: auto;
  padding: 0 1.5rem 1rem;
}

.candidate-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.candidate-table thead {
  border-bottom: 2px solid var(--gray-200);
}

.candidate-table th {
  text-align: left;
  padding: 0.75rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.candidate-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition);
}

.candidate-table tbody tr:hover {
  background: var(--gray-50);
}

.candidate-table td {
  padding: 0.625rem 0.625rem;
  vertical-align: middle;
}

.td-name {
  font-weight: 500;
  color: var(--gray-900);
}

.td-email {
  color: var(--gray-600);
}

/* --- Links --- */
.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.8125rem;
  transition: color var(--transition);
}

.link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

/* --- CV Upload (inline) --- */
.cv-upload-label {
  display: inline-flex;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--accent);
  cursor: pointer;
  font-weight: 500;
}

.cv-upload-label:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.cv-upload-input {
  display: none;
}

/* --- Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1875rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 999px;
  white-space: nowrap;
}

.badge-gray {
  background: var(--gray-100);
  color: var(--gray-600);
}

.badge-amber {
  background: var(--amber-bg);
  color: #92400e;
  border: 1px solid var(--amber-border);
}

.badge-green {
  background: var(--green-bg);
  color: #166534;
  border: 1px solid var(--green-border);
}

/* --- Actions Cell --- */
.td-actions {
  min-width: 240px;
}

.actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  align-items: center;
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 1rem;
  animation: modalOverlayIn 0.2s ease;
}

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

.modal-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  padding: 2rem;
  width: 100%;
  max-width: 440px;
  animation: modalCardIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalCardIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.modal-message {
  font-size: 0.9375rem;
  color: var(--gray-600);
  margin-bottom: 0.5rem;
}

.modal-card .form-input,
.modal-card .desc-textarea {
  width: 100%;
  margin-bottom: 0.5rem;
}

.modal-card .form-label + .form-input {
  margin-bottom: 1rem;
}

.modal-card .desc-textarea {
  margin-bottom: 0.25rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--gray-100);
}

/* --- Empty States --- */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 5rem 2rem;
  text-align: center;
  animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  font-size: 2rem;
}

.empty-text {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.375rem;
}

.empty-subtext {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
  max-width: 320px;
  line-height: 1.5;
}

/* --- Table States --- */
.table-loading,
.table-error,
.table-empty {
  padding: 2rem 1.5rem;
  font-size: 0.875rem;
  color: var(--gray-500);
  text-align: center;
}

.table-error {
  color: var(--danger);
}

/* --- Page Loading --- */
.page-loading {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--gray-500);
  font-size: 0.9375rem;
}

/* --- Candidate Section Toggle --- */
.candidate-section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background var(--transition-smooth);
  user-select: none;
}

.candidate-section-toggle:hover {
  background: var(--gray-100);
}

.candidate-section-toggle .section-label {
  margin-bottom: 0;
}

.candidate-section-chevron {
  font-size: 0.75rem;
  color: var(--gray-400);
  transition: transform var(--transition-smooth);
}

.candidate-section-chevron.open {
  transform: rotate(180deg);
}

/* --- Candidate Section Collapse Animation --- */
.candidate-section-body {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
}

.candidate-section-body.collapsed {
  max-height: 0;
  opacity: 0;
}

.candidate-section-body.expanded {
  max-height: 2000px;
  opacity: 1;
}

/* --- Card Entrance Animation --- */
.job-card-enter {
  animation: cardEnter 0.35s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Report Page --- */
.report-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 2rem;
  max-width: 700px;
}

.report-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
}

.report-grid {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.report-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.report-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-value {
  font-size: 0.9375rem;
  color: var(--gray-800);
}

.report-value-text {
  line-height: 1.65;
  white-space: pre-wrap;
}

/* ========================================
   INTERVIEW PAGE — Candidate-facing
   ======================================== */

/* --- Status Pill (header) --- */
.interview-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.interview-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  display: inline-block;
}

.interview-status-dot.pulse {
  animation: statusPulse 1.8s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* --- Content Area Overrides --- */
.interview-content {
  max-width: 720px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Center Stage (idle, connecting, ended, error) --- */
.interview-center {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  width: 100%;
  min-height: calc(100vh - 56px - 4rem);
}

.interview-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 440px;
}

.interview-hero-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.interview-hero-title {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}

.interview-hero-subtitle {
  font-size: 0.9375rem;
  color: var(--gray-500);
  line-height: 1.65;
  margin-bottom: 2rem;
}

.btn-lg {
  padding: 0.75rem 1.75rem;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  gap: 0.5rem;
}

/* --- Mic Error --- */
.interview-mic-error {
  background: var(--danger-light);
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  text-align: center;
  max-width: 100%;
}

.interview-mic-error p {
  font-size: 0.875rem;
  color: var(--danger);
  margin-bottom: 0.75rem;
  line-height: 1.5;
}

/* --- Spinner (connecting) --- */
.interview-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 1.5rem;
}

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

/* --- Live View --- */
.interview-live {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
  min-height: 0;
}

/* --- AI Speaking Bar --- */
.ai-speaking-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1rem;
  background: var(--accent-light);
  border: 1px solid #dbeafe;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--accent);
  animation: fadeIn 0.2s ease;
}

.ai-speaking-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: speakingPulse 1s ease-in-out infinite;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Transcript Panel --- */
.interview-transcript {
  flex: 1;
  min-height: 300px;
  max-height: calc(100vh - 56px - 12rem);
  overflow-y: auto;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  background: var(--white);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  scroll-behavior: smooth;
}

.transcript-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 0.875rem;
  font-style: italic;
}

.transcript-entry {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: 85%;
  animation: transcriptIn 0.25s ease;
}

@keyframes transcriptIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.transcript-ai {
  align-self: flex-start;
}

.transcript-candidate {
  align-self: flex-end;
}

.transcript-role {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
}

.transcript-ai .transcript-role {
  color: var(--accent);
}

.transcript-text {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--gray-800);
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
}

.transcript-ai .transcript-text {
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
}

.transcript-ai.transcript-streaming .transcript-text {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  opacity: 0.92;
}

.transcript-candidate .transcript-text {
  background: var(--accent-light);
  border: 1px solid #dbeafe;
}

/* --- Controls Bar --- */
.interview-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 0.75rem 0;
}

/* --- Push-to-talk Button --- */
.talk-btn {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  min-width: 220px;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
  transition: transform var(--transition-smooth), background var(--transition-smooth);
}

.talk-btn:active:not(:disabled),
.talk-btn-active {
  transform: scale(0.97);
  filter: brightness(0.95);
}

.talk-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  box-shadow: none;
}

.talk-btn-active {
  background: var(--danger);
  border-color: var(--danger);
  color: var(--white);
  animation: talkPulse 1.1s ease-in-out infinite;
}

@keyframes talkPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
  50% { box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
}

/* --- Completion Card --- */
.interview-complete-card {
  animation: cardAppear 0.4s ease;
}

@keyframes cardAppear {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.interview-complete-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--green-bg);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.interview-report-note {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 1.5rem;
}

/* --- Error Card --- */
.interview-error-card {
  animation: cardAppear 0.4s ease;
}

.interview-error-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--danger-light);
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.interview-error-actions {
  display: flex;
  gap: 0.75rem;
}

/* ========================================
   REPORT PAGE — Enhanced
   ======================================== */

.report-header {
  margin-bottom: 1.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

.report-candidate-name {
  font-size: 0.9375rem;
  color: var(--gray-500);
  margin-top: 0.25rem;
}

/* --- Score + Recommendation Row --- */
.report-top-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.report-score-card,
.report-recommendation-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
}

.report-score-block {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.report-score-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gray-900);
  line-height: 1;
  letter-spacing: -0.02em;
}

.report-score-max {
  font-size: 1rem;
  font-weight: 400;
  color: var(--gray-400);
  display: inline;
}

.report-score-bar {
  height: 6px;
  background: var(--gray-200);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.375rem;
}

.report-score-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.report-recommendation-badge {
  display: inline-flex;
  align-self: flex-start;
  padding: 0.375rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: 0.01em;
}

/* --- Report Sections --- */
.report-section {
  margin-bottom: 1.75rem;
}

.report-section:last-child {
  margin-bottom: 0;
}

.report-section-title {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.report-section-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.report-summary-text {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--gray-700);
  white-space: pre-wrap;
}

/* --- Strengths / Weaknesses Lists --- */
.report-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.report-list-item {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--gray-700);
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  position: relative;
  padding-left: 1.75rem;
}

.report-list .report-list-item::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0.875rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.report-list-weak .report-list-item::before {
  background: var(--amber);
}

/* --- Empty State Icon --- */

/* --- Responsive tweaks --- */
@media (max-width: 768px) {
  .content {
    padding: 1rem;
  }

  .topbar {
    padding: 0 1rem;
  }

  .add-candidate-form {
    flex-direction: column;
    align-items: stretch;
  }

  .add-candidate-form .form-input {
    flex: none;
  }

  .job-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .confirm-bar {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .job-status-badges {
    margin-top: 0.25rem;
  }

  /* Interview page mobile */
  .interview-content {
    max-width: 100%;
  }

  .interview-transcript {
    min-height: 200px;
    max-height: calc(100vh - 56px - 10rem);
    padding: 1rem;
  }

  .transcript-entry {
    max-width: 95%;
  }

  .report-top-row {
    flex-direction: column;
    gap: 1rem;
  }

  .report-card {
    padding: 1.25rem;
  }

  .interview-hero-title {
    font-size: 1.125rem;
  }

  .report-score-value {
    font-size: 2rem;
  }
}

/* ==========================================================================
   Real-Time Conversational Voice Enhancements
   ========================================================================== */

.interview-tips-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 0.875rem 1.25rem;
  margin-bottom: 1.25rem;
  text-align: left;
  max-width: 440px;
  font-size: 0.8125rem;
  color: var(--gray-600);
}

.interview-tip-item {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.tip-bullet {
  font-size: 1rem;
  line-height: 1;
}

/* --- Live Conversational State Banner --- */
.conversation-live-banner {
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.25s ease;
  font-size: 0.875rem;
  font-weight: 500;
}

.conversation-live-banner.ai-speaking {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.conversation-live-banner.ai-thinking {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  color: #6b21a8;
}

.conversation-live-banner.listening {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.status-banner-content {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.banner-text {
  flex: 1;
}

.interrupt-btn {
  background: var(--white);
  border-color: #93c5fd;
  color: #1d4ed8;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.interrupt-btn:hover {
  background: #dbeafe;
}

/* --- Speaking Waveform Animation --- */
.speaking-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 16px;
}

.wave-bar {
  display: inline-block;
  width: 3px;
  height: 100%;
  background: #2563eb;
  border-radius: 2px;
  animation: waveAnimation 1s ease-in-out infinite;
}

.wave-bar:nth-child(1) { animation-delay: 0.0s; height: 40%; }
.wave-bar:nth-child(2) { animation-delay: 0.2s; height: 90%; }
.wave-bar:nth-child(3) { animation-delay: 0.4s; height: 60%; }
.wave-bar:nth-child(4) { animation-delay: 0.1s; height: 80%; }

@keyframes waveAnimation {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

/* --- Thinking Dots Animation --- */
.thinking-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.thinking-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #9333ea;
  animation: bounceDot 1.4s infinite ease-in-out both;
}

.thinking-dots span:nth-child(1) { animation-delay: -0.32s; }
.thinking-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounceDot {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* --- Mic Activity Indicator --- */
.mic-indicator-active {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 36px;
}

.mic-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  animation: speakingPulse 1.2s ease-in-out infinite;
}

/* --- Real-time Interim Candidate Speech Bubble --- */
.transcript-interim {
  opacity: 0.85;
}

.transcript-interim .transcript-role {
  color: #2563eb;
  font-weight: 600;
}

.interim-bubble {
  border-style: dashed !important;
  background: #f8fafc !important;
  border-color: #93c5fd !important;
  color: #1e293b !important;
}

.typing-cursor {
  display: inline-block;
  width: 6px;
  height: 12px;
  background: #2563eb;
  margin-left: 4px;
  vertical-align: middle;
  animation: blink 0.8s infinite;
}

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

/* --- Thinking Bubble Inside Transcript --- */
.thinking-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  width: fit-content;
}

.thinking-bubble .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-400);
  animation: bounceDot 1.4s infinite ease-in-out both;
}

.thinking-bubble .dot:nth-child(1) { animation-delay: -0.32s; }
.thinking-bubble .dot:nth-child(2) { animation-delay: -0.16s; }

/* --- Mic Meter in Controls Bar --- */
.mic-status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.6rem;
  position: relative;
  overflow: hidden;
}

.mic-circle {
  font-size: 0.875rem;
  z-index: 1;
}

.mic-meter-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(34, 197, 94, 0.25);
  transition: width 0.08s ease;
  pointer-events: none;
}
