:root {
  --bg: #0a0f1a;
  --surface: #0f1526;
  --card: #121a2b;
  --muted: #9aa6b2;
  --text: #eef2f7;
  --accent: #3aa4e0;
  --accent-2: #5cc2f1;
  --danger: #ef5350;
  --success: #20c997;
  --border: #1a2235;
  --radius: 16px;
  --shadow: 0 20px 40px rgba(0,0,0,.3);
  --gradient-primary: linear-gradient(135deg, #3aa4e0, #5cc2f1);
  --gradient-surface: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { 
  margin: 0; 
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; 
  background: 
    radial-gradient(1200px 600px at 18% -12%, rgba(60,160,220,.12), transparent), 
    radial-gradient(1000px 520px at 110% 8%, rgba(40,140,200,.08), transparent), 
    var(--bg); 
  color: var(--text); 
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { 
  position: sticky; 
  top: 0; 
  background: linear-gradient(180deg, rgba(13,19,40,.95), rgba(13,19,40,.85)); 
  backdrop-filter: blur(20px); 
  border-bottom: 1px solid var(--border); 
  z-index: 10; 
  box-shadow: 0 4px 20px rgba(0,0,0,.2);
}

.topbar .brand { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 16px 24px; 
  display: flex; 
  align-items: center; 
  gap: 20px; 
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 16px;
}

.company-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: contain;
  background: var(--surface);
  border: 1px solid var(--border);
}

.logo-fallback {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(58, 164, 224, 0.3);
}

.logo-icon {
  width: 24px;
  height: 24px;
  background: white;
  border-radius: 6px;
  display: inline-block;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.company-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.app-title {
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
}

.topbar .brand::before { 
  content: ''; 
  width: 10px; 
  height: 10px; 
  border-radius: 50%; 
  background: #69db7c; 
  box-shadow: 0 0 0 0 rgba(34,197,94,.7); 
  transition: background .2s ease; 
}

body.recording .topbar .brand::before { 
  background: #ff5252; 
  animation: pulse 1s infinite; 
}
.shell { 
  max-width: 1200px; 
  margin: 0 auto; 
  padding: 32px 24px; 
}

.card { 
  position: relative; 
  background: var(--gradient-surface); 
  border: 1px solid var(--border); 
  border-radius: var(--radius); 
  padding: 40px; 
  box-shadow: var(--shadow); 
  overflow: hidden; 
}

.card::before { 
  content: ''; 
  position: absolute; 
  inset: 0; 
  background: 
    radial-gradient(800px 300px at -10% -10%, rgba(79,140,255,.08), transparent), 
    radial-gradient(600px 260px at 110% -10%, rgba(122,162,255,.06), transparent); 
  pointer-events: none; 
}
.center { text-align: center; }
.sub { color: var(--muted); }

/* Welcome Section Styles */
.welcome-section {
  max-width: 900px;
  margin: 0 auto;
}

.welcome-header {
  text-align: center;
  margin-bottom: 48px;
}

.welcome-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: var(--gradient-primary);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 32px rgba(58, 164, 224, 0.3);
}

.welcome-icon svg {
  width: 40px;
  height: 40px;
  color: white;
}

.welcome-subtitle {
  font-size: 18px;
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.interview-overview {
  margin-bottom: 48px;
}

.interview-overview h2 {
  text-align: center;
  margin-bottom: 32px;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  border-color: rgba(58, 164, 224, 0.3);
}

.feature-icon {
  width: 48px;
  height: 48px;
  background: rgba(58, 164, 224, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.feature-icon svg {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.feature-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: var(--text);
}

.feature-content p {
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

.preparation-checklist {
  margin-bottom: 48px;
}

.preparation-checklist h2 {
  text-align: center;
  margin-bottom: 24px;
  font-size: 24px;
  font-weight: 600;
  color: var(--text);
}

.checklist-items {
  max-width: 600px;
  margin: 0 auto;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.checklist-item:last-child {
  border-bottom: none;
}

.check-icon {
  width: 24px;
  height: 24px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 14px;
  flex-shrink: 0;
}

.checklist-item span {
  color: var(--text);
  font-size: 16px;
}

.start-section {
  text-align: center;
  margin-top: 48px;
}

.start-button {
  padding: 18px 36px;
  font-size: 18px;
  font-weight: 600;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
  box-shadow: 0 8px 24px rgba(58, 164, 224, 0.3);
}

.start-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(58, 164, 224, 0.4);
}

.btn-icon {
  display: flex;
  align-items: center;
}

.btn-icon svg {
  width: 20px;
  height: 20px;
}

.start-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.bullets { color: var(--muted); }
.bullets li { margin: 6px 0; position: relative; padding-left: 16px; }
.bullets li::before { content: ''; position: absolute; left: 0; top: 9px; width: 8px; height: 8px; border-radius: 50%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); box-shadow: 0 0 0 2px rgba(79,140,255,.15); }

h1 { 
  font-size: clamp(28px, 3.2vw, 40px); 
  line-height: 1.2; 
  margin: 0 0 20px 0; 
  letter-spacing: -0.02em; 
  font-weight: 700;
  background: linear-gradient(135deg, var(--text), rgba(238, 242, 247, 0.8));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 { 
  font-size: clamp(22px, 2.6vw, 28px); 
  line-height: 1.3; 
  margin: 0 0 16px 0; 
  font-weight: 600;
  color: var(--text);
}
.hidden { 
  display: none !important; 
}

.btn { 
  border: 1px solid var(--border); 
  background: var(--surface); 
  color: var(--text); 
  padding: 12px 20px; 
  border-radius: 12px; 
  cursor: pointer; 
  transition: all 0.3s ease; 
  box-shadow: 0 2px 0 rgba(255,255,255,.02) inset; 
  font-weight: 600; 
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:hover { 
  transform: translateY(-2px); 
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  border-color: rgba(58, 164, 224, 0.3);
}

.btn:active { 
  transform: translateY(0); 
}

.btn:focus-visible { 
  outline: 2px solid color-mix(in srgb, var(--accent) 70%, white); 
  outline-offset: 2px; 
}

.btn.primary { 
  background: var(--gradient-primary); 
  border: none; 
  box-shadow: 0 8px 24px rgba(58, 164, 224, 0.3); 
  color: white;
}

.btn.primary:hover {
  box-shadow: 0 12px 32px rgba(58, 164, 224, 0.4);
}

.btn.ghost { 
  background: transparent; 
  border-color: rgba(255, 255, 255, 0.1);
}

.btn.ghost:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn.tiny { 
  padding: 8px 12px; 
  font-size: 12px; 
}

.btn.danger { 
  border-color: #3b0b0b; 
  background: #1a0a0a; 
  color: #ffb4b4; 
}

.btn:disabled { 
  opacity: .5; 
  cursor: not-allowed; 
  transform: none !important;
}

#startBtn { 
  padding: 18px 36px; 
  font-size: 18px; 
  border-radius: 16px; 
}

.input { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); box-shadow: 0 2px 0 rgba(255,255,255,.02) inset; }

.video-grid { display: grid; gap: 20px; grid-template-columns: 1fr 1fr; align-items: start; }
.video-wrap { position: relative; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #000; aspect-ratio: 16/9; }
video { width: 100%; height: auto; display: block; }
.placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); background: linear-gradient(180deg, rgba(12,16,28,.92), rgba(10,14,22,.90)); backdrop-filter: blur(1px); }
.placeholder.hidden { 
  display: none !important; 
}
.spinner { width: 34px; height: 34px; border: 3px solid rgba(255,255,255,.15); border-top-color: var(--accent); border-radius: 50%; animation: spin 1s linear infinite; }
.ph-text { font-size: 14px; text-align: center; padding: 0 12px; }
.label { font-size: 12px; color: var(--muted); margin: 8px 0; }
.actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; position: sticky; bottom: 0; background: linear-gradient(180deg, transparent, rgba(0,0,0,.35)); padding-top: 10px; backdrop-filter: blur(2px); }
.status { margin-top: 10px; color: var(--muted); }
.status.error { color: #ff8b8b; }
.status.success { 
  color: #a7f3d0; 
  display: inline-flex; 
  align-items: center; 
  gap: 8px; 
  padding: 6px 10px; 
  border-radius: 999px; 
  background: rgba(34,197,94,0.12); 
  border: 1px solid rgba(34,197,94,0.25);
  box-shadow: 0 6px 18px rgba(34,197,94,0.15) inset, 0 8px 24px rgba(0,0,0,0.2);
  animation: fadeInUp 0.35s ease-out;
}

.status.success::before {
  content: '✔';
  display: inline-block; 
  width: 18px; 
  height: 18px; 
  border-radius: 50%; 
  background: linear-gradient(135deg, #34d399, #22c55e); 
  color: #05140a; 
  font-weight: 900; 
  font-size: 12px; 
  line-height: 18px; 
  text-align: center; 
  box-shadow: 0 0 10px rgba(52,211,153,0.35);
}

.meta { display: flex; justify-content: space-between; align-items: center; color: var(--muted); margin-bottom: 8px; gap: 16px; }
.pill { padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; }
.timer { font-variant-numeric: tabular-nums; }

.stepbar { width: 100%; height: 8px; background: #0e1520; border-radius: 999px; margin-bottom: 16px; overflow: hidden; border: 1px solid var(--border); box-shadow: inset 0 1px 0 rgba(255,255,255,.03); }
.progress { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); width: 0%; transition: width .4s ease; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 16px; overflow: hidden; border-radius: 12px; }
thead th { position: sticky; top: 0; background: rgba(255,255,255,.04); text-transform: uppercase; font-size: 11px; letter-spacing: .6px; backdrop-filter: blur(6px); }
th, td { border-bottom: 1px solid var(--border); padding: 12px; text-align: left; color: var(--text); }
tbody tr:nth-child(odd) td { background: rgba(255,255,255,.012); }
tbody tr:hover td { background: rgba(255,255,255,.034); }
.muted { color: var(--muted); }
code { background: rgba(255,255,255,.06); border: 1px solid var(--border); padding: 2px 6px; border-radius: 6px; }

.admin-controls { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 14px; }

.message-examples {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.02);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.rec-dot { position: absolute; top: 10px; left: 10px; width: 12px; height: 12px; background: #ff5252; border-radius: 50%; box-shadow: 0 0 12px rgba(255,82,82,.8); }
.video-wrap.recording-on { box-shadow: inset 0 0 0 2px rgba(79,140,255,.6), 0 0 0 4px rgba(79,140,255,.08); }

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255,82,82,.6); }
  70% { box-shadow: 0 0 0 12px rgba(255,82,82,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,82,82,0); }
}

@keyframes pulse-text {
  0% { opacity: 0.8; }
  50% { opacity: 1; }
  100% { opacity: 0.8; }
}

@keyframes progress-glow {
  0% { box-shadow: 0 0 5px rgba(79,140,255,0.3); }
  50% { box-shadow: 0 0 20px rgba(79,140,255,0.6); }
  100% { box-shadow: 0 0 5px rgba(79,140,255,0.3); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Success Animation */
.success-animation { text-align: center; animation: fadeInUp 0.6s ease-out; }

.checkmark {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--success), #16a34a);
  color: white;
  font-size: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  animation: scaleIn 0.5s ease-out 0.3s both;
}

/* Live Message Toast */
.toast {
  position: fixed;
  top: 16px;
  right: 16px;
  max-width: 320px;
  background: linear-gradient(135deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(79,140,255,0.25);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 0 1px rgba(79,140,255,0.08);
  z-index: 1000;
  animation: slideInRight 0.3s ease-out;
  overflow: hidden;
  backdrop-filter: blur(6px);
}

.toast-content {
  display: flex;
  align-items: flex-start;
  gap: 0;
  padding: 12px 16px;
}

.toast-icon {
  width: 4px;
  height: 4px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-radius: 50%;
  margin-top: 6px;
  margin-right: 12px;
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(79,140,255,0.5);
}

.toast-message {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
  flex: 1;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0,0,0,.95), rgba(12,17,22,.98));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  animation: fadeIn 0.4s ease-out;
  backdrop-filter: blur(4px);
}

.loading-overlay:not(.hidden) {
  display: flex !important;
}

.loading-spinner {
  width: 80px;
  height: 80px;
  border: 3px solid rgba(79,140,255,.15);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1.2s linear infinite;
  margin-bottom: 24px;
  box-shadow: 0 0 30px rgba(79,140,255,.2);
}

.loading-text {
  color: var(--text);
  font-size: 20px;
  font-weight: 600;
  text-align: center;
  max-width: 400px;
  line-height: 1.4;
  animation: pulse-text 2s ease-in-out infinite;
  margin-bottom: 20px;
}

.loading-progress {
  width: 300px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 10px;
}

.loading-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 2px;
  width: 0%;
  transition: width 0.5s ease-out;
  animation: progress-glow 2s ease-in-out infinite;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

@media (max-width: 900px) {
  .video-grid { grid-template-columns: 1fr; }
  .meta { flex-wrap: wrap; }
  .modal-content { width: 95%; margin: 20px; }
  
  .applicant-header {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  
  .applicant-info {
    flex-direction: column;
    gap: 12px;
  }
  
  .applicant-name {
    font-size: 18px;
  }
  
  .progress-circle {
    width: 50px;
    height: 50px;
  }
}

/* Interview Interface Transitions */
#interview { 
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
#interview:not(.hidden) { 
  opacity: 1;
  transform: translateY(0);
}

/* Applicant Header */
.applicant-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.applicant-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.applicant-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(79,140,255,0.3);
  position: relative;
}

.applicant-avatar::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: 0.3;
  z-index: -1;
}

.avatar-initial {
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
}

.applicant-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.applicant-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}

.applicant-status {
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.interview-progress {
  display: flex;
  align-items: center;
}

.progress-circle {
  position: relative;
  width: 60px;
  height: 60px;
}

.progress-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.progress-circle path:first-child {
  fill: none;
  stroke: rgba(255,255,255,0.1);
  stroke-width: 3;
}

.progress-circle path:last-child {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.8s ease-out;
}

.progress-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
}

.progress-text span {
  font-size: 16px;
  color: var(--accent);
}
