/**
 * IntervAI Pro - Live Interview Stage Styles
 */

.interview-stage-container {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 1.5rem;
  height: calc(100vh - 100px);
  min-height: 680px;
}

/* Left Column: AI & Candidate Video / Dialogue Stage */
.interview-left-stage {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  height: 100%;
}

.stage-top-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.stage-timer-box {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-sky);
}

.timer-warning {
  color: var(--color-rose) !important;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { opacity: 1; }
  50% { opacity: 0.5; }
  100% { opacity: 1; }
}

/* AI Holographic Avatar Video Card */
.ai-interviewer-card {
  position: relative;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 30%, rgba(30, 41, 59, 0.9), rgba(11, 15, 25, 0.98));
  border: 1px solid var(--border-glass);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.5rem;
  box-shadow: var(--shadow-subtle);
}

.ai-avatar-canvas-container {
  width: 100%;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#aiAvatarCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.interviewer-info-banner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  background: rgba(15, 23, 42, 0.8);
  border-top: 1px solid var(--border-glass);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.interviewer-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: #ffffff;
}

.interviewer-title {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.interviewer-stage-controls {
  display: flex;
  gap: 0.35rem;
}

/* Candidate Floating Webcam Preview */
.candidate-webcam-preview {
  position: relative;
  height: 100px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-glass);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#candidateWebcamVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: none;
}

.candidate-avatar-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}

.candidate-avatar-placeholder i {
  font-size: 1.5rem;
  color: var(--color-sky);
}

.webcam-live-badge {
  position: absolute;
  top: 6px;
  left: 8px;
  background: rgba(16, 185, 129, 0.85);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.webcam-live-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #ffffff;
  border-radius: 50%;
  animation: pulse 1.2s infinite;
}

/* Chat Transcript in Live Stage */
.dialogue-transcript-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1rem;
  overflow: hidden;
  min-height: 220px;
}

.transcript-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-glass);
}

.transcript-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.transcript-messages-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding-right: 0.35rem;
}

/* Chat Bubbles */
.chat-msg {
  display: flex;
  gap: 0.65rem;
  animation: fadeIn 0.2s ease;
}

.chat-msg-ai .msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.chat-msg-candidate .msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.msg-bubble-content {
  flex: 1;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
}

.chat-msg-ai .msg-bubble-content {
  border-left: 3px solid var(--color-primary);
}

.chat-msg-candidate .msg-bubble-content {
  border-left: 3px solid var(--color-cyan);
  background: rgba(14, 116, 144, 0.15);
}

.msg-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  margin-bottom: 0.25rem;
}

.msg-author {
  font-weight: 700;
  color: #e2e8f0;
}

.msg-timestamp {
  color: var(--text-muted);
}

.msg-text {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-primary);
}

.code-inline {
  background: rgba(0, 0, 0, 0.3);
  color: var(--color-sky);
  padding: 2px 4px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.8em;
}

/* Chat Input Bar */
.chat-input-row {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.chat-input-field {
  flex: 1;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-sm);
  color: #ffffff;
  padding: 0.65rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  outline: none;
}

.chat-input-field:focus {
  border-color: var(--color-primary);
}

.mic-active {
  background: var(--color-rose) !important;
  color: #ffffff !important;
  animation: pulse 1.2s infinite;
}

.btn-muted {
  color: var(--color-rose) !important;
}

.webcam-active {
  background: var(--color-emerald) !important;
  color: #ffffff !important;
}

@media (max-width: 1024px) {
  .interview-stage-container {
    grid-template-columns: 1fr;
    height: auto;
  }
}
