/* ============================================================
   InterviewSimulator – style.css   (light theme, app.css base)
   ============================================================ */

/* ── Accent vars (used by JS score ring / progress bar) ─────── */
:root {
  --accent: #007bff;
  --accent2: #6c63ff;
  --green: #28a745;
  --red: #dc3545;
  --radius: 6px;
}

/* ================================================================
   LAYOUT
   ================================================================ */
.app {
  display: grid;
  grid-template-columns: 1fr;
}

.screen {
  display: none;
  padding: 24px 0;
  width: 100%;
}

.screen.active {
  display: block;
  animation: fadeUp 0.4s ease;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ================================================================
   SIMULATOR CARD
   ================================================================ */
.simulator-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 6px 32px rgba(0, 0, 0, 0.12);
  border: 1px solid #e0e0e0;
  padding: 36px 40px;
  margin-top: 8px;
}

.upload-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.history-btn {
  font-size: 0.82rem;
}

/* ================================================================
   MODE TOGGLE
   ================================================================ */
.mode-toggle {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.mode-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  flex: 1;
  min-width: 160px;
}

.mode-option:has(input:checked) {
  border-color: var(--accent);
  background: #eef4ff;
}

.mode-option input {
  display: none;
}

.mode-option span {
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
}

.mode-option small {
  display: block;
  font-size: 0.72rem;
  color: #888;
  font-weight: 400;
}

/* ================================================================
   UPLOAD SCREEN
   ================================================================ */
.screen-title {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 700;
  color: #1a1a1a;
  line-height: 1.2;
  margin-bottom: 6px;
}

.screen-subtitle {
  color: #666;
  font-size: 0.95rem;
  margin-bottom: 24px;
}

.upload-zone {
  border: 2px dashed #c0c0c0;
  border-radius: 8px;
  padding: 48px 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.25s, background 0.25s;
  background: #f9f9fb;
}

.upload-zone:hover {
  border-color: var(--accent);
  background: #eef4ff;
}

.upload-zone.dragging {
  border-color: var(--accent);
  background: #ddeeff;
}

.upload-icon {
  font-size: 2.8rem;
  margin-bottom: 12px;
  display: block;
}

.upload-zone h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.upload-zone p {
  color: #888;
  font-size: 0.83rem;
}

#resumeFile {
  display: none;
}

.or-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: #aaa;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.or-divider::before,
.or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

/* ── Textarea ──────────── */
.textarea-wrapper {
  position: relative;
}

textarea {
  width: 100%;
  background: #ffffff;
  border: 1px solid #d0d0d0;
  border-radius: var(--radius);
  color: #1a1a1a;
  font-family: inherit;
  font-size: 0.88rem;
  padding: 16px;
  resize: vertical;
  min-height: 180px;
  transition: border-color 0.2s;
  line-height: 1.7;
  box-sizing: border-box;
}

textarea::placeholder {
  color: #bbb;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.char-count {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 0.65rem;
  color: #aaa;
}

/* ── Job Description ─────── */
.jd-section {
  margin-top: 20px;
}

.jd-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f5f5f5;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: #333;
  border: 1px solid #e0e0e0;
  transition: background 0.2s;
}

.jd-toggle:hover {
  background: #ebebeb;
}

.jd-toggle small {
  font-weight: 400;
  color: #888;
  margin-left: 6px;
}

/* ── Config grid ─────────── */
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}

.config-group label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #666;
  margin-bottom: 8px;
}

select,
input[type="number"] {
  width: 100%;
  background: #ffffff;
  border: 1px solid #d0d0d0;
  border-radius: var(--radius);
  color: #1a1a1a;
  font-size: 0.9rem;
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color 0.2s;
  appearance: none;
  -webkit-appearance: none;
  box-sizing: border-box;
}

select:focus,
input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  pointer-events: none;
}

/* ================================================================
   BUTTONS
   ================================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: #0062cc;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(0, 123, 255, 0.25);
}

.btn-primary:disabled {
  background: #d0d0d0;
  color: #999;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-ghost {
  background: transparent;
  color: #555;
  border: 1px solid #d0d0d0;
}

.btn-ghost:hover {
  border-color: #999;
  color: #1a1a1a;
}

.btn-danger {
  background: transparent;
  color: var(--red);
  border: 1px solid rgba(220, 53, 69, 0.35);
}

.btn-danger:hover {
  background: rgba(220, 53, 69, 0.07);
}

/* ================================================================
   STATUS BADGE
   ================================================================ */
.status-badge {
  font-size: 0.65rem;
  padding: 4px 10px;
  border: 1px solid #ccc;
  border-radius: 3px;
  color: #999;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.status-badge.active {
  border-color: var(--green);
  color: var(--green);
}

.status-badge.interviewing {
  border-color: var(--accent);
  color: var(--accent);
}

/* ================================================================
   INTERVIEW SCREEN
   ================================================================ */
.interview-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 28px;
  align-items: start;
}

/* Mobile panel toggle button (hidden on desktop) */
.panel-toggle-btn {
  display: none;
  margin-bottom: 12px;
  width: 100%;
}

.panel-close-btn {
  background: transparent;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #999;
  display: none;
}

/* Progress Panel */
.progress-panel {
  background: #f7f8fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  position: sticky;
  top: 90px;
}

.progress-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-panel h4 {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #999;
  margin: 0;
}

.progress-bar-wrap {
  height: 4px;
  background: #e0e0e0;
  border-radius: 2px;
  margin-bottom: 16px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent2), var(--accent));
  border-radius: 2px;
  transition: width 0.5s ease;
}

.question-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.question-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: 0.78rem;
  color: #aaa;
  border-bottom: 1px solid #ebebeb;
  transition: color 0.2s;
}

.question-dot:last-child {
  border-bottom: none;
}

.question-dot.current {
  color: var(--accent);
  font-weight: 600;
}

.question-dot.answered {
  color: var(--green);
}

.question-dot.bookmarked {
  background: #fffbeb;
  border-radius: 4px;
}

.q-num {
  font-size: 0.65rem;
  width: 18px;
  flex-shrink: 0;
  color: inherit;
}

.q-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.75rem;
  flex: 1;
}

/* Bookmark button */
.bookmark-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0 2px;
  flex-shrink: 0;
  line-height: 1;
  opacity: 0.5;
  transition: opacity 0.2s;
}

.bookmark-btn:hover {
  opacity: 1;
}

.bookmark-summary {
  margin-top: 12px;
  font-size: 0.78rem;
  color: #888;
  text-align: center;
}

/* ── Main interview area ── */
.main-interview {
  min-width: 0;
}

.q-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.q-category {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent2);
}

/* TTS button */
.tts-btn {
  background: transparent;
  border: 1px solid #d0d0d0;
  border-radius: var(--radius);
  padding: 4px 10px;
  font-size: 0.78rem;
  cursor: pointer;
  color: #666;
  transition: all 0.2s;
}

.tts-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tts-btn.tts-active {
  border-color: var(--accent);
  color: var(--accent);
  background: #eef4ff;
}

/* Question card */
.question-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.question-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--accent);
  border-radius: 4px 0 0 4px;
}

.question-number {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #aaa;
  margin-bottom: 10px;
}

.question-text {
  font-size: 1.15rem;
  font-weight: 500;
  line-height: 1.55;
  color: #1a1a1a;
}

.question-hint {
  margin-top: 14px;
  padding: 10px 14px;
  background: #f0f4ff;
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: #555;
  font-style: italic;
  border-left: 3px solid var(--accent2);
}

/* Answer section */
.answer-section {
  margin-top: 8px;
}

.answer-section>label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
  margin-bottom: 10px;
}

.answer-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  gap: 10px;
  flex-wrap: wrap;
}

.answer-left {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

/* Recording */
.recording-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--red);
  opacity: 0;
  transition: opacity 0.3s;
}

.recording-indicator.active {
  opacity: 1;
}

.rec-dot {
  width: 8px;
  height: 8px;
  background: var(--red);
  border-radius: 50%;
  animation: blink 1s infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.2;
  }
}

.timer {
  font-size: 0.8rem;
  font-weight: 600;
  color: #888;
  min-width: 44px;
  text-align: right;
}

.timer.warning {
  color: var(--red);
  animation: blink 1s infinite;
}

/* ================================================================
   FEEDBACK
   ================================================================ */
.feedback-card {
  background: #f7f8fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-top: 14px;
  animation: fadeUp 0.3s ease;
}

.feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.feedback-header h4 {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
}

.score-badge {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 600;
}

.score-badge.good {
  background: rgba(40, 167, 69, 0.1);
  color: var(--green);
  border: 1px solid rgba(40, 167, 69, 0.3);
}

.score-badge.mid {
  background: rgba(255, 193, 7, 0.12);
  color: #856404;
  border: 1px solid rgba(255, 193, 7, 0.4);
}

.score-badge.low {
  background: rgba(220, 53, 69, 0.08);
  color: var(--red);
  border: 1px solid rgba(220, 53, 69, 0.25);
}

.feedback-text {
  font-size: 0.88rem;
  line-height: 1.7;
  color: #444;
}

.feedback-points {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.feedback-point {
  display: flex;
  gap: 10px;
  font-size: 0.84rem;
  line-height: 1.5;
  color: #555;
}

.fp-icon {
  flex-shrink: 0;
  margin-top: 2px;
}

/* ================================================================
   RESULTS SCREEN
   ================================================================ */
.results-hero {
  text-align: center;
  padding: 40px 0 48px;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 40px;
}

.score-ring {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--pct), #e0e0e0 var(--pct));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  position: relative;
  transition: --pct 0.05s linear;
}

.score-ring::after {
  content: '';
  position: absolute;
  inset: 12px;
  background: #fff;
  border-radius: 50%;
}

.score-inner {
  position: relative;
  z-index: 1;
  text-align: center;
}

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

.score-label {
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #999;
  margin-top: 4px;
}

.results-grade {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.results-subtitle {
  color: #666;
  font-size: 0.9rem;
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 36px;
}

.result-stat {
  background: #f7f8fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent2);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #999;
}

.qa-review {
  margin-bottom: 36px;
}

.qa-review h3 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #666;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e0e0e0;
}

.qa-item {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 14px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.qa-bookmarked {
  border-left: 3px solid #ffc107;
}

.qa-item-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 12px;
}

.qa-q {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.4;
  flex: 1;
  color: #1a1a1a;
}

.qa-a {
  font-size: 0.82rem;
  color: #555;
  line-height: 1.6;
  padding: 10px 14px;
  background: #f7f8fa;
  border-radius: var(--radius);
  margin-bottom: 8px;
}

.qa-fb {
  font-size: 0.82rem;
  color: #555;
  line-height: 1.6;
}

/* ================================================================
   LOADING OVERLAY & SKELETON
   ================================================================ */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  flex-direction: column;
  gap: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.loading-overlay.active {
  opacity: 1;
  pointer-events: all;
}

#loaderSpinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.loader {
  display: flex;
  gap: 6px;
}

.loader-dot {
  width: 9px;
  height: 9px;
  background: var(--accent);
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loader-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.loader-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {

  0%,
  80%,
  100% {
    transform: scale(0);
    opacity: 0.3;
  }

  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.loading-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  animation: fadeInOut 2s infinite;
}

@keyframes fadeInOut {

  0%,
  100% {
    opacity: 0.4;
  }

  50% {
    opacity: 1;
  }
}

/* Skeleton loader */
.skeleton-shimmer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 420px;
  max-width: 90vw;
}

.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  animation: shimmer 1.4s infinite;
}

.skeleton-line.long {
  width: 100%;
}

.skeleton-line.medium {
  width: 70%;
}

.skeleton-line.short {
  width: 45%;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

/* ================================================================
   TOAST
   ================================================================ */
.toast-container {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 600;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: var(--radius);
  padding: 12px 18px;
  font-size: 0.78rem;
  max-width: 300px;
  animation: slideIn 0.3s ease;
  display: flex;
  gap: 10px;
  align-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

.toast.error {
  border-color: var(--red);
  color: var(--red);
}

.toast.success {
  border-color: var(--green);
  color: var(--green);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(16px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ================================================================
   HISTORY PANEL
   ================================================================ */
.history-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  z-index: 700;
}

.history-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 95vw;
  height: 100vh;
  background: #fff;
  z-index: 710;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  box-sizing: border-box;
}

.history-panel.panel-slide-in {
  transform: translateX(0);
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.history-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0;
}

.history-item {
  padding: 14px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 10px;
}

.history-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.history-date {
  font-size: 0.78rem;
  color: #666;
}

.history-meta {
  font-size: 0.75rem;
  color: #999;
}

.history-empty {
  font-size: 0.85rem;
  color: #aaa;
  text-align: center;
  margin-top: 40px;
}

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 768px) {
  main {
    padding-left: var(--mobile-main-lr-padding, 8px);
    padding-right: var(--mobile-main-lr-padding, 8px);
  }

  .simulator-card {
    padding: 20px 16px;
  }

  .interview-layout {
    grid-template-columns: 1fr;
    position: relative;
  }

  .panel-toggle-btn {
    display: block;
  }

  .progress-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 800;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    border-radius: 0;
    overflow-y: auto;
    box-sizing: border-box;
  }

  .progress-panel.panel-open {
    transform: translateX(0);
  }

  .panel-close-btn {
    display: block;
  }

  .config-grid {
    grid-template-columns: 1fr;
  }

  .results-grid {
    grid-template-columns: 1fr 1fr;
  }

  .mode-toggle {
    flex-direction: column;
  }

  .answer-controls {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .results-grid {
    grid-template-columns: 1fr;
  }
}