* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --c: #00d4f0;
  --c-dim: rgba(0, 212, 240, 0.12);
  --c-border: rgba(0, 212, 240, 0.35);
  --c-glow: 0 0 12px rgba(0, 212, 240, 0.6);
}

body {
  background: #000;
  color: var(--c);
  font-family: 'Courier New', monospace;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* Canvas ocupa toda la ventana */
#canvas-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

#face-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* Badges en esquinas del canvas */
#doc-badge {
  position: absolute;
  top: 14px;
  left: 18px;
  font-size: 12px;
  opacity: .5;
  letter-spacing: 1px;
  text-transform: uppercase;
}

#upload-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c);
  padding: 6px 14px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 3px;
  transition: all .2s;
}

#upload-btn:hover {
  background: var(--c-dim);
  box-shadow: var(--c-glow);
}

#file-input {
  display: none;
}

/* Panel flotante sobre el canvas, parte inferior */
#ui-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 48px 22px 20px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.92) 35%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#status-bar {
  text-align: center;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: .6;
}

#status-bar.pulse {
  animation: pulse .9s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: .6
  }

  50% {
    opacity: .15
  }
}

#transcript {
  text-align: center;
  font-size: 13px;
  min-height: 18px;
  opacity: .85;
}

#response-box {
  background: var(--c-dim);
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.55;
  max-height: 90px;
  overflow-y: auto;
}

#response-box::-webkit-scrollbar {
  width: 3px;
}

#response-box::-webkit-scrollbar-thumb {
  background: var(--c-border);
}

#source-tag {
  font-size: 11px;
  opacity: .45;
  letter-spacing: 1px;
  text-align: right;
}

/* Fila de controles */
#controls {
  display: flex;
  gap: 8px;
  align-items: center;
}

#text-input {
  flex: 1;
  background: var(--c-dim);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  color: var(--c);
  font-family: inherit;
  font-size: 13px;
  padding: 9px 12px;
  outline: none;
  transition: border-color .2s;
}

#text-input::placeholder {
  color: rgba(0, 212, 240, 0.30);
}

#text-input:focus {
  border-color: var(--c);
}

.btn {
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c);
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 9px 16px;
  cursor: pointer;
  border-radius: 4px;
  transition: all .2s;
  white-space: nowrap;
}

.btn:hover {
  background: var(--c-dim);
  box-shadow: var(--c-glow);
}

#mic-btn {
  background: transparent;
  border: 1px solid var(--c-border);
  color: var(--c);
  font-family: inherit;
  border-radius: 4px;
  padding: 9px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: all .2s;
  white-space: nowrap;
}

#mic-btn:hover {
  background: var(--c-dim);
  box-shadow: var(--c-glow);
}

#mic-icon {
  font-size: 16px;
}

#mic-btn.active {
  border-color: var(--c);
  background: var(--c-dim);
  animation: mic-pulse .9s ease-in-out infinite;
}

@keyframes mic-pulse {

  0%,
  100% {
    box-shadow: 0 0 8px rgba(0, 212, 240, .4);
  }

  50% {
    box-shadow: 0 0 24px rgba(0, 212, 240, .9);
  }
}

/* ============================================ */
/* HOLOGRAMA FUTURISTA                          */
/* ============================================ */

.hologram-container {
  position: absolute;
  top: 35%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 350px;
  height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;
}

/* Círculo central */
.hologram-core {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 240, 0.95), rgba(0, 212, 240, 0.2));
  box-shadow: 0 0 30px rgba(0, 212, 240, 0.8), inset 0 0 20px rgba(0, 212, 240, 0.5);
  transition: all 0.3s ease;
  animation: breathe 4s ease-in-out infinite;
}

/* Anillos concéntricos */
.hologram-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--c);
  opacity: 0.6;
}

.ring-1 {
  width: 200px;
  height: 200px;
  border-width: 2px;
  box-shadow: 0 0 15px rgba(0, 212, 240, 0.4);
  animation: rotate 14s linear infinite;
}

.ring-2 {
  width: 280px;
  height: 280px;
  border-width: 1px;
  border-style: dashed;
  animation: rotateReverse 20s linear infinite;
}

/* Partículas flotantes */
.particles {
  position: absolute;
  width: 100%;
  height: 100%;
}

.particles::before,
.particles::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--c);
  border-radius: 50%;
  opacity: 0.8;
  box-shadow: 0 0 5px var(--c);
}

.particles::before {
  top: 20%;
  left: 10%;
  animation: float-particle 4s ease-in-out infinite;
}

.particles::after {
  bottom: 15%;
  right: 8%;
  animation: float-particle 5s ease-in-out infinite reverse;
}

/* Ondas de sonido (barras) */
.sound-waves {
  position: absolute;
  display: flex;
  gap: 6px;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.wave-bar {
  width: 4px;
  height: 20px;
  background: var(--c);
  border-radius: 10px;
  animation: wave 1s ease-in-out infinite;
}

/* ========== ANIMACIONES ========== */
@keyframes breathe {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.08);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@keyframes rotateReverse {
  from {
    transform: rotate(360deg);
  }

  to {
    transform: rotate(0deg);
  }
}

@keyframes float-particle {

  0%,
  100% {
    transform: translate(0, 0);
    opacity: 0.3;
  }

  50% {
    transform: translate(15px, -15px);
    opacity: 1;
  }
}

@keyframes wave {

  0%,
  100% {
    height: 14px;
    opacity: 0.5;
  }

  50% {
    height: 35px;
    opacity: 1;
  }
}

/* ========== ESTADOS ========== */

/* Estado: Escuchando */
.hologram-container.listening .hologram-core {
  box-shadow: 0 0 35px rgba(0, 212, 240, 1), 0 0 80px rgba(0, 212, 240, 0.6);
  transform: scale(1.08);
}

.hologram-container.listening .ring-1 {
  animation-duration: 8s;
}

/* Estado: Pensando / Procesando */
.hologram-container.thinking .ring-1 {
  animation-duration: 4s;
}

.hologram-container.thinking .ring-2 {
  animation-duration: 6s;
}

/* Estado: Hablando */
.hologram-container.speaking .sound-waves {
  opacity: 1;
}

/* Estado: Inactivo */
.hologram-container.inactive .hologram-core {
  opacity: 0.4;
  box-shadow: none;
  animation: none;
}

.hologram-container.inactive .ring-1,
.hologram-container.inactive .ring-2 {
  opacity: 0.2;
  animation: none;
}

.hologram-container.inactive .particles::before,
.hologram-container.inactive .particles::after {
  opacity: 0;
}

.hologram-container.inactive .sound-waves {
  opacity: 0;
}

/* Logo UTEC */

.logo-container {
  position: fixed;
  top: 5px;
  left: 20px;
  z-index: 1000;
  /* para que quede por encima del resto */

}

.logo-utec {
  height: 140px;
  width: auto;
  display: block;
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  max-height: 200px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  margin-bottom: 10px;
}

.message {
  margin-bottom: 10px;
  display: flex;
}

.message.user {
  justify-content: flex-end;
}

.message.assistant {
  justify-content: flex-start;
}

.bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 18px;
  background: #f0f0f0;
  color: #000;
}

.message.user .bubble {
  background: #007aff;
  color: #fff;
}

.message.assistant .bubble {
  background: #e5e5ea;
  color: #000;
}