/* =========================================================
   Recruta.ai — Design System & Custom Styles
   Clean, Minimalista, Responsivo e Premium
   ========================================================= */

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-glow: rgba(99, 102, 241, 0.25);
  
  --secondary: #0ea5e9;
  --accent-purple: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.2);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Navbar */
.navbar-custom {
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.brand-logo {
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.navbar-logo-gbpa {
  height: 40px;
  max-height: 40px;
  width: auto;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.navbar-logo-gbpa:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

/* Cards Premium */
.card-premium {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-premium:hover {
  box-shadow: var(--shadow-md);
}

.card-header-clean {
  background: transparent;
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
}

/* Botões */
.btn-primary-custom {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 600;
  padding: 0.6rem 1.25rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(79, 70, 229, 0.2);
}

.btn-primary-custom:hover {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.35);
}

.btn-secondary-custom {
  background: #ffffff;
  color: var(--text-main);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-weight: 500;
  padding: 0.6rem 1.25rem;
  transition: all 0.2s ease;
}

.btn-secondary-custom:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

/* Badges */
.badge-status-pending { background-color: #f1f5f9; color: #475569; }
.badge-status-invited { background-color: #e0f2fe; color: #0284c7; }
.badge-status-in_progress { background-color: #fef3c7; color: #d97706; }
.badge-status-completed { background-color: #ecfdf5; color: #059669; }
.badge-status-approved { background-color: #dcfce7; color: #15803d; }
.badge-status-rejected { background-color: #fee2e2; color: #b91c1c; }

/* =========================================================
   SALA DE ENTREVISTA (EXPERIÊNCIA DO CANDIDATO)
   ========================================================= */

.interview-viewport {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: radial-gradient(circle at 50% 20%, #1e1b4b 0%, #0f172a 60%, #020617 100%);
  color: #f8fafc;
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

.interview-header {
  padding: 1.25rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.interview-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
}

/* Orbe de IA e Visualizador */
.ai-orb-container {
  position: relative;
  width: 240px;
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.ai-orb-core {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #818cf8 0%, #4f46e5 50%, #312e81 100%);
  box-shadow: 0 0 45px rgba(99, 102, 241, 0.6);
  position: relative;
  z-index: 2;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-orb-glow {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(129, 140, 248, 0.3) 0%, transparent 70%);
  animation: pulse-glow 3s infinite ease-in-out;
  z-index: 1;
}

/* Estados da IA */
.ai-state-speaking .ai-orb-core {
  transform: scale(1.15);
  box-shadow: 0 0 65px rgba(129, 140, 248, 0.9), 0 0 100px rgba(99, 102, 241, 0.5);
  animation: speech-bounce 1.2s infinite alternate ease-in-out;
}

.ai-state-listening .ai-orb-core {
  transform: scale(0.95);
  box-shadow: 0 0 35px rgba(16, 185, 129, 0.5);
  background: radial-gradient(circle at 35% 35%, #34d399 0%, #059669 60%, #064e3b 100%);
}

.ai-state-listening .ai-orb-glow {
  background: radial-gradient(circle, rgba(52, 211, 153, 0.3) 0%, transparent 70%);
}

.ai-state-user-speaking .ai-orb-core {
  transform: scale(1.05);
  box-shadow: 0 0 50px rgba(14, 165, 233, 0.7);
  background: radial-gradient(circle at 35% 35%, #38bdf8 0%, #0284c7 60%, #0c4a6e 100%);
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.3); opacity: 0.9; }
}

@keyframes speech-bounce {
  0% { transform: scale(1.08); }
  100% { transform: scale(1.22); }
}

/* Canvas de onda sonora */
.visualizer-canvas {
  width: 100%;
  max-width: 480px;
  height: 60px;
  margin-bottom: 1.5rem;
}

/* Legendas em Tempo Real */
.caption-box {
  width: 100%;
  max-width: 640px;
  min-height: 80px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  text-align: center;
  backdrop-filter: blur(10px);
  margin-bottom: 2rem;
  transition: all 0.2s ease;
}

.caption-speaker {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #818cf8;
  margin-bottom: 0.25rem;
}

.caption-text {
  font-size: 1.05rem;
  color: #f1f5f9;
  font-weight: 400;
  line-height: 1.5;
}

/* Controles da Entrevista */
.interview-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  z-index: 10;
}

.control-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  font-size: 1.3rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.control-btn-mic {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.control-btn-mic:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.control-btn-mic.muted {
  background: #ef4444;
  color: #ffffff;
  border-color: #dc2626;
}

.control-btn-end {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);
}

.control-btn-end:hover {
  background: #dc2626;
  transform: scale(1.05);
}

.barge-in-tip {
  font-size: 0.85rem;
  color: #94a3b8;
  margin-top: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* Lobby de Boas-Vindas */
.lobby-card {
  background: #ffffff;
  border-radius: var(--radius-xl);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
  border: 1px solid var(--border-color);
  padding: 2.5rem;
  max-width: 600px;
  width: 100%;
}

.mic-meter-bar {
  height: 8px;
  border-radius: 4px;
  background: #e2e8f0;
  overflow: hidden;
  margin-top: 0.5rem;
}

.mic-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981 0%, #3b82f6 70%, #ef4444 100%);
  transition: width 0.05s ease;
}

/* Página pública do candidato (boas-vindas e conclusão) */
.candidate-page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 1rem 0.75rem calc(1.25rem + env(safe-area-inset-bottom));
  overflow-x: hidden;
}

.candidate-shell {
  width: min(600px, 100%);
  padding-left: 0;
  padding-right: 0;
}

.mic-test-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.interview-brand,
.interview-meta,
.interview-timer {
  display: flex;
  align-items: center;
  min-width: 0;
}

.interview-brand {
  gap: 0.6rem;
  flex: 1 1 180px;
}

.interview-brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
}

.interview-brand-copy {
  min-width: 0;
}

.interview-job-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.interview-meta {
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.interview-timer {
  gap: 0.3rem;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  white-space: nowrap;
}

#statusBadge {
  max-width: 100%;
  white-space: normal;
  text-align: center;
  line-height: 1.25;
}

.caption-text,
.barge-in-tip {
  overflow-wrap: anywhere;
}

.barge-in-tip {
  max-width: 36rem;
  padding: 0 0.75rem;
  text-align: center;
  justify-content: center;
  flex-wrap: wrap;
}

/* Responsividade Mobile */
@media (min-width: 768px) {
  .candidate-page {
    align-items: center;
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
}

@media (max-width: 768px) {
  .lobby-card {
    padding: 1.25rem 1rem;
    border-radius: 18px;
  }

  .ai-orb-container {
    width: 150px;
    height: 150px;
    margin-bottom: 0.85rem;
  }
  .ai-orb-core {
    width: 92px;
    height: 92px;
  }
  .ai-orb-glow {
    width: 124px;
    height: 124px;
  }
  .caption-box {
    padding: 0.75rem 0.9rem;
    min-height: 0;
    margin-bottom: 1rem;
  }
  .caption-text {
    font-size: 0.95rem;
  }
  .interview-viewport {
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .interview-header {
    padding: 0.85rem 0.9rem calc(0.85rem + env(safe-area-inset-top));
    gap: 0.65rem;
    align-items: flex-start;
  }
  .interview-meta {
    width: 100%;
    justify-content: space-between;
  }
  .interview-stage {
    justify-content: flex-start;
    padding: 1rem 0.85rem calc(1.15rem + env(safe-area-inset-bottom));
  }
  .visualizer-canvas {
    height: 48px;
    margin-bottom: 0.85rem;
  }
}

@media (max-width: 420px) {
  .interview-timer span:last-child {
    display: none;
  }
  .ai-orb-container {
    width: 128px;
    height: 128px;
  }
  .control-btn {
    width: 52px;
    height: 52px;
  }
}

@media (max-height: 700px) {
  .ai-orb-container {
    width: 112px;
    height: 112px;
    margin-bottom: 0.45rem;
  }
  .ai-orb-core {
    width: 72px;
    height: 72px;
  }
  .visualizer-canvas {
    height: 36px;
    margin-bottom: 0.5rem;
  }
  .caption-box {
    margin-bottom: 0.7rem;
  }
}

/* =========================================================
   Grid e Botões Uniformes da Coluna Ações
   ========================================================= */

.col-actions {
  width: 290px;
  min-width: 290px;
  text-align: right;
}

.actions-grid {
  display: inline-grid;
  grid-template-columns: 116px 36px 104px;
  gap: 8px;
  align-items: center;
  justify-content: end;
}

.btn-action-copy {
  width: 116px;
  height: 36px;
  white-space: nowrap !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: #ffffff;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.btn-action-copy:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: var(--text-main);
}

.btn-action-open {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: var(--radius-sm);
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--primary);
  font-size: 0.95rem;
  transition: all 0.15s ease;
}

.btn-action-open:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: var(--primary-hover);
}

.btn-action-scorecard {
  width: 104px;
  height: 36px;
  white-space: nowrap !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0 8px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  color: #ffffff;
  border: none;
  text-decoration: none;
  box-shadow: 0 1px 3px rgba(79, 70, 229, 0.25);
  transition: all 0.15s ease;
}

.btn-action-scorecard:hover {
  background: linear-gradient(135deg, #4338ca 0%, #4f46e5 100%);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(79, 70, 229, 0.35);
}

.btn-action-placeholder {
  width: 104px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.8rem;
}

/* Links interativos para nomes de candidatos */
.candidate-name-btn {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  text-align: left;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: color 0.15s ease;
}

.candidate-name-btn:hover {
  color: var(--primary) !important;
  text-decoration: underline;
}

.candidate-name-btn:hover .candidate-name-icon {
  color: var(--primary) !important;
  transform: translateY(-1px);
}

.candidate-name-icon {
  transition: transform 0.15s ease, color 0.15s ease;
}
