/* MIKA Interview Voice UI + Hudhud fixed widget */

.interview-container,
#interview-bot-overlay .interview-container {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding-bottom: 100px;
}

#interview-bot-overlay {
  font-family: 'Cairo', sans-serif;
}

#interview-bot-overlay .interview-container {
  color: #F1F5F9;
}

.interviewer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.interviewer-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.interviewer-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.interviewer-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: border-color 0.3s;
  display: block;
  object-fit: cover;
}

.interviewer-avatar.speaking {
  border-color: #FF8C42;
  animation: avatarPulse 0.6s ease-in-out infinite alternate;
}

@keyframes avatarPulse {
  from { box-shadow: 0 0 0 0 rgba(255, 140, 66, 0.4); }
  to { box-shadow: 0 0 0 12px rgba(255, 140, 66, 0); }
}

.speaking-rings .ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid rgba(255, 140, 66, 0.3);
  animation: ringExpand 1.5s ease-out infinite;
  opacity: 0;
  pointer-events: none;
}

.ring-1 { animation-delay: 0s; }
.ring-2 { animation-delay: 0.5s; }
.ring-3 { animation-delay: 1s; }

@keyframes ringExpand {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.8); opacity: 0; }
}

.interviewer-name {
  font-weight: 800;
  color: #F1F5F9;
  font-size: 1rem;
}

.interviewer-title {
  font-size: 0.8rem;
  color: #64748B;
}

.interviewer-speaking-indicator {
  display: none;
  align-items: center;
  gap: 4px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.75rem;
  color: #FF8C42;
  margin-top: 4px;
}

.interviewer-speaking-indicator.active { display: flex; }

.interviewer-speaking-indicator .dot {
  width: 5px;
  height: 5px;
  background: #FF8C42;
  border-radius: 50%;
  animation: dotBounce 0.6s ease-in-out infinite alternate;
}

.interviewer-speaking-indicator .dot:nth-child(2) { animation-delay: 0.2s; }
.interviewer-speaking-indicator .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}

.btn-speak-question {
  background: rgba(255, 140, 66, 0.1);
  border: 1px solid rgba(255, 140, 66, 0.3);
  color: #FF8C42;
  border-radius: 12px;
  padding: 8px 16px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-speak-question:hover {
  background: rgba(255, 140, 66, 0.2);
}

.question-bubble {
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

.question-bubble p,
#question-text {
  color: #F1F5F9;
  font-size: 0.95rem;
  line-height: 1.7;
  direction: ltr;
  text-align: left;
  margin: 0;
}

.answer-section {
  margin-bottom: 16px;
}

.answer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  gap: 8px;
  flex-wrap: wrap;
}

.answer-label {
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  color: #94A3B8;
  font-weight: 700;
}

.answer-mode-toggle {
  display: flex;
  gap: 6px;
  background: #0F172A;
  border-radius: 12px;
  padding: 4px;
}

.mode-btn {
  background: transparent;
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.82rem;
  color: #64748B;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-btn.active {
  background: #1E293B;
  color: #F1F5F9;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.answer-textarea,
#student-answer {
  width: 100%;
  min-height: 120px;
  background: #0F172A;
  border: 2px solid #334155;
  border-radius: 12px;
  padding: 14px;
  color: #F1F5F9;
  font-size: 0.9rem;
  resize: vertical;
  font-family: 'Cairo', sans-serif;
  direction: ltr;
  text-align: left;
  box-sizing: border-box;
}

.voice-controls {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: rgba(34, 197, 94, 0.04);
  border: 1px dashed rgba(34, 197, 94, 0.2);
  border-radius: 16px;
  margin-top: 8px;
}

.voice-controls.active { display: flex; }

.voice-input-btn {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #1E293B;
  border: 3px solid #334155;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  transition: all 0.2s;
}

.voice-input-btn:hover {
  border-color: #22C55E;
  background: rgba(34, 197, 94, 0.1);
}

.voice-input-btn.listening {
  border-color: #EF4444;
  background: rgba(239, 68, 68, 0.1);
  animation: micPulse 1s ease-in-out infinite;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { box-shadow: 0 0 0 16px rgba(239, 68, 68, 0); }
}

.voice-pulse {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid rgba(239, 68, 68, 0.3);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.voice-pulse.active {
  opacity: 1;
  animation: pulseRing 1s ease-out infinite;
}

@keyframes pulseRing {
  0% { transform: scale(1); opacity: 0.5; }
  100% { transform: scale(1.5); opacity: 0; }
}

.voice-status {
  text-align: center;
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  color: #94A3B8;
}

.voice-interim {
  display: block;
  font-size: 0.8rem;
  color: #22C55E;
  font-style: italic;
  min-height: 20px;
}

.voice-tip {
  font-family: 'Cairo', sans-serif;
  font-size: 0.78rem;
  color: #475569;
  text-align: center;
  margin: 0;
}

.voice-not-supported {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #FCA5A5;
  border-radius: 10px;
  padding: 10px 16px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.82rem;
  text-align: center;
}

.hidden { display: none !important; }

.word-count-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.8rem;
  color: #64748B;
  flex-wrap: wrap;
  gap: 8px;
}

#word-count-display {
  font-weight: 700;
}

.btn-submit-answer {
  width: 100%;
  background: linear-gradient(135deg, #6C63FF, #22C55E);
  border: none;
  border-radius: 14px;
  padding: 16px;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  font-family: 'Cairo', sans-serif;
}

.btn-submit-answer:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(34, 197, 94, 0.25);
}

/* Hudhud interview widget */
.hudhud-widget {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  pointer-events: none;
}

[dir="rtl"] .hudhud-widget {
  left: 24px;
  right: auto;
}

.hudhud-widget > * { pointer-events: auto; }

.hudhud-bubble {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 16px 16px 4px 16px;
  padding: 10px 14px;
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  color: #F1F5F9;
  max-width: 200px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.hudhud-bubble.visible {
  opacity: 1;
  transform: translateY(0);
}

.hudhud-bubble::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 16px;
  border: 4px solid transparent;
  border-top-color: #334155;
}

.hudhud-mute-btn {
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  align-self: flex-end;
  margin-bottom: -4px;
}

.hudhud-mute-btn:hover { background: #334155; }

.hudhud-avatar-btn {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E293B, #0F172A);
  border: 3px solid #334155;
  cursor: pointer;
  padding: 0;
  overflow: visible;
  transition: border-color 0.2s, transform 0.2s;
}

.hudhud-avatar-btn:hover {
  border-color: #FF8C42;
  transform: scale(1.05);
}

.hudhud-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.hudhud-talking-rings { display: none; }

.hudhud-widget.talking .hudhud-talking-rings { display: block; }

.h-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 140, 66, 0.3);
  animation: hRingExpand 1.2s ease-out infinite;
  opacity: 0;
  pointer-events: none;
}

.h-ring-2 { animation-delay: 0.6s; }

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

.hudhud-label {
  font-family: 'Cairo', sans-serif;
  font-size: 0.7rem;
  color: #475569;
  text-align: center;
}

.hudhud-voice-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hudhud-voice-modal.active { display: flex; }

.hudhud-modal-card {
  background: #1E293B;
  border: 1px solid #334155;
  border-radius: 24px;
  padding: 32px;
  max-width: 320px;
  text-align: center;
  font-family: 'Cairo', sans-serif;
}

.hudhud-modal-icon { font-size: 3rem; margin-bottom: 12px; }

.hudhud-modal-card h3 {
  color: #F1F5F9;
  font-size: 1.2rem;
  margin: 0 0 8px;
}

.hudhud-modal-card p {
  color: #94A3B8;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 20px;
}

.hudhud-modal-btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-allow {
  background: linear-gradient(135deg, #FF8C42, #FF6B1A);
  color: white;
  border: none;
  border-radius: 14px;
  padding: 14px;
  font-family: 'Cairo', sans-serif;
  font-weight: 700;
  cursor: pointer;
  font-size: 0.95rem;
}

.btn-deny {
  background: transparent;
  border: 1px solid #334155;
  color: #64748B;
  border-radius: 14px;
  padding: 12px;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  font-size: 0.85rem;
}

body.interview-active,
body.hudhud-widget-active {
  padding-bottom: 100px;
}

.page-content,
.interview-container,
main,
#content .ibot-wrapper {
  padding-bottom: 100px;
}

.ibot-cat-badge-wrap {
  text-align: center;
  margin-bottom: 12px;
  max-width: 600px;
}

.ibot-cat-badge-wrap .ibot-cat-badge {
  display: inline-block;
  border-radius: 12px;
  padding: 4px 12px;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
}

@media (max-width: 390px) {
  .hudhud-widget {
    bottom: 16px;
    left: 16px;
  }

  .hudhud-avatar-btn {
    width: 52px;
    height: 52px;
  }

  .hudhud-bubble {
    max-width: 160px;
    font-size: 0.78rem;
  }

  .voice-input-btn {
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
  }
}
