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

body {
  font-family: 'Inter', sans-serif;
  background: #0e1525;
  color: #e0e0e0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.main-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 900px;
  height: 95vh;
  position: relative;
}

.chat-wrapper {
  flex: 1;
  background-color: #111827;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.avatar {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #00e0ff;
  z-index: 10;
}

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding-top: 80px;
  padding-bottom: 130px;
  overflow: hidden;
  position: relative;
}

.chat-header {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% - 40px);
  justify-content: center;
  text-align: center;
  z-index: 5;
}

.chat-header .logo {
  height: 48px;
}

.chat-header h1 {
  font-size: 1rem;
  color: #ffffff;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  width: 100%;
}

/* Área de mensajes */
.chat-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mensaje {
  max-width: 75%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}

.mensaje.usuario {
  align-self: flex-end;
  background: #2563eb;
  color: white;
}

.mensaje.bot {
  align-self: flex-start;
  background: #374151;
  color: #e5e7eb;
}

.mensaje-contenido {
  display: block;
}

/* LOADING */
.loading-dots {
  display: inline-flex;
  align-items: center;
  height: 20px;
}

.loading-dots span {
  width: 6px;
  height: 6px;
  margin: 0 3px;
  background-color: #aaa;
  border-radius: 50%;
  display: inline-block;
  animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
  animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes bounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

/* Área de entrada */
.chat-input-container {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 12px 20px;
  background-color: #1f2937;
  border-top: 1px solid #374151;
}

.input-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-wrapper input {
  flex: 1;
  padding: 12px 16px;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  background-color: #374151;
  color: #f3f4f6;
  outline: none;
}

.input-wrapper input::placeholder {
  color: #9ca3af;
}

.send-btn {
  background-color: #00e0ff;
  border: none;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-btn svg {
  fill: white;
}

/* Footer con logo KpiChat */
.branding-footer {
  width: 100%;
  text-align: center;
  padding: 5px 0;
  margin-top: 2px;
}

.kpichat-logo {
  height: 100px; 
  width: auto; 
  opacity: 1;
}
