/* Modern Japanese AI Interview Simulator CSS */
:root {
  --bg-primary: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-elevated: #334155;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #38bdf8;
  --primary-hover: #0284c7;
  --accent-pink: #f43f5e;
  --accent-green: #10b981;
  --accent-amber: #f59e0b;
  --border-color: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.12);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.5);
  --radius-lg: 18px;
  --radius-md: 12px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Poppins', 'Noto Sans JP', 'Noto Sans Sinhala', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background: radial-gradient(circle at top center, #1e293b 0%, #0f172a 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* Header & Nav */
.header-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

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

.brand-flag {
  font-size: 24px;
  animation: pulseFlag 2s infinite ease-in-out;
}

@keyframes pulseFlag {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, #38bdf8, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 11px;
  color: var(--text-muted);
}

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

.btn-icon {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: #475569;
  transform: translateY(-1px);
}

.btn-primary-pill {
  background: linear-gradient(135deg, #0284c7, #2563eb);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-primary-pill:hover {
  background: linear-gradient(135deg, #0369a1, #1d4ed8);
}

/* Main Container */
.main-interview-container {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Top Progress & Mode Bar */
.interview-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--glass-border);
}

.category-tag {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  font-weight: 600;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.progress-info {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.progress-info span {
  color: #fff;
}

/* Sensei Avatar Stage */
.sensei-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0;
  position: relative;
}

.avatar-wrapper {
  width: 180px;
  height: 180px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: radial-gradient(circle, #334155 0%, #1e293b 80%);
  border: 3px solid #475569;
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
}

.sensei-avatar-img {
  width: 90%;
  height: 90%;
  object-fit: contain;
}

/* Glowing States around Sensei */
.avatar-wrapper.speaking {
  border-color: #38bdf8;
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.6);
  animation: avatarPulse 1.2s infinite ease-in-out;
}

.avatar-wrapper.listening {
  border-color: #f43f5e;
  box-shadow: 0 0 35px rgba(244, 63, 94, 0.7);
  animation: listeningPulse 1s infinite alternate;
}

.avatar-wrapper.evaluating {
  border-color: #f59e0b;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.6);
}

.avatar-wrapper.approved {
  border-color: #10b981;
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.7);
}

@keyframes avatarPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.04); }
  100% { transform: scale(1); }
}

@keyframes listeningPulse {
  0% { transform: scale(1); }
  100% { transform: scale(1.03); }
}

/* Sensei State Badge */
.sensei-status-badge {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  transition: all 0.2s ease;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.status-dot.active-speak {
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
}

.status-dot.active-listen {
  background: #f43f5e;
  box-shadow: 0 0 10px #f43f5e;
  animation: blinkDot 0.8s infinite;
}

.status-dot.active-think {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
}

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

/* Question Banner */
.question-card {
  background: var(--glass-bg);
  backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  position: relative;
  transition: all 0.3s ease;
}

.question-romaji {
  font-size: 24px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.question-japanese {
  font-size: 18px;
  color: #38bdf8;
  font-weight: 600;
  margin-bottom: 10px;
}

.question-sinhala {
  font-size: 15px;
  color: var(--text-muted);
}

/* Blind Mode Toggle */
.blind-mode-active .question-romaji,
.blind-mode-active .question-japanese,
.blind-mode-active .question-sinhala {
  filter: blur(8px);
  user-select: none;
  transition: filter 0.3s ease;
}

.blind-mode-active .question-card:hover .question-romaji,
.blind-mode-active .question-card:hover .question-japanese,
.blind-mode-active .question-card:hover .question-sinhala {
  filter: blur(0px);
}

.blind-mode-hint {
  display: none;
  font-size: 12px;
  color: var(--accent-amber);
  margin-top: 8px;
}

.blind-mode-active .blind-mode-hint {
  display: block;
}

/* Candidate Audio / Response Controls */
.candidate-interaction-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

/* Big Mic Button */
.mic-btn-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-mic {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #f43f5e, #e11d48);
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(244, 63, 94, 0.4);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.btn-mic:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 30px rgba(244, 63, 94, 0.6);
}

.btn-mic.recording {
  background: linear-gradient(135deg, #10b981, #059669);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.5);
}

.mic-pulse-ring {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #f43f5e;
  animation: pulseMic 1.8s infinite;
  opacity: 0;
  pointer-events: none;
}

.btn-mic.recording + .mic-pulse-ring {
  border-color: #10b981;
  opacity: 1;
}

@keyframes pulseMic {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

.mic-instruction {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  text-align: center;
}

/* User Spoken Transcript Box */
.transcript-preview-box {
  width: 100%;
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 15px;
  color: #38bdf8;
  font-style: italic;
}

.transcript-empty {
  color: #64748b;
  font-style: normal;
  font-size: 13px;
}

/* Action Controls (Replay, Next, Shuffle) */
.action-buttons-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: 100%;
}

/* Evaluation Feedback Card */
.feedback-card {
  display: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.35s ease-out forwards;
}

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

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

.rating-badge {
  font-size: 14px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rating-badge.perfect {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.rating-badge.good {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.rating-badge.warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.rating-badge.wrong {
  background: rgba(244, 63, 94, 0.2);
  color: #f87171;
  border: 1px solid rgba(244, 63, 94, 0.4);
}

.score-display {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

/* Feedback Details */
.feedback-section {
  margin-bottom: 16px;
}

.feedback-label {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 6px;
  font-weight: 700;
}

.feedback-content {
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
}

.model-answer-box {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(168, 85, 247, 0.1));
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}

.model-japanese {
  font-size: 17px;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 4px;
}

.model-romaji {
  font-size: 14px;
  color: #e2e8f0;
  margin-bottom: 4px;
}

.model-sinhala {
  font-size: 13px;
  color: var(--text-muted);
}

.btn-listen-model {
  margin-top: 10px;
  background: #0284c7;
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* Profile Drawer / Modal */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 550px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
}

.btn-close-modal {
  background: transparent;
  border: none;
  font-size: 20px;
  color: var(--text-muted);
  cursor: pointer;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 600px) {
  .profile-form-grid {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.form-group input,
.form-group select {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: #fff;
  font-size: 13px;
  outline: none;
}

.form-group input:focus {
  border-color: #38bdf8;
}

.modal-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Audio Visualizer Waves */
.waveform-container {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
}

.wave-bar {
  width: 4px;
  height: 6px;
  background: #38bdf8;
  border-radius: 4px;
  transition: height 0.1s ease;
}

.wave-bar.animating {
  animation: waveAnim 0.6s infinite alternate ease-in-out;
}

.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.2s; }
.wave-bar:nth-child(4) { animation-delay: 0.3s; }
.wave-bar:nth-child(5) { animation-delay: 0.15s; }

@keyframes waveAnim {
  0% { height: 6px; }
  100% { height: 24px; }
}

/* Toast */
.toast-msg {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1e293b;
  border: 1px solid #38bdf8;
  color: #fff;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.toast-msg.show {
  transform: translateX(-50%) translateY(0);
}
