/* 
 * client-chatbot.css
 * Diseño Premium Glassmorphism para Asistente Virtual Hornet
 */

:root {
  --chatbot-gold: #FFD700;
  --chatbot-gold-dark: #B8960F;
  --chatbot-bg: rgba(15, 15, 15, 0.85);
  --chatbot-bubble-user: rgba(255, 215, 0, 0.15);
  --chatbot-bubble-bot: rgba(30, 30, 30, 0.8);
  --chatbot-text: #fff;
  --chatbot-text-muted: #aaa;
  --chatbot-border: rgba(255, 215, 0, 0.3);
}

/* --- BOTÓN FLOTANTE --- */
.hbot-trigger {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--chatbot-gold), var(--chatbot-gold-dark));
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.hbot-trigger:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 25px rgba(255, 215, 0, 0.6);
}
.hbot-trigger-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  padding: 2px; /* Slight padding to show the gold border */
}
.hbot-trigger.hidden {
  display: none;
}

/* --- PANEL PRINCIPAL --- */
.hbot-panel {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 380px;
  height: 600px;
  max-height: 85vh;
  background: var(--chatbot-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--chatbot-border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
  z-index: 10000;
  overflow: hidden;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.hbot-panel.hidden {
  opacity: 0;
  transform: translateY(20px) scale(0.9);
  pointer-events: none;
}

/* Mobile responsive */
@media (max-width: 480px) {
  .hbot-panel {
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  .hbot-trigger {
    bottom: 1.5rem;
    right: 1.5rem;
  }
}

/* --- CABECERA --- */
.hbot-header {
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.4);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.hbot-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.hbot-header-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--chatbot-gold), var(--chatbot-gold-dark));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
  object-fit: cover;
  padding: 2px;
}
.hbot-header-info h3 {
  margin: 0;
  color: var(--chatbot-gold);
  font-size: 1.1rem;
  font-family: inherit;
}
.hbot-header-info p {
  margin: 2px 0 0;
  color: var(--chatbot-text-muted);
  font-size: 0.8rem;
}
.hbot-close {
  background: none;
  border: none;
  color: var(--chatbot-text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
}
.hbot-close:hover {
  color: var(--chatbot-gold);
}

/* --- MENSAJES --- */
.hbot-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.hbot-messages::-webkit-scrollbar {
  width: 6px;
}
.hbot-messages::-webkit-scrollbar-track {
  background: transparent;
}
.hbot-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.2);
  border-radius: 3px;
}

.hbot-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: fadeIn 0.3s ease-out forwards;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.hbot-msg-bot {
  align-self: flex-start;
}
.hbot-msg-user {
  align-self: flex-end;
}
.hbot-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--chatbot-text);
  word-wrap: break-word;
}
.hbot-msg-bot .hbot-bubble {
  background: var(--chatbot-bubble-bot);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-bottom-left-radius: 4px;
}
.hbot-msg-user .hbot-bubble {
  background: var(--chatbot-bubble-user);
  border: 1px solid var(--chatbot-border);
  border-bottom-right-radius: 4px;
  color: var(--chatbot-gold);
}

/* --- TYPING INDICATOR --- */
.hbot-typing {
  padding: 0 1.5rem 1rem;
  display: flex;
  gap: 4px;
}
.hbot-typing.hidden {
  display: none;
}
.hbot-typing span {
  width: 6px;
  height: 6px;
  background: var(--chatbot-gold);
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}
.hbot-typing span:nth-child(1) { animation-delay: -0.32s; }
.hbot-typing span:nth-child(2) { animation-delay: -0.16s; }
@keyframes typing {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* --- INPUT AREA --- */
.hbot-input-area {
  padding: 1rem;
  background: rgba(0, 0, 0, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  gap: 10px;
}
.hbot-input-area input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 10px 15px;
  color: var(--chatbot-text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}
.hbot-input-area input:focus {
  border-color: var(--chatbot-gold);
}
.hbot-input-area input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}
.hbot-input-area button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--chatbot-gold);
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}
.hbot-input-area button:hover {
  transform: scale(1.05);
  background: var(--chatbot-gold-dark);
}

/* --- TARJETA DE ESTADO (CARD) --- */
.hbot-card {
  width: 100%;
  background: rgba(20, 20, 20, 0.6);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 5px;
}
.hbot-card-header {
  background: rgba(255, 215, 0, 0.1);
  padding: 10px 15px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.2);
  color: var(--chatbot-gold);
  font-size: 0.9rem;
}
.hbot-card-body {
  padding: 15px;
  font-size: 0.85rem;
  color: #ddd;
}
.hbot-card-body p {
  margin: 5px 0;
}
.hbot-card-body hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin: 12px 0;
}
.hbot-card-status {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.3);
  padding: 10px;
  border-radius: 8px;
  border-left: 3px solid var(--chatbot-gold);
}
.hbot-card-status .status-icon {
  font-size: 1.5rem;
}
.hbot-card-status .status-text small {
  display: block;
  color: var(--chatbot-text-muted);
  font-size: 0.75rem;
}
.hbot-card-status .status-text strong {
  color: var(--chatbot-gold);
  font-size: 1rem;
}
.hbot-obs {
  background: rgba(255, 255, 255, 0.03);
  padding: 10px;
  border-radius: 6px;
  margin-top: 10px;
  font-style: italic;
}

/* --- BOTÓN WHATSAPP --- */
.hbot-btn-wa {
  display: block;
  width: 100%;
  padding: 12px;
  background: #25D366;
  color: #fff;
  text-align: center;
  text-decoration: none;
  font-weight: bold;
  font-size: 0.9rem;
  transition: background 0.2s;
}
.hbot-btn-wa:hover {
  background: #1ebc5a;
}

/* --- TIMELINE --- */
.hbot-timeline {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}
.hbot-tl-item {
  display: flex;
  gap: 12px;
  opacity: 0.5;
}
.hbot-tl-item.current {
  opacity: 1;
}
.hbot-tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  margin-top: 4px;
  position: relative;
}
.hbot-tl-item:not(:last-child) .hbot-tl-dot::after {
  content: '';
  position: absolute;
  top: 12px;
  left: 4px;
  width: 2px;
  height: calc(100% + 12px);
  background: rgba(255, 255, 255, 0.1);
}
.hbot-tl-dot.active {
  background: var(--chatbot-gold);
  box-shadow: 0 0 8px var(--chatbot-gold);
}
.hbot-tl-content small {
  display: block;
  font-size: 0.65rem;
  color: var(--chatbot-text-muted);
}
.hbot-tl-content span {
  font-size: 0.85rem;
  color: #fff;
}
.hbot-tl-item.current .hbot-tl-content span {
  color: var(--chatbot-gold);
  font-weight: bold;
}
