/* ══ Interview page — Light theme matching design mockup ══ */
main { padding: 0; }
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green:    #16a34a;
  --green2:   #15803d;
  --green-l:  #f0fdf4;
  --green-b:  #bbf7d0;
  --green-m:  #22c55e;
  --blue:     #1a56db;
  --accent:   #1a56db;
  --bg:       #f8fafc;
  --bg2:      #ffffff;
  --bg3:      #f1f5f9;
  --border:   #e2e8f0;
  --border2:  #cbd5e1;
  --text:     #0f172a;
  --text2:    #475569;
  --text3:    #94a3b8;
  --danger:   #dc2626;
  --radius:   12px;
  --shadow:   0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:0 4px 12px rgba(0,0,0,.08);
}

/* ══ Root grid ══ */
.iv-root {
  display: grid;
  grid-template-columns: 230px 1fr 280px;
  height: 100vh;
  background: var(--bg);
  overflow: hidden;
  font-family: 'Inter', -apple-system, sans-serif;
  color: var(--text);
}

/* ══ LEFT SIDEBAR ══ */
.iv-sidebar {
  background: var(--bg2);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: var(--shadow);
}
.iv-sb-top { padding: 1.5rem 1.25rem 1rem; }

.iv-brand {
  display: flex; align-items: center; gap: 11px;
  margin-bottom: 2rem;
}
.iv-brand-icon {
  width: 42px; height: 42px; border-radius: 10px;
  flex-shrink: 0; overflow: hidden;
  box-shadow: 0 2px 8px rgba(26,86,219,.25);
}
.iv-brand-icon svg { width: 42px; height: 42px; }
.iv-brand-name { font-size: 14px; font-weight: 700; color: var(--text); }
.iv-brand-sub  { font-size: 11.5px; color: var(--text3); margin-top: 1px; }

.iv-nav { display: flex; flex-direction: column; gap: 2px; }
.iv-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 9px;
  font-size: 13.5px; font-weight: 500; color: var(--text2);
  cursor: pointer; transition: all .15s;
}
.iv-nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }
.iv-nav-item:hover { background: var(--bg3); color: var(--text); }
.iv-nav-active {
  background: var(--green-l) !important;
  color: var(--green) !important;
  font-weight: 600;
}
.iv-nav-active svg { stroke: var(--green); }

.iv-sb-bottom { padding: 1rem 1.25rem 1.5rem; border-top: 1px solid var(--border); }

/* Motivation card */
.iv-motivation {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border: 1px solid var(--green-b);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 1rem;
}
.iv-mot-top { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.iv-mot-rocket { font-size: 22px; flex-shrink: 0; }
.iv-mot-title { font-size: 13px; font-weight: 600; color: var(--green2); }
.iv-mot-sub { font-size: 11.5px; color: #4ade80; margin-top: 2px; line-height: 1.4; color: #166534; }
.iv-mot-bar-wrap { display: flex; align-items: center; gap: 8px; }
.iv-mot-bar { flex: 1; height: 5px; background: #bbf7d0; border-radius: 5px; overflow: hidden; }
.iv-mot-fill { height: 100%; background: var(--green); border-radius: 5px; transition: width .6s ease; }
.iv-mot-pct { font-size: 11px; font-weight: 600; color: var(--green2); min-width: 28px; text-align: right; }

.iv-logout-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; border-radius: 9px;
  font-size: 13.5px; font-weight: 500; color: var(--text2);
  text-decoration: none; transition: all .15s; cursor: pointer;
}
.iv-logout-btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.iv-logout-btn:hover { background: var(--bg3); color: var(--text); }

/* ══ CENTER MAIN ══ */
.iv-main {
  display: flex; flex-direction: column;
  overflow: hidden; background: var(--bg);
}

/* Topbar */
.iv-topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: .85rem 1.5rem;
  background: var(--bg2); border-bottom: 1px solid var(--border);
  flex-shrink: 0; box-shadow: var(--shadow);
}
.iv-tb-left { display: flex; align-items: center; gap: 12px; }
.iv-tb-title {
  font-size: 17px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.iv-tb-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }
.iv-live-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: #f0fdf4; color: var(--green);
  font-size: 11px; font-weight: 700; letter-spacing: .2px;
  padding: 3px 9px; border-radius: 20px;
  border: 1px solid var(--green-b);
}
.live-dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: var(--green-m);
  animation: ldp 1.5s ease-in-out infinite;
}
@keyframes ldp { 0%,100%{opacity:1} 50%{opacity:.3} }

.iv-tb-right { display: flex; align-items: center; gap: .6rem; }
.iv-sound-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 16px;
  background: var(--bg2); border: 1.5px solid var(--border2);
  border-radius: 9px; font-size: 13px; font-weight: 500; color: var(--text2);
  cursor: pointer; transition: all .15s; box-shadow: var(--shadow);
}
.iv-sound-pill:hover { border-color: var(--green); color: var(--green); }
.iv-sound-pill svg { width: 15px; height: 15px; }
.iv-tb-icon-btn {
  width: 36px; height: 36px; border-radius: 9px;
  border: 1.5px solid var(--border2); background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: var(--shadow); transition: all .15s;
}
.iv-tb-icon-btn:hover { border-color: var(--green); }
.iv-tb-icon-btn svg { width: 16px; height: 16px; stroke: var(--text2); }

/* ══ VIDEO STAGE ══ */
.iv-video-stage {
  flex: 1; position: relative; overflow: hidden;
  margin: .9rem 1.5rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #000;
  min-height: 0;
  box-shadow: var(--shadow-md);
}

/* Real video */
.stage-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; border-radius: var(--radius);
  display: block; background: #000;
}

/* Fallback photo (recruiter image) */
.stage-fallback {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; border-radius: var(--radius);
  z-index: 1;
}
.stage-fallback.hidden { display: none; }

/* Loading overlay */
.av-overlay {
  position: absolute; inset: 0; z-index: 10;
  background: rgba(255,255,255,.85); backdrop-filter: blur(4px);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  border-radius: var(--radius); transition: opacity .4s;
}
.av-overlay.hidden { opacity: 0; pointer-events: none; }
.av-spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--green-b);
  border-top-color: var(--green);
  border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.av-overlay p { font-size: 13px; color: var(--text2); }

/* LIVE badge */
.iv-live-badge {
  position: absolute; top: 12px; left: 12px; z-index: 5;
  background: #dc2626;
  padding: 4px 10px; border-radius: 5px;
  font-size: 11px; font-weight: 800; letter-spacing: .7px;
  color: white; display: flex; align-items: center; gap: 6px;
}
.live-dot-red {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; background: white;
  animation: ldp 1.2s ease-in-out infinite;
}

/* Recruiter badge (bottom-left of video) */
.recruiter-badge {
  position: absolute; bottom: 14px; left: 14px; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  background: rgba(0,0,0,.55); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.15);
  padding: 8px 14px; border-radius: 10px;
}
.rb-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--green-m);
  box-shadow: 0 0 8px var(--green-m); flex-shrink: 0;
  animation: ldp 2s ease-in-out infinite;
}
.rb-name { font-size: 13.5px; font-weight: 600; color: white; display: block; }
.rb-role { font-size: 11px; color: rgba(255,255,255,.65); display: block; }

/* Autoplay prompt */
.click-play-prompt {
  position: absolute; inset: 0; z-index: 8;
  background: rgba(0,0,0,.5);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  cursor: pointer; border-radius: var(--radius);
}
.cpp-btn {
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--green); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 30px rgba(22,163,74,.5); transition: transform .15s;
  padding-left: 4px;
}
.click-play-prompt:hover .cpp-btn { transform: scale(1.08); }
.click-play-prompt span { font-size: 14px; color: white; font-weight: 500; }

/* ══ Caption bar ══ */
.iv-caption-bar {
  display: flex; align-items: center; gap: 12px;
  margin: .7rem 1.5rem 0;
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 10px; padding: .75rem 1.1rem;
  flex-shrink: 0; box-shadow: var(--shadow);
}
.iv-cap-av {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--green-l); border: 1.5px solid var(--green-b);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.iv-cap-av svg { width: 15px; height: 15px; stroke: var(--green); }
.iv-cap-name { font-size: 12px; font-weight: 600; color: var(--text2); margin-bottom: 2px; }
.iv-cap-text { font-size: 13.5px; color: var(--text2); }
.iv-cap-body { flex: 1; }
.iv-cap-status { flex-shrink: 0; }

/* Waveform */
.waveform { display: flex; align-items: flex-end; gap: 3px; height: 28px; }
.wf-bar { width: 3px; border-radius: 2px; background: var(--green); }
.waveform.idle .wf-bar { height: 4px !important; opacity: .2; animation: none !important; }
.waveform.speaking .wf-bar { opacity: 1; }
.wf-bar:nth-child(1){animation:wfb .9s ease-in-out infinite 0.0s}
.wf-bar:nth-child(2){animation:wfb .9s ease-in-out infinite 0.1s}
.wf-bar:nth-child(3){animation:wfb .9s ease-in-out infinite 0.2s}
.wf-bar:nth-child(4){animation:wfb .9s ease-in-out infinite 0.15s}
.wf-bar:nth-child(5){animation:wfb .9s ease-in-out infinite 0.1s}
.wf-bar:nth-child(6){animation:wfb .9s ease-in-out infinite 0.05s}
.wf-bar:nth-child(7){animation:wfb .9s ease-in-out infinite 0.0s}
@keyframes wfb { 0%,100%{height:4px} 50%{height:24px} }

/* ══ Answer area ══ */
.iv-answer {
  padding: .75rem 1.5rem 1rem; flex-shrink: 0;
  display: flex; flex-direction: column; gap: .6rem;
}
.iv-answer-label {
  font-size: 11px; font-weight: 700; color: var(--green);
  letter-spacing: .6px; text-transform: uppercase;
}

.rp-input, .rp-textarea {
  width: 100%; padding: 12px 16px;
  background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: 9px; font-size: 14px; color: var(--text);
  font-family: inherit; outline: none; transition: border .2s, box-shadow .2s;
  box-shadow: var(--shadow);
}
.rp-input:focus, .rp-textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(22,163,74,.1);
}
.rp-input::placeholder, .rp-textarea::placeholder { color: var(--text3); }
.rp-textarea { resize: none; line-height: 1.6; }
.iv-char-count { font-size: 11px; color: var(--text3); text-align: right; margin-top: 3px; }

.inp-opts { display: flex; flex-wrap: wrap; gap: .5rem; }
.opt-pill {
  padding: 8px 16px; border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--bg2); color: var(--text2);
  font-size: 13px; cursor: pointer; font-family: inherit; transition: all .15s;
  box-shadow: var(--shadow);
}
.opt-pill:hover { border-color: var(--green); color: var(--green); background: var(--green-l); }
.opt-pill.selected { border-color: var(--green); background: var(--green-l); color: var(--green); font-weight: 600; }

.inp-hint { font-size: 12px; color: var(--text3); }
.inp-error {
  display: flex; align-items: center; gap: 8px;
  background: #fef2f2; border: 1px solid #fecaca;
  border-radius: 8px; padding: 10px 14px;
  font-size: 13px; color: var(--danger); animation: shake .35s ease;
}
.inp-error svg { width: 15px; height: 15px; stroke: var(--danger); flex-shrink: 0; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-4px)} 40%,80%{transform:translateX(4px)} }

.custom-role-input { margin-top: .45rem; display: none; }
.custom-role-input.visible { display: block; }
.custom-role-input input {
  width: 100%; background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 11px 14px; font-size: 14px; color: var(--text);
  font-family: inherit; outline: none; transition: border .2s; box-shadow: var(--shadow);
}
.custom-role-input input:focus { border-color: var(--green); }

.iv-answer-btns { display: flex; gap: .75rem; }
.iv-btn-repeat {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px; border: 1.5px solid var(--border);
  border-radius: 9px; background: var(--bg2);
  color: var(--text2); font-size: 13.5px; font-weight: 500;
  cursor: pointer; font-family: inherit; transition: all .15s;
  box-shadow: var(--shadow);
}
.iv-btn-repeat svg { width: 15px; height: 15px; }
.iv-btn-repeat:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.iv-btn-repeat:disabled { opacity: .35; cursor: not-allowed; }

.iv-btn-submit {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px;
  background: var(--green); color: white;
  border: none; border-radius: 9px;
  font-size: 13.5px; font-weight: 600;
  cursor: pointer; font-family: inherit; transition: all .15s;
  box-shadow: 0 4px 14px rgba(22,163,74,.3);
}
.iv-btn-submit svg { width: 15px; height: 15px; }
.iv-btn-submit:hover:not(:disabled) { background: var(--green2); box-shadow: 0 6px 20px rgba(22,163,74,.4); transform: translateY(-1px); }
.iv-btn-submit:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.iv-status-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text3); }
.iv-status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green-m); flex-shrink: 0; animation: ldp 2s ease-in-out infinite; }

/* Completion screen */
.completion-screen {
  position: absolute; inset: 0; z-index: 30;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 2rem; text-align: center;
}
.cs-anim { margin-bottom: 1.5rem; }
.cs-circle { animation: drawC 1s ease forwards .3s; }
.cs-check  { animation: drawK .5s ease forwards 1.3s; }
@keyframes drawC { to { stroke-dashoffset: 0; } }
@keyframes drawK { to { stroke-dashoffset: 0; } }
.completion-screen h2 { font-size: 1.7rem; font-weight: 700; color: var(--text); margin-bottom: .5rem; }
.completion-screen p { color: var(--text2); font-size: 14.5px; max-width: 320px; margin-bottom: 1.5rem; }
.cs-meta { background: var(--bg2); border: 1px solid var(--border); border-radius: 10px; padding: 1rem 1.5rem; margin-bottom: 1.5rem; min-width: 240px; box-shadow: var(--shadow); }
.cs-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--green); color: white; text-decoration: none;
  padding: 13px 30px; border-radius: 10px; font-weight: 600; font-size: 15px;
  box-shadow: 0 4px 14px rgba(22,163,74,.3);
}

/* ══ RIGHT SIDEBAR ══ */
.iv-right {
  background: var(--bg2); border-left: 1px solid var(--border);
  overflow-y: auto; padding: 1.1rem;
  display: flex; flex-direction: column; gap: .85rem;
  scrollbar-width: thin; scrollbar-color: var(--border2) transparent;
  box-shadow: var(--shadow);
}
.iv-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.1rem;
  box-shadow: var(--shadow);
}
.iv-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.iv-card-label { font-size: 13px; font-weight: 600; color: var(--text); }
.iv-step-badge { font-size: 13px; font-weight: 700; color: var(--green); }

.iv-prog-track { height: 6px; background: var(--bg3); border-radius: 6px; overflow: hidden; margin-bottom: .5rem; }
.iv-prog-fill { height: 100%; background: var(--green); border-radius: 6px; transition: width .6s ease; }
.iv-prog-pct { font-size: 12px; color: var(--text3); }

.iv-q-row { display: flex; align-items: flex-start; gap: .75rem; }
.iv-q-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--green-l); border: 1px solid var(--green-b);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.iv-q-icon svg { width: 15px; height: 15px; stroke: var(--green); }
.iv-q-num { font-size: 11px; color: var(--text3); margin-bottom: 3px; }
.iv-q-text { font-size: 13.5px; color: var(--text); line-height: 1.5; font-weight: 500; }

.iv-tips-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: .7rem; }
.iv-tips-list { list-style: none; display: flex; flex-direction: column; gap: .5rem; }
.iv-tips-list li { font-size: 12.5px; color: var(--text2); padding-left: 16px; position: relative; line-height: 1.5; }
.iv-tips-list li::before { content: '•'; position: absolute; left: 0; color: var(--green); }

#speakingOverlay { display: none !important; }

/* Responsive */
@media (max-width:960px) {
  .iv-root { grid-template-columns: 60px 1fr; }
  .iv-right { display: none; }
  .iv-brand-name, .iv-brand-sub, .iv-nav-item span, .iv-secure, .iv-motivation { display: none; }
  .iv-nav-item { justify-content: center; }
  .iv-logout-btn span { display: none; }
}
