* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  font-family: 'Arial', sans-serif;
  background-image: url('bg.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: white;
  overflow: hidden;
  position: relative;
}

/* ITCS Brand accent elements */
body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  /* background: linear-gradient(90deg, #dc2626 0%, #ffffff 50%, #dc2626 100%); */
  z-index: 1000;
}

body::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  /* background: linear-gradient(90deg, #dc2626 0%, #ffffff 50%, #dc2626 100%); */
  z-index: 1000;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  /* Align content to bottom */
  height: 100vh;
  text-align: center;
  position: relative;
  z-index: 10;
  /* Position container above avatar */
  /* Removed background and backdrop-filter to show avatar through */
  padding-bottom: 0;
  /* Remove bottom padding */
}

/* Bottom Info Panel */
.bottom-info-panel {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 24vh;
  /* background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 10%, rgb(35 35 35 / 60%) 40%, rgba(0, 0, 0, 0.0) 100%, transparent 100%); */
  /* backdrop-filter: blur(10px); */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 15;
  padding: 15px;
}

.container>h1,
.container>.logo-container,
.container>.subtitle,
.container>.start-btn {
  position: relative;
  z-index: 20;
}

/* ITCS Branding Elements */
.container::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 10%;
  right: 10%;
  height: 2px;
  /* background: linear-gradient(90deg, transparent, #dc2626, transparent); */
}

.container::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 10%;
  right: 10%;
  height: 2px;
  /* background: linear-gradient(90deg, transparent, #dc2626, transparent); */
}

/* Avatar Container - Full Screen Background */
.avatar-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  /* Behind all UI elements */
  background: transparent;
  overflow: hidden;
}

.avatar-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.avatar-subtitle {
  position: fixed;
  left: 50%;
  bottom: 100px;
  transform: translateX(-50%);
  background: rgba(11, 15, 26, .8);
  border: 1px solid #304166;
  border-radius: 10px;
  padding: 12px 18px;
  color: #fff;
  backdrop-filter: blur(6px);
  font-size: 16px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  max-width: 80%;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.avatar-subtitle.show {
  opacity: 1;
}

/* Ensure all UI elements are above the avatar */
.container {
  position: relative;
  z-index: 50;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .avatar-container {
    /* Full screen on mobile too */
    width: 100vw;
    height: 100vh;
  }

  .avatar-subtitle {
    font-size: 14px;
    padding: 10px 16px;
    bottom: 80px;
    max-width: 90%;
  }
}

.ai-avatar {
  width: 300px;
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 40px;
  position: relative;
}

.ai-avatar canvas {
  width: 100% !important;
  height: 100% !important;
}

.ai-face {
  font-size: 80px;
  color: white;
  display: none;
  /* Hide the emoji */
}

#avatar-canvas {
  width: 100%;
  height: 100%;
  /* Removed border-radius: 50% to allow full screen display */
}

/* Sound Wave Visualization */
.sound-wave-container {
  width: 200px;
  height: 200px;
  margin: 0 auto 40px;
  position: relative;
}

.sound-wave {
  width: 100%;
  height: 100%;
}

.wave-circle {
  fill: none;
  stroke: #dc2626;
  stroke-width: 2;
  opacity: 0.6;
  transform-origin: center;
  filter: url(#waveDistortion);
}

.wave-circle-1 {
  animation: circleWaveIdle1 4s ease-in-out infinite;
  stroke-width: 3;
  opacity: 0.8;
}

.wave-circle-2 {
  animation: circleWaveIdle2 5s ease-in-out infinite 0.5s;
  stroke-width: 2;
  opacity: 0.6;
}

.wave-circle-3 {
  animation: circleWaveIdle3 6s ease-in-out infinite 1s;
  stroke-width: 1;
  opacity: 0.4;
}

/* Active talking animations */
.sound-wave-container.talking .wave-circle-1 {
  animation: circleWaveActive1 0.8s ease-in-out infinite;
  stroke-width: 4;
  opacity: 1;
}

.sound-wave-container.talking .wave-circle-2 {
  animation: circleWaveActive2 1.2s ease-in-out infinite 0.2s;
  stroke-width: 3;
  opacity: 0.8;
}

.sound-wave-container.talking .wave-circle-3 {
  animation: circleWaveActive3 0.6s ease-in-out infinite 0.1s;
  stroke-width: 2;
  opacity: 0.6;
}

/* Idle circle animations (gentle breathing) */
@keyframes circleWaveIdle1 {

  0%,
  100% {
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(0 0 5px rgba(220, 38, 38, 0.3));
  }

  50% {
    transform: scale(1.05) rotate(180deg);
    filter: drop-shadow(0 0 10px rgba(220, 38, 38, 0.5));
  }
}

@keyframes circleWaveIdle2 {

  0%,
  100% {
    transform: scale(1.1) rotate(0deg);
    filter: drop-shadow(0 0 3px rgba(220, 38, 38, 0.2));
  }

  50% {
    transform: scale(1.15) rotate(-180deg);
    filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.4));
  }
}

@keyframes circleWaveIdle3 {

  0%,
  100% {
    transform: scale(1.2) rotate(0deg);
    filter: drop-shadow(0 0 2px rgba(220, 38, 38, 0.1));
  }

  50% {
    transform: scale(1.25) rotate(180deg);
    filter: drop-shadow(0 0 6px rgba(220, 38, 38, 0.3));
  }
}

/* Active talking animations (dramatic distortion with tighter curves) */
@keyframes circleWaveActive1 {
  0% {
    transform: scale(1) rotate(0deg);
    filter: drop-shadow(0 0 15px rgba(220, 38, 38, 0.8)) contrast(1.2);
  }

  12.5% {
    transform: scale(1.15, 0.85) rotate(45deg);
    filter: drop-shadow(0 0 25px rgba(220, 38, 38, 1)) contrast(1.5);
  }

  25% {
    transform: scale(1.2, 0.8) rotate(90deg);
    filter: drop-shadow(0 0 30px rgba(220, 38, 38, 1.2)) contrast(1.6);
  }

  37.5% {
    transform: scale(0.85, 1.15) rotate(135deg);
    filter: drop-shadow(0 0 25px rgba(220, 38, 38, 1)) contrast(1.5);
  }

  50% {
    transform: scale(0.8, 1.2) rotate(180deg);
    filter: drop-shadow(0 0 20px rgba(220, 38, 38, 0.9)) contrast(1.3);
  }

  62.5% {
    transform: scale(1.1, 0.9) rotate(225deg);
    filter: drop-shadow(0 0 28px rgba(220, 38, 38, 1.1)) contrast(1.5);
  }

  75% {
    transform: scale(1.25, 0.75) rotate(270deg);
    filter: drop-shadow(0 0 35px rgba(220, 38, 38, 1.3)) contrast(1.7);
  }

  87.5% {
    transform: scale(0.9, 1.1) rotate(315deg);
    filter: drop-shadow(0 0 22px rgba(220, 38, 38, 1)) contrast(1.4);
  }

  100% {
    transform: scale(1) rotate(360deg);
    filter: drop-shadow(0 0 15px rgba(220, 38, 38, 0.8)) contrast(1.2);
  }
}

@keyframes circleWaveActive2 {
  0% {
    transform: scale(1.1) rotate(0deg);
    filter: drop-shadow(0 0 12px rgba(220, 38, 38, 0.6)) brightness(1.1);
  }

  16.66% {
    transform: scale(1.25, 0.75) rotate(60deg);
    filter: drop-shadow(0 0 20px rgba(220, 38, 38, 0.9)) brightness(1.3);
  }

  33.33% {
    transform: scale(1.3, 0.7) rotate(120deg);
    filter: drop-shadow(0 0 25px rgba(220, 38, 38, 1.1)) brightness(1.4);
  }

  50% {
    transform: scale(0.7, 1.3) rotate(180deg);
    filter: drop-shadow(0 0 18px rgba(220, 38, 38, 0.8)) brightness(1.2);
  }

  66.66% {
    transform: scale(0.75, 1.25) rotate(240deg);
    filter: drop-shadow(0 0 22px rgba(220, 38, 38, 1)) brightness(1.35);
  }

  83.33% {
    transform: scale(1.2, 0.8) rotate(300deg);
    filter: drop-shadow(0 0 24px rgba(220, 38, 38, 1.05)) brightness(1.3);
  }

  100% {
    transform: scale(1.1) rotate(360deg);
    filter: drop-shadow(0 0 12px rgba(220, 38, 38, 0.6)) brightness(1.1);
  }
}

@keyframes circleWaveActive3 {
  0% {
    transform: scale(1.2) rotate(0deg);
    filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.4)) hue-rotate(0deg);
  }

  10% {
    transform: scale(1.35, 0.65) rotate(36deg);
    filter: drop-shadow(0 0 15px rgba(220, 38, 38, 0.7)) hue-rotate(5deg);
  }

  20% {
    transform: scale(1.4, 0.6) rotate(72deg);
    filter: drop-shadow(0 0 18px rgba(220, 38, 38, 0.8)) hue-rotate(8deg);
  }

  30% {
    transform: scale(0.65, 1.35) rotate(108deg);
    filter: drop-shadow(0 0 12px rgba(220, 38, 38, 0.6)) hue-rotate(10deg);
  }

  40% {
    transform: scale(0.6, 1.4) rotate(144deg);
    filter: drop-shadow(0 0 16px rgba(220, 38, 38, 0.75)) hue-rotate(8deg);
  }

  50% {
    transform: scale(1.25, 0.75) rotate(180deg);
    filter: drop-shadow(0 0 20px rgba(220, 38, 38, 0.9)) hue-rotate(5deg);
  }

  60% {
    transform: scale(1.3, 0.7) rotate(216deg);
    filter: drop-shadow(0 0 14px rgba(220, 38, 38, 0.65)) hue-rotate(10deg);
  }

  70% {
    transform: scale(0.7, 1.3) rotate(252deg);
    filter: drop-shadow(0 0 17px rgba(220, 38, 38, 0.8)) hue-rotate(12deg);
  }

  80% {
    transform: scale(0.75, 1.25) rotate(288deg);
    filter: drop-shadow(0 0 13px rgba(220, 38, 38, 0.7)) hue-rotate(8deg);
  }

  90% {
    transform: scale(1.15, 0.85) rotate(324deg);
    filter: drop-shadow(0 0 11px rgba(220, 38, 38, 0.55)) hue-rotate(3deg);
  }

  100% {
    transform: scale(1.2) rotate(360deg);
    filter: drop-shadow(0 0 8px rgba(220, 38, 38, 0.4)) hue-rotate(0deg);
  }
}

h1 {
  font-size: 2rem;
  /* Reduced from 2.5rem */
  margin-bottom: 8px;
  /* Reduced margin */
  font-weight: bold;
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  /* Removed individual background - using panel gradient */
}

.subtitle {
  font-size: 1rem;
  /* Reduced from 1.2rem */
  opacity: 0.9;
  margin-bottom: 20px;
  /* Reduced margin */
  font-weight: 300;
  color: #e5e5e5;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  /* Removed individual background - using panel gradient */
}

.start-btn {
  background: linear-gradient(45deg, #dc2626, #991b1b);
  border: 2px solid white;
  color: white;
  padding: 15px 40px;
  font-size: 1.1rem;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.start-btn:hover {
  background: linear-gradient(45deg, #991b1b, #7f1d1d);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(220, 38, 38, 0.4);
}

.start-btn:disabled {
  background: #4a4a4a;
  color: #999;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  border-color: #666;
}

.status {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  padding: 8px 16px;
  border-radius: 15px;
  font-size: 0.8rem;
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity 0.3s ease;
  border: 1px solid rgba(220, 38, 38, 0.5);
}

.status.show {
  opacity: 1;
}

.debug-panel {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.9);
  padding: 15px;
  border-radius: 10px;
  font-family: monospace;
  font-size: 12px;
  max-width: 300px;
  max-height: 400px;
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  border: 1px solid #dc2626;
}

.debug-panel.show {
  opacity: 1;
  pointer-events: all;
}

.debug-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  background: rgba(220, 38, 38, 0.8);
  border: 1px solid white;
  color: white;
  padding: 10px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
  font-weight: bold;
}

.debug-toggle:hover {
  background: rgba(220, 38, 38, 1);
}

.debug-buttons {
  position: fixed;
  top: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1002;
}

.debug-buttons.show {
  opacity: 1;
  pointer-events: all;
}

.debug-btn {
  background: rgba(220, 38, 38, 0.9);
  border: 1px solid white;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  font-weight: bold;
  min-width: 100px;
  text-align: center;
}

.debug-btn:hover {
  background: rgba(220, 38, 38, 1);
}

.debug-toggle-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(220, 38, 38, 0.5);
  color: #dc2626;
  padding: 5px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 10px;
  opacity: 0.7;
  z-index: 1003;
}

.debug-toggle-btn:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.5);
}

/* Manual Sign-in Interface - Wizard Style */
.manual-interface {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.95);
  border: 2px solid #dc2626;
  border-radius: 15px;
  padding: 30px;
  z-index: 2000;
  display: none;
  width: 90vw;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
}

.manual-interface.show {
  display: block;
}

.wizard-header {
  text-align: center;
  margin-bottom: 30px;
}

.wizard-header h2 {
  color: #dc2626;
  margin-bottom: 10px;
}

.wizard-progress {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.progress-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.3);
  transition: all 0.3s ease;
}

.progress-dot.active {
  background: #dc2626;
  transform: scale(1.2);
}

.progress-dot.completed {
  background: #22c55e;
}

.wizard-question {
  text-align: center;
  margin-bottom: 30px;
}

.wizard-question h3 {
  color: white;
  font-size: 24px;
  margin-bottom: 15px;
  line-height: 1.3;
}

.wizard-question p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 16px;
}

.wizard-input {
  width: 100%;
  padding: 20px;
  border: 2px solid rgba(220, 38, 38, 0.3);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 20px;
  text-align: center;
  margin-bottom: 30px;
}

.wizard-input:focus {
  outline: none;
  border-color: #dc2626;
  box-shadow: 0 0 15px rgba(220, 38, 38, 0.4);
}

.wizard-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}

.wizard-select {
  width: 100%;
  padding: 20px;
  border: 2px solid rgba(220, 38, 38, 0.3);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 18px;
  text-align: center;
  margin-bottom: 30px;
}

.wizard-select option {
  background: #1a1a1a;
  color: white;
  padding: 15px;
  font-size: 16px;
}

.wizard-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.wizard-btn {
  padding: 15px 30px;
  border: 2px solid #dc2626;
  border-radius: 10px;
  background: rgba(220, 38, 38, 0.2);
  color: white;
  cursor: pointer;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  min-width: 120px;
}

.wizard-btn:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(220, 38, 38, 0.4);
}

.wizard-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.wizard-btn.secondary {
  background: rgba(100, 100, 100, 0.2);
  border-color: #666;
}

/* Success Interface */
.success-icon {
  font-size: 80px;
  margin-bottom: 20px;
  animation: successPulse 2s ease-in-out infinite;
  text-align: center;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

@keyframes successPulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

.success-message {
  color: rgba(255, 255, 255, 0.8);
  font-size: 18px;
  margin-top: 15px;
  text-align: center;
}

/* Enhanced styling for success interface content */
#successInterface h2 {
  color: #00ff88;
  font-size: 32px;
  margin-bottom: 15px;
  text-align: center;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#successInterface p {
  color: white;
  font-size: 20px;
  text-align: center;
  margin: 10px 0;
  line-height: 1.4;
}

#successInterface .wizard-step {
  text-align: center;
  padding: 20px;
}

#successInterface {
  max-height: 70vh;
  height: auto;
}

.wizard-btn.secondary:hover {
  background: #666;
}

/* Doorbell Button */
.doorbell-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  border: 3px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 24px;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
}

.doorbell-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(220, 38, 38, 0.6);
}

.doorbell-btn:active {
  transform: scale(0.95);
}

/* Manual Sign-in Toggle Button */
.manual-signin-btn {
  position: fixed;
  bottom: 30px;
  left: 30px;
  background: rgba(220, 38, 38, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 15px 20px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  z-index: 1001;
  transition: all 0.3s ease;
}

.manual-signin-btn:hover {
  background: #dc2626;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(220, 38, 38, 0.4);
}

/* On-Screen Keyboard */
.virtual-keyboard {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.95);
  border: 2px solid #dc2626;
  border-radius: 15px;
  padding: 20px;
  z-index: 3000;
  display: none;
  height: 50vh;
  max-height: 400px;
}

.virtual-keyboard.show {
  display: block;
}

.keyboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  color: white;
}

.keyboard-title {
  font-size: 16px;
  font-weight: bold;
}

.keyboard-close {
  background: #dc2626;
  border: none;
  color: white;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
}

.keyboard-input-indicator {
  background: rgba(220, 38, 38, 0.1);
  border: 2px solid #dc2626;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 15px;
  color: white;
  font-family: monospace;
  font-size: 16px;
  min-height: 40px;
  text-align: center;
}

.keyboard-row {
  display: flex;
  justify-content: center;
  margin-bottom: 8px;
  gap: 6px;
}

.key {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid rgba(220, 38, 38, 0.3);
  color: white;
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.2s ease;
  min-width: 45px;
  min-height: 45px;
  text-align: center;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.key:hover {
  background: rgba(220, 38, 38, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(220, 38, 38, 0.3);
}

.key:active {
  background: #dc2626;
  transform: translateY(0);
}

.key.space {
  min-width: 200px;
}

.key.backspace {
  min-width: 80px;
  background: rgba(220, 38, 38, 0.2);
}

.key.enter {
  min-width: 80px;
  background: rgba(34, 197, 94, 0.2);
}

.key.shift {
  min-width: 70px;
  background: rgba(59, 130, 246, 0.2);
}

.key.shift.active {
  background: rgba(59, 130, 246, 0.5);
}

.input-overlay-text {
  color: white;
  font-size: 18px;
  text-align: center;
  margin-bottom: 10px;
}

.input-overlay-value {
  background: rgba(220, 38, 38, 0.1);
  border: 1px solid #dc2626;
  border-radius: 5px;
  padding: 10px;
  color: white;
  font-family: monospace;
  font-size: 16px;
  min-height: 20px;
  text-align: center;
}

.logo-container {
  margin-bottom: 20px;
}

.logo {
  max-height: 100px;
  max-width: 250px;
  height: auto;
  width: auto;
  filter: brightness(1.1);
}

.ai-text-display {
  position: absolute;
  top: 50px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 248, 248, 0.95));
  color: #1a1a1a;
  padding: 20px 30px;
  border-radius: 15px;
  font-size: 1.2rem;
  max-width: 80%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 0.5s ease;
  z-index: 100;
  border: 3px solid #dc2626;
  line-height: 1.4;
  word-wrap: break-word;
  min-height: 60px;
}

.ai-text-display.show {
  opacity: 1;
}

.ai-text-display .ai-label {
  color: #dc2626;
  font-weight: bold;
  font-size: 0.9rem;
  margin-bottom: 10px;
  display: block;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
  .ai-text-display {
    top: 30px;
    max-width: 90%;
    font-size: 1rem;
    padding: 15px 20px;
  }
}

/* High contrast mode for better accessibility */
@media (prefers-contrast: high) {
  .ai-text-display {
    background: rgba(255, 255, 255, 1);
    border: 3px solid #000;
    color: #000;
  }

  .ai-text-display .ai-label {
    color: #000;
  }
}

.log-entry {
  margin-bottom: 5px;
  padding: 2px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Webcam detection styles */
.webcam-container {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 160px;
  height: 120px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 10px;
  padding: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.webcam-container.show {
  opacity: 1;
  pointer-events: all;
}

.webcam-video {
  width: 100%;
  height: 80px;
  border-radius: 5px;
  object-fit: cover;
}

.detection-status {
  color: white;
  font-size: 10px;
  text-align: center;
  margin-top: 5px;
  font-family: monospace;
}

/* Camera Preview Overlay Styles */
.camera-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.camera-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.camera-overlay.show {
  opacity: 1;
  pointer-events: all;
}

.camera-preview-container {
  background: white;
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  text-align: center;
  max-width: 90vw;
  max-height: 90vh;
  animation: slideInFromTop 0.4s ease-out;
}

@keyframes slideInFromTop {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.camera-preview-header h3 {
  margin: 0 0 15px 0;
  color: #333;
  font-size: 24px;
  font-weight: 600;
}

.countdown-display {
  font-size: 18px;
  color: #666;
  margin-bottom: 20px;
  min-height: 25px;
  font-weight: 500;
}

.countdown-display.countdown-number {
  font-size: 72px;
  font-weight: bold;
  color: #ff6b35;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.countdown-display.countdown-number.countdown-animate {
  transform: scale(1.2);
  color: #ff4757;
}

.countdown-display.countdown-smile {
  font-size: 28px;
  color: #2ed573;
  font-weight: bold;
  animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

.camera-preview-video-container {
  position: relative;
  display: inline-block;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.camera-preview-video {
  width: 400px;
  height: 300px;
  object-fit: cover;
  display: block;
}

.camera-frame-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border: 4px solid #fff;
  border-radius: 15px;
  pointer-events: none;
  box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.camera-preview-footer {
  margin-top: 20px;
}

.camera-preview-footer p {
  margin: 0;
  color: #666;
  font-size: 16px;
  font-weight: 500;
}

/* Camera Flash Effect */
.camera-flash {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: white;
  z-index: 15000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s ease;
}

.camera-flash.flash-active {
  opacity: 0.9;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 500px) {
  .camera-preview-container {
    padding: 20px;
    margin: 20px;
  }
  
  .camera-preview-video {
    width: 300px;
    height: 225px;
  }
  
  .camera-preview-header h3 {
    font-size: 20px;
  }
  
  .countdown-display.countdown-number {
    font-size: 60px;
  }
}

.ai-avatar.photo-capture {
  transform: scale(1.05);
  transition: transform 0.3s ease;
  border: 3px solid #00ff00;
  border-radius: 50%;
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

@media (max-width: 768px) {
  .ai-avatar {
    width: 150px;
    height: 150px;
  }

  .ai-face {
    font-size: 60px;
  }

  h1 {
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }
}