/* Student live viva + results — extends student-panel.css (admin-aligned theme) */

.student-viva-page .student-header-inner--viva {
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.student-header-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  min-width: 0;
}

.student-header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.student-header-user {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--sp-muted, #61708d);
}

.student-header-logout {
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
}

.student-header-logout:hover {
  color: var(--sp-accent, #2f7ef1);
  text-decoration: underline;
}

.student-viva-page .student-main {
  align-items: flex-start;
  padding-top: 20px;
  padding-bottom: 100px;
}

.sv-phase[hidden] {
  display: none !important;
}

/* ——— Exam card ——— */
.sv-exam-wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.sv-exam-card {
  background: linear-gradient(180deg, #f4f6fb 0%, #eef1f7 100%);
  border: 1px solid rgba(199, 213, 239, 0.95);
  border-radius: 16px;
  padding: 20px 22px 24px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 18px 44px rgba(23, 61, 112, 0.12);
}

.sv-exam-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.sv-progress-label {
  margin: 0 0 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--sp-text, #101c37);
}

.sv-progress-track {
  height: 6px;
  border-radius: 999px;
  background: #d8e2f4;
  overflow: hidden;
  max-width: 280px;
}

.sv-progress-fill {
  height: 100%;
  border-radius: 999px;
  width: 0%;
  background: linear-gradient(90deg, var(--sp-brand, #11a592), var(--sp-accent, #2f7ef1));
  transition: width 0.35s ease;
}

.sv-timer {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
}

.sv-timer svg {
  width: 16px;
  height: 16px;
  opacity: 0.9;
}

.sv-question-box {
  background: #e8ecf4;
  border: 1px solid #d5deef;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 18px;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--sp-text, #101c37);
}

.sv-field-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 8px;
}

.sv-answer {
  width: 100%;
  min-height: 140px;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--sp-text, #101c37);
  border: 1px solid #c7d5ef;
  border-radius: 10px;
  resize: vertical;
  background: #fff;
}

.sv-answer:focus {
  outline: none;
  border-color: var(--sp-accent, #2f7ef1);
  box-shadow: 0 0 0 3px rgba(47, 126, 241, 0.18);
}

.sv-mic-row {
  margin-top: 14px;
}

.sv-btn-mic {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.35);
}

.sv-btn-mic:hover {
  filter: brightness(1.05);
}

.sv-btn-mic--listening {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.4), 0 6px 18px rgba(220, 38, 38, 0.45);
  animation: sv-mic-pulse 1.2s ease-in-out infinite;
}

@keyframes sv-mic-pulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.08);
  }
}

.sv-btn-mic .sv-mic-icon {
  width: 18px;
  height: 18px;
}

.sv-mic-icon--stop {
  display: none;
}

.sv-btn-mic--listening .sv-mic-icon--start {
  display: none;
}

.sv-btn-mic--listening .sv-mic-icon--stop {
  display: inline-block;
}

.sv-mic-hint {
  margin: 8px 0 0;
  font-size: 0.8rem;
  color: var(--sp-muted, #61708d);
}

.sv-actions {
  margin-top: 22px;
  display: flex;
  justify-content: center;
}

.sv-btn-primary {
  min-width: 200px;
  min-height: 46px;
  padding: 0 24px;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(105deg, var(--sp-brand, #11a592) 0%, var(--sp-accent, #2f7ef1) 55%, #5a6cf0 100%);
  box-shadow: 0 4px 18px rgba(47, 126, 241, 0.35);
}

.sv-btn-primary:hover:not(:disabled) {
  filter: brightness(1.04);
}

.sv-btn-primary:disabled {
  opacity: 0.75;
  cursor: not-allowed;
}

/* ——— Proctoring widget ——— */
.sv-proctor {
  position: fixed;
  right: max(12px, env(safe-area-inset-right, 0px));
  bottom: max(12px, env(safe-area-inset-bottom, 0px));
  z-index: 50;
  width: min(280px, 92vw);
  border-radius: 12px;
  overflow: hidden;
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.sv-proctor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #0b1220;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.85);
}

.sv-proctor-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.35);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.sv-proctor-dot--live {
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.4);
}

.sv-proctor-body {
  position: relative;
  min-height: 140px;
  padding: 0;
  background: #000;
}

.sv-proctor-video {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
  vertical-align: middle;
  background: #0b1220;
}

.sv-proctor-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px;
  text-align: center;
  pointer-events: none;
}

.sv-proctor-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sv-proctor-overlay .sv-proctor-retry {
  pointer-events: auto;
}

.sv-proctor-status {
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #fca5a5;
  max-width: 100%;
}

.sv-proctor-retry {
  pointer-events: auto;
  padding: 8px 14px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  background: linear-gradient(105deg, var(--sp-accent, #2f7ef1) 0%, #6366f1 100%);
}

.sv-proctor-retry:hover {
  filter: brightness(1.06);
}

.sv-proctor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.75);
}

.sv-proctor-present {
  color: #4ade80;
  font-weight: 700;
}

/* ——— Modals ——— */
.sv-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sv-modal-backdrop[hidden] {
  display: none !important;
}

.sv-modal {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(226, 232, 240, 0.95);
}

.sv-modal-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sv-modal-icon--danger {
  background: #ef4444;
  color: #fff;
}

.sv-modal-icon--ok {
  background: #22c55e;
  color: #fff;
}

.sv-modal h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--sp-text, #101c37);
}

.sv-modal p {
  margin: 0 0 20px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: #475569;
}

.sv-btn-modal-ok {
  min-width: 120px;
  min-height: 44px;
  padding: 0 20px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(105deg, #7b57f9 0%, #6366f1 100%);
}

.sv-btn-modal-ok:hover {
  filter: brightness(1.05);
}

.sv-btn-modal-primary {
  min-width: 160px;
  min-height: 44px;
  padding: 0 20px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  background: linear-gradient(105deg, var(--sp-accent, #2f7ef1) 0%, #2563eb 100%);
}

.sv-btn-modal-primary:hover {
  filter: brightness(1.05);
}

/* ——— Evaluating overlay ——— */
.sv-evaluating {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: linear-gradient(145deg, rgba(30, 42, 90, 0.92) 0%, rgba(45, 58, 120, 0.9) 50%, rgba(59, 74, 139, 0.92) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.sv-evaluating[hidden] {
  display: none !important;
}

.sv-spinner {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #38bdf8;
  animation: sv-spin 0.85s linear infinite;
  margin-bottom: 22px;
}

@keyframes sv-spin {
  to {
    transform: rotate(360deg);
  }
}

.sv-evaluating h2 {
  margin: 0 0 12px;
  font-size: clamp(1.15rem, 3vw, 1.35rem);
  font-weight: 800;
  color: #fff;
}

.sv-evaluating p {
  margin: 0;
  max-width: 360px;
  font-size: 0.92rem;
  line-height: 1.55;
  color: rgba(226, 232, 240, 0.92);
}

/* ——— Summary card ——— */
.sv-summary-card {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  background: var(--sp-card, rgba(255, 255, 255, 0.95));
  border: 1px solid var(--sp-card-border, rgba(255, 255, 255, 0.65));
  border-radius: 20px;
  padding: 32px 28px 28px;
  text-align: center;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 24px 56px rgba(23, 61, 112, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.sv-summary-card h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--sp-text, #101c37);
}

.sv-summary-score {
  margin: 12px 0 4px;
  font-size: clamp(2.2rem, 5vw, 2.75rem);
  font-weight: 800;
  color: #38bdf8;
  letter-spacing: -0.03em;
}

.sv-summary-pct {
  margin: 0 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #38bdf8;
}

.sv-summary-symbol {
  font-size: 2rem;
  font-weight: 800;
  color: #38bdf8;
  line-height: 1;
  margin-bottom: 14px;
}

.sv-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: #fce7f3;
  color: #9d174d;
  margin-bottom: 22px;
}

.sv-donut-wrap {
  width: 180px;
  height: 180px;
  margin: 0 auto 18px;
  position: relative;
}

.sv-donut {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(
    #22c55e 0deg 3.6deg,
    #f97316 3.6deg 313.2deg,
    #ef4444 313.2deg 360deg
  );
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.12);
}

.sv-donut-hole {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 2px 8px rgba(15, 23, 42, 0.06);
}

.sv-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  max-width: 260px;
  margin: 0 auto 24px;
  font-size: 0.82rem;
  color: #475569;
}

.sv-legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sv-legend-sq {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.sv-legend-sq--ok {
  background: #22c55e;
}
.sv-legend-sq--mid {
  background: #f97316;
}
.sv-legend-sq--bad {
  background: #ef4444;
}

.sv-summary-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sv-btn-secondary {
  min-height: 44px;
  padding: 0 20px;
  font: inherit;
  font-weight: 700;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f1f5f9;
  cursor: pointer;
}

.sv-btn-secondary:hover {
  background: #e2e8f0;
}

/* ——— Detailed report ——— */
.sv-report-wrap {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
}

.sv-report-card {
  background: #fff;
  border: 1px solid rgba(199, 213, 239, 0.95);
  border-radius: 16px;
  padding: 22px 22px 26px;
  box-shadow: 0 18px 44px rgba(23, 61, 112, 0.1);
}

.sv-report-block {
  border-left: 4px solid #f59e0b;
  padding-left: 16px;
  margin-bottom: 28px;
}

.sv-report-block:last-of-type {
  margin-bottom: 0;
}

.sv-report-qhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sv-report-qhead h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.4;
  color: var(--sp-text, #101c37);
}

.sv-report-score {
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--sp-accent, #2f7ef1);
  background: #eff6ff;
  padding: 4px 10px;
  border-radius: 8px;
}

.sv-report-section {
  margin-top: 12px;
}

.sv-report-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 6px;
}

.sv-box-answer {
  background: #f1f5f9;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #334155;
}

.sv-box-ideal {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.88rem;
  line-height: 1.5;
  color: #065f46;
}

.sv-feedback-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

@media (max-width: 600px) {
  .sv-feedback-grid {
    grid-template-columns: 1fr;
  }
}

.sv-box-mistake {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #991b1b;
}

.sv-box-suggest {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 12px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #1e40af;
}

.sv-box-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
  font-size: 0.78rem;
  margin-bottom: 8px;
}

.sv-report-actions {
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.sv-report-actions .sv-btn-secondary {
  min-width: 160px;
}

.sv-report-actions .sv-btn-primary {
  min-width: 160px;
}

@media print {
  .student-page-strip,
  .student-page-bg,
  .student-header,
  .sv-proctor,
  .sv-report-actions,
  .student-header-logout {
    display: none !important;
  }

  .student-viva-page .student-main {
    padding: 0;
  }

  .sv-report-card {
    box-shadow: none;
    border: none;
  }
}
