/* ================================
   CONTENEDOR PRINCIPAL
================================ */
.chat-page {
  height: 100vh;
  width: 100%;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

/* ================================
   HEADER
================================ */
.chat-header {
  background: #5a3df0;
  color: #ffffff;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-header{
  position: relative; /* necesario para centrar el título */
}

.header-title{
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #ffffff;
  pointer-events: none; /* para que no estorbe el click de la X */
}


.advisor-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.advisor-info img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.advisor-name {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.1;
}

.advisor-role {
  font-size: 16px;
  opacity: 0.9;
}

.close-btn {
  font-size: 28px;
  font-weight: 300;
  cursor: pointer;
}

/* ================================
   CUERPO DEL CHAT
================================ */
.chat-body {
  flex: 1;
  padding: 24px 20px;
  background: #f7f7f7;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
}

/* ================================
   BURBUJAS
================================ */
.bubble {
  border-radius: 16px;
  padding: 16px 18px;
  max-width: 85%;
  font-size: 18px;
  line-height: 1.4;
  word-wrap: break-word;
}

/* Bot / Sistema */
.bubble-system {
  align-self: flex-start;
  background: #eeeeee;
  color: #444;
}

/* Usuario */
.bubble-user {
  align-self: flex-end;
  background: #5a3df0;
  color: #ffffff;
}

/* Opciones rápidas */
.bubble-option {
  align-self: flex-start;
  background: #ffffff;
  color: #3b6eea;
  font-weight: 500;
  border: 1px solid #dce3ff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.bubble-option:hover {
  background: #f1f4ff;
  transform: translateY(-1px);
}

/* Contenedor del mensaje (fila) */
.msg-row{
  display: flex;
  gap: 10px;
  margin: 10px 0;
  align-items: flex-end;
}

/* Assistant izquierda */
.msg-assistant{
  justify-content: flex-start;
}

/* User derecha */
.msg-user{
  justify-content: flex-end;
}

/* Avatar redondo */
.msg-avatar{
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #DDDEDE;
  flex: 0 0 auto;
}

/* Tus burbujas */
.bubble{
  max-width: 75%;
  padding: 10px 12px;
  border-radius: 16px;
  line-height: 1.35;
  word-break: break-word;
  white-space: pre-wrap;
}

.bubble-system{
  background: #fff;
  border: 1px solid #DDDEDE;
  color: #111;
  border-top-left-radius: 8px;
}

.bubble-user{
  background: #3378D6;
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  border-top-right-radius: 8px;
}


.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #999;
  border-radius: 50%;
  margin: 0 2px;
  animation: bounce 1.2s infinite;
}
.dot:nth-child(2) { animation-delay: 0.2s; }
.dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40%           { transform: translateY(-8px); }
}



/* ================================
   INPUT
================================ */
.chat-input {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 1px solid #e0e0e0;
  background: #ffffff;
}

.chat-input input {
  flex: 1;
  padding: 16px 18px;
  font-size: 16px;
  border-radius: 16px;
  border: 1.5px solid #ddd;
  outline: none;
}

.chat-input input:focus {
  border-color: #5a3df0;
}

/* Botón enviar */
.send-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #5a3df0;
  color: #ffffff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.send-btn:hover {
  background: #4a2fe0;
  transform: scale(1.05);
}
.send-btn:disabled {
  background: #b0a0f8;
  cursor: not-allowed;
  transform: none;
}

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 768px) {
  .header-title {
    font-size: 18px;
    letter-spacing: 0.5px;
  }
}
