/* ================================================================
   benimhakkimda — AI Interview Module
   Professional Design System · v2.0
   ================================================================ */

/* ── 1. DESIGN TOKENS ─────────────────────────────────────── */
:root {
  /* Surface Scale */
  --surface-0:  #080c14;   /* Deepest background */
  --surface-1:  #0d1220;   /* App shell background */
  --surface-2:  #121828;   /* Card background */
  --surface-3:  #1a2235;   /* Elevated card / input */
  --surface-4:  #1f2a3e;   /* Hover state */
  --surface-5:  #263048;   /* Active / selected */

  /* Typography */
  --text-primary:   #e8ecf4;
  --text-secondary: #8392a8;
  --text-muted:     #4a5670;
  --text-disabled:  #334060;

  /* Brand Accent — Slate Blue */
  --accent:         #4f7ef5;
  --accent-light:   #7ba4f8;
  --accent-dim:     rgba(79, 126, 245, 0.12);
  --accent-border:  rgba(79, 126, 245, 0.25);

  /* Semantic */
  --success:        #2dd4aa;
  --success-dim:    rgba(45, 212, 170, 0.1);
  --success-border: rgba(45, 212, 170, 0.25);
  --warning:        #f4b942;
  --warning-dim:    rgba(244, 185, 66, 0.1);
  --warning-border: rgba(244, 185, 66, 0.25);
  --danger:         #f46060;
  --danger-dim:     rgba(244, 96, 96, 0.1);
  --danger-border:  rgba(244, 96, 96, 0.25);
  --info:           #4fbff4;
  --info-dim:       rgba(79, 191, 244, 0.1);
  --info-border:    rgba(79, 191, 244, 0.25);

  /* Borders */
  --border:        rgba(255, 255, 255, 0.055);
  --border-medium: rgba(255, 255, 255, 0.10);

  /* Radius */
  --r-xs:   4px;
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   16px;
  --r-xl:   20px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 4px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.35);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);

  /* Transition */
  --t-fast:   0.12s ease;
  --t-base:   0.22s ease;
  --t-slow:   0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--surface-0);
  color: var(--text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

ul { list-style: none; }

::selection {
  background-color: rgba(79, 126, 245, 0.3);
  color: var(--text-primary);
}

/* ── 3. APP SHELL ──────────────────────────────────────────── */
.app-shell {
  width: 100%;
  max-width: 1080px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── 4. HEADER ─────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(13, 18, 32, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}

.app-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  padding: 0 28px;
}

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

.brand-mark {
  width: 28px;
  height: 28px;
  background-color: var(--text-primary);
  color: var(--surface-1);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-weight: 900;
  font-size: 0.85rem;
  line-height: 1;
  flex-shrink: 0;
}

.brand-name {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.brand-dot {
  color: var(--accent);
}

.session-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
}

.session-meta-item {
  color: var(--text-primary);
}

.session-meta-sep {
  width: 1px;
  height: 14px;
  background-color: var(--border-medium);
  margin: 0 4px;
}

.session-meta .icon-sm {
  width: 14px;
  height: 14px;
  color: var(--text-secondary);
}

/* ── 5. WIDGET STEPS (SPA) ─────────────────────────────────── */
.widget-step {
  flex: 1;
  padding: 40px 28px;
  animation: fadeStep 0.35s ease;
}

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

/* ── 6. SETUP PAGE ─────────────────────────────────────────── */
.setup-container {
  max-width: 780px;
  margin: 0 auto;
}

.setup-intro {
  margin-bottom: 36px;
}

.section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}

.page-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 10px;
}

.page-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.65;
  max-width: 560px;
}

.setup-form {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* CV Upload Area */
.cv-field-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.cv-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--surface-3);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-sm);
  padding: 5px 10px;
  cursor: pointer;
  transition: all var(--t-base);
  white-space: nowrap;
  flex-shrink: 0;
}

.cv-upload-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-border);
  background-color: var(--surface-4);
}

.cv-upload-btn svg {
  width: 13px;
  height: 13px;
}

.cv-upload-status {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--success-dim);
  border: 1px solid var(--success-border);
  border-radius: var(--r-sm);
  padding: 7px 12px;
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 600;
  margin-bottom: 8px;
}

.cv-upload-status svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.cv-upload-status span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cv-upload-clear {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--success);
  display: grid;
  place-items: center;
  padding: 2px;
  border-radius: 4px;
  opacity: 0.7;
  transition: opacity var(--t-fast);
  flex-shrink: 0;
}

.cv-upload-clear:hover { opacity: 1; }
.cv-upload-clear svg { width: 13px; height: 13px; }

/* Form Fields */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.field-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.field-optional {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
  background-color: var(--surface-3);
  padding: 2px 8px;
  border-radius: var(--r-full);
  border: 1px solid var(--border);
}

.field-input,
.field-textarea {
  background-color: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 11px 14px;
  color: var(--text-primary);
  font-size: 0.92rem;
  transition: border-color var(--t-base), box-shadow var(--t-base);
  width: 100%;
}

.field-input::placeholder,
.field-textarea::placeholder {
  color: var(--text-muted);
}

.field-input:focus,
.field-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79, 126, 245, 0.15);
}

.field-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.55;
}

/* Segmented Control */
.seg-control {
  display: flex;
  background-color: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 3px;
  gap: 2px;
}

.seg-btn {
  flex: 1;
  padding: 7px 10px;
  border: none;
  border-radius: calc(var(--r-md) - 4px);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}

.seg-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255,255,255,0.04);
}

.seg-btn.active {
  background-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

/* Mode Cards */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.mode-card {
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  cursor: pointer;
  transition: all var(--t-base);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mode-card:hover {
  background-color: var(--surface-3);
  border-color: var(--border-medium);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.mode-card.selected {
  border-color: var(--accent-border);
  background-color: var(--accent-dim);
  box-shadow: 0 0 0 1px var(--accent-border);
}

.mode-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mode-icon-wrap {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background-color: var(--surface-3);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.mode-card.selected .mode-icon-wrap {
  background-color: rgba(79, 126, 245, 0.15);
}

.mode-icon-wrap svg {
  width: 16px;
  height: 16px;
  color: var(--text-secondary);
}

.mode-card.selected .mode-icon-wrap svg {
  color: var(--accent);
}

.mode-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.mode-duration {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
}

.mode-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent);
}

.mode-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mode-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Toggle Switch */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
}

.toggle-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toggle-row-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.toggle-row-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.toggle-label {
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  display: block;
  width: 42px;
  height: 24px;
  background-color: var(--surface-4);
  border: 1px solid var(--border-medium);
  border-radius: var(--r-full);
  position: relative;
  transition: background-color var(--t-base);
}

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

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background-color: #fff;
  border-radius: 50%;
  transition: transform var(--t-base);
  box-shadow: var(--shadow-sm);
}

.toggle-input:checked + .toggle-track .toggle-thumb {
  transform: translateX(18px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 0.88rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--t-base);
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn:not(:disabled):hover {
  transform: translateY(-1px);
}

.btn:not(:disabled):active {
  transform: translateY(0);
}

/* Primary */
.btn-primary {
  background-color: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:not(:disabled):hover {
  background-color: var(--accent-light);
  border-color: var(--accent-light);
  box-shadow: 0 4px 16px rgba(79, 126, 245, 0.35);
}

/* Secondary */
.btn-secondary {
  background-color: var(--surface-3);
  color: var(--text-primary);
  border-color: var(--border-medium);
}
.btn-secondary:not(:disabled):hover {
  background-color: var(--surface-4);
}

/* Ghost */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:not(:disabled):hover {
  color: var(--text-primary);
  background-color: rgba(255,255,255,0.05);
}

/* Outline Icon style */
.btn-outline-icon {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border-medium);
}
.btn-outline-icon:not(:disabled):hover {
  color: var(--text-primary);
  border-color: var(--border-medium);
  background-color: var(--surface-3);
}

/* Danger Outline */
.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-border);
}
.btn-danger-outline:not(:disabled):hover {
  background-color: var(--danger-dim);
}

/* Size Variants */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.80rem;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 0.95rem;
}

.btn-full {
  width: 100%;
  padding: 13px 24px;
  font-size: 0.95rem;
}

/* ── 7. INTERVIEW PAGE ─────────────────────────────────────── */
.interview-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  align-items: start;
}

/* Sidebar */
.interview-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: sticky;
  top: 76px;
}

.ai-presenter-card {
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px 16px;
  text-align: center;
}

.ai-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 16px;
}

.ai-role {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

.orb-status-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 8px;
}

/* Voice Orb */
.orb-stage {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto;
  display: grid;
  place-items: center;
}

.orb {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(145deg, #4f7ef5, #2a5adb);
  position: relative;
  z-index: 2;
  box-shadow: 0 0 20px rgba(79, 126, 245, 0.3);
  transition: box-shadow var(--t-base);
}

.orb-core {
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background-color: var(--surface-2);
}

.orb-shine {
  position: absolute;
  top: 8px;
  left: 10px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255,255,255,0.18);
}

.orb-rings span {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 1px solid rgba(79,126,245,0.4);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.orb-bars {
  position: absolute;
  bottom: -2px;
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 16px;
  opacity: 0;
  transition: opacity var(--t-base);
}

.orb-bars span {
  width: 2px;
  background-color: var(--accent);
  border-radius: 2px;
}

/* Orb States */
[data-state="speaking"] .orb-rings span {
  animation: orbRipple 1.8s cubic-bezier(0.1, 0.8, 0.3, 1) infinite;
}
[data-state="speaking"] .orb-rings span:nth-child(2) { animation-delay: 0.45s; }
[data-state="speaking"] .orb-rings span:nth-child(3) { animation-delay: 0.9s; }
[data-state="speaking"] .orb { box-shadow: 0 0 32px rgba(79,126,245,0.5); }
[data-state="speaking"] .orb-bars { opacity: 1; }
[data-state="speaking"] .orb-bars span:nth-child(1) { height: 8px;  animation: barBounce 0.55s ease-in-out infinite; }
[data-state="speaking"] .orb-bars span:nth-child(2) { height: 14px; animation: barBounce 0.55s ease-in-out infinite 0.10s; }
[data-state="speaking"] .orb-bars span:nth-child(3) { height: 16px; animation: barBounce 0.55s ease-in-out infinite 0.20s; }
[data-state="speaking"] .orb-bars span:nth-child(4) { height: 10px; animation: barBounce 0.55s ease-in-out infinite 0.30s; }
[data-state="speaking"] .orb-bars span:nth-child(5) { height: 6px;  animation: barBounce 0.55s ease-in-out infinite 0.40s; }

[data-state="listening"] .orb {
  animation: orbPulse 1.3s ease-in-out infinite;
  box-shadow: 0 0 36px rgba(45,212,170,0.45);
  background: linear-gradient(145deg, #2dd4aa, #1a9e7d);
}

[data-state="thinking"] .orb {
  animation: orbSpin 2.2s linear infinite;
  background: linear-gradient(145deg, #f4b942, #d48e20);
  box-shadow: 0 0 24px rgba(244,185,66,0.35);
}

[data-state="feedback"] .orb {
  background: linear-gradient(145deg, #2dd4aa, #1a9e7d);
  box-shadow: 0 0 28px rgba(45,212,170,0.4);
}

/* Session Info Card */
.session-info-card {
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.session-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
}

.info-label {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Interview Workspace */
.interview-workspace {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Question Card */
.question-card {
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  border-left: 3px solid var(--accent);
}

.question-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.question-num-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  background-color: var(--accent-dim);
  border: 1px solid var(--accent-border);
  border-radius: var(--r-full);
  padding: 3px 10px;
}

.question-live-tag {
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.question-text {
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 700;
  line-height: 1.55;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.question-coach-tip {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  border-left: 2px solid var(--border-medium);
  padding-left: 10px;
}

/* Answer Card */
.answer-card {
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 24px;
}

.answer-card-header {
  margin-bottom: 12px;
}

.answer-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Textarea + embedded mic */
.textarea-wrap {
  position: relative;
}

.answer-textarea {
  width: 100%;
  background-color: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 48px 12px 14px; /* right padding for mic */
  color: var(--text-primary);
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 120px;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

.answer-textarea::placeholder {
  color: var(--text-muted);
}

.answer-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(79,126,245,0.12);
}

.choice-panel {
  display: grid;
  gap: 10px;
}

.choice-option {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background-color: var(--surface-3);
  color: var(--text-primary);
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.45;
  cursor: pointer;
  transition: border-color var(--t-base), background-color var(--t-base), box-shadow var(--t-base);
}

.choice-option:hover,
.choice-option.selected {
  border-color: var(--accent);
  background-color: rgba(79,126,245,0.08);
}

.choice-option.selected {
  box-shadow: 0 0 0 3px rgba(79,126,245,0.12);
}

.choice-key {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--r-sm);
  background-color: var(--surface-4);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.78rem;
}

/* Embedded mic button */
.mic-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-medium);
  background-color: var(--surface-4);
  color: var(--text-secondary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all var(--t-base);
  z-index: 2;
}

.mic-btn:hover {
  background-color: var(--surface-5);
  color: var(--text-primary);
  border-color: var(--accent-border);
}

.mic-btn svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* Recording active state */
.mic-btn.recording {
  background-color: var(--danger-dim);
  border-color: var(--danger-border);
  color: var(--danger);
  animation: recGlow 1.4s ease-in-out infinite;
}

@keyframes recGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(244, 96, 96, 0); }
  50%       { box-shadow: 0 0 0 4px rgba(244, 96, 96, 0.2); }
}

/* Show/hide mic icons based on recording state */
.mic-icon--on  { display: none; }
.mic-icon--off { display: block; }
.mic-btn.recording .mic-icon--on  { display: block; }
.mic-btn.recording .mic-icon--off { display: none; }

/* Recording overlay inside textarea */
.rec-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(13,18,32,0.96) 70%, transparent);
  border-radius: 0 0 var(--r-md) var(--r-md);
  padding: 8px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--danger);
  animation: recBlink 1s ease-in-out infinite;
  flex-shrink: 0;
}

.rec-wave {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}

.rec-wave span {
  width: 2px;
  background-color: var(--danger);
  border-radius: 2px;
  animation: barBounce 0.4s ease-in-out infinite;
}

.rec-wave span:nth-child(1) { height: 5px; }
.rec-wave span:nth-child(2) { height: 10px; animation-delay: 0.08s; }
.rec-wave span:nth-child(3) { height: 14px; animation-delay: 0.16s; }
.rec-wave span:nth-child(4) { height: 8px;  animation-delay: 0.24s; }
.rec-wave span:nth-child(5) { height: 4px;  animation-delay: 0.32s; }

.rec-text {
  color: var(--danger);
  font-weight: 600;
  font-size: 0.78rem;
}

/* Answer Controls */
.answer-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.answer-controls-right {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

/* Info Panels */
.info-panel {
  border-radius: var(--r-lg);
  padding: 20px 24px;
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  animation: slideIn 0.28s ease;
}

.info-panel--hint {
  border-left: 3px solid var(--info);
}

.info-panel--improve {
  border-left: 3px solid var(--accent);
}

.info-panel-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}

.info-panel--hint .info-panel-header { color: var(--info); }
.info-panel--improve .info-panel-header { color: var(--accent); }

.info-panel-header svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.info-panel-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 14px;
}

/* Tag List */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background-color: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 3px 9px;
}

/* STAR Grid */
.star-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
}

.star-item {
  display: flex;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.star-key {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  background-color: rgba(244,185,66,0.15);
  color: var(--warning);
  font-size: 0.7rem;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.star-item strong {
  color: var(--warning);
  font-weight: 700;
  margin-right: 4px;
}

/* Feedback Panel */
.feedback-panel {
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  animation: slideIn 0.32s ease;
}

.feedback-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.feedback-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--success);
}

.feedback-header-left svg {
  width: 15px;
  height: 15px;
}

.feedback-summary-text {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  background-color: var(--surface-3);
  border-radius: var(--r-sm);
  padding: 10px 14px;
  margin-bottom: 20px;
  line-height: 1.5;
  border-left: 2px solid var(--success);
}

.feedback-summary-text.is-correct {
  border-left-color: var(--success);
  background-color: rgba(22, 163, 74, 0.12);
}

.feedback-summary-text.is-wrong {
  border-left-color: var(--danger);
  background-color: rgba(239, 68, 68, 0.12);
}

.feedback-summary-text.is-neutral {
  border-left-color: var(--warning);
}

.answer-result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.answer-result-item {
  background-color: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
}

.answer-result-text {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.45;
}

.feedback-panel.is-multiple-choice .score-key {
  text-transform: none;
  letter-spacing: 0;
}

.feedback-panel.is-wrong .feedback-header-left,
.feedback-panel.is-wrong .score-val {
  color: var(--danger);
}

.feedback-panel.is-correct .feedback-header-left,
.feedback-panel.is-correct .score-val {
  color: var(--success);
}

/* Score Trio */
.score-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.score-cell {
  background-color: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 8px;
  text-align: center;
}

.score-val {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.score-key {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Feedback Detail Grid */
.feedback-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.feedback-detail-item {
  background-color: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
}

.feedback-detail-item--full {
  grid-column: 1 / -1;
}

.detail-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.detail-label--success { color: var(--success); }
.detail-label--warning { color: var(--warning); }
.detail-label--accent  { color: var(--accent); }

.detail-text {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.feedback-list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.6;
}

.feedback-list li + li {
  margin-top: 6px;
}

.feedback-list--ordered {
  padding-left: 20px;
}

.feedback-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* ── 8. REPORT PAGE ────────────────────────────────────────── */
.report-container {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.report-intro {
  margin-bottom: 8px;
}

/* Score + Chart */
.report-score-row {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 16px;
}

.score-circle-card {
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.score-ring {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) 0deg, var(--surface-3) 0deg);
  display: grid;
  place-items: center;
  position: relative;
  transition: background 1s ease;
}

.score-ring::after {
  content: '';
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background-color: var(--surface-2);
}

.score-ring-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.score-ring-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
}

.score-ring-max {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.score-ring-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-align: center;
}

.chart-card {
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px 24px;
}

.chart-wrap {
  position: relative;
  height: 180px;
  margin-top: 12px;
}

.card-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

/* Strengths & Weaknesses */
.report-sw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sw-card {
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 20px;
}

.sw-card--strength {
  border-top: 2px solid var(--success);
}

.sw-card--weak {
  border-top: 2px solid var(--warning);
}

.sw-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.sw-card-header svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.sw-card--strength .sw-card-header { color: var(--success); }
.sw-card--weak .sw-card-header { color: var(--warning); }

.sw-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sw-list li {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding-left: 12px;
  position: relative;
}

.sw-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--border-medium);
}

.sw-card--strength .sw-list li::before { background-color: var(--success); }
.sw-card--weak .sw-list li::before { background-color: var(--warning); }

/* Report Section Card */
.report-section-card {
  background-color: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
}

.report-section-card > .card-section-label {
  margin-bottom: 16px;
  display: block;
}

/* QA Review List */
.qa-review-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.qa-review-item {
  background-color: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px;
}

.qa-review-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.qa-question-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.45;
  flex: 1;
}

.qa-review-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.qa-field-label {
  font-weight: 700;
  color: var(--text-primary);
}

.qa-answer-text {
  font-style: italic;
  color: var(--text-muted);
}

.qa-better {
  color: var(--accent);
}

/* Study Plan */
.study-plan-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.study-plan-item {
  background-color: var(--surface-3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--r-md);
  padding: 14px 16px;
}

.study-plan-topic {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.study-plan-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.report-footer-actions {
  display: flex;
  justify-content: center;
  padding: 12px 0 8px;
}

/* ── 9. BADGES ─────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--r-full);
  font-size: 0.71rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-accent {
  background-color: var(--accent-dim);
  color: var(--accent-light);
  border: 1px solid var(--accent-border);
}

.badge-success {
  background-color: var(--success-dim);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.badge-warning {
  background-color: var(--warning-dim);
  color: var(--warning);
  border: 1px solid var(--warning-border);
}

.badge-danger {
  background-color: var(--danger-dim);
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

/* ── 10. TOAST SYSTEM ──────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 380px;
}

.toast {
  background-color: var(--surface-4);
  border: 1px solid var(--border-medium);
  color: var(--text-primary);
  padding: 12px 16px;
  border-radius: var(--r-md);
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  transform: translateX(110%);
  transition: transform var(--t-base);
  line-height: 1.4;
}

.toast.show {
  transform: translateX(0);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.info {
  border-left: 3px solid var(--info);
}

/* ── 11. LOADING SPINNER ───────────────────────────────────── */
.loading-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spinAnim 0.7s linear infinite;
  display: inline-block;
}

/* ── 12. UTILITY ───────────────────────────────────────────── */
.hidden { display: none !important; }

.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ── 13. ANIMATIONS ────────────────────────────────────────── */
@keyframes orbRipple {
  0%   { width: 60px; height: 60px; opacity: 0.7; }
  100% { width: 100px; height: 100px; opacity: 0; }
}

@keyframes orbPulse {
  0%, 100% { transform: scale(1); opacity: 0.95; }
  50%       { transform: scale(1.07); opacity: 1; }
}

@keyframes orbSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

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

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

@keyframes spinAnim {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

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

/* ── 14. RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 900px) {
  .interview-layout {
    grid-template-columns: 1fr;
  }
  .interview-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 680px) {
  .widget-step { padding: 28px 16px; }
  .app-header-inner { padding: 0 16px; }
  .field-row { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: 1fr; }
  .report-score-row { grid-template-columns: 1fr; }
  .report-sw-grid { grid-template-columns: 1fr; }
  .feedback-detail-grid { grid-template-columns: 1fr; }
  .answer-result-grid { grid-template-columns: 1fr; }
  .score-trio { grid-template-columns: repeat(3,1fr); }
  .interview-sidebar { grid-template-columns: 1fr; }
  .answer-controls { flex-wrap: wrap; }
  .answer-controls-right { flex-wrap: wrap; margin-left: 0; }
}

@media (max-width: 440px) {
  .seg-control { flex-wrap: wrap; }
  .score-trio { grid-template-columns: 1fr 1fr 1fr; }
}
