/* DBRO Nexia Hybrid v3.0.6 - Compact Floating Widget + Textarea UX + Premium Clean UI */

.dbro-nexia-floating-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
}

/* Pill flotante */
.dbro-nexia-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #eb3636, #b91c1c);
  color: #f9fafb;
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 10px 22px rgba(235, 54, 54, 0.45);
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.dbro-nexia-pill:hover {
  filter: brightness(1.05);
  box-shadow: 0 14px 28px rgba(235, 54, 54, 0.55);
}

.dbro-nexia-pill:active {
  transform: scale(0.97);
}

.dbro-nexia-pill-label {
  white-space: nowrap;
}

/* Panel flotante */
.dbro-nexia-floating-panel {
  position: absolute;
  right: 0;
  bottom: 48px;
  transform-origin: bottom right;
  transform: scale(0.9);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.dbro-nexia-floating-root.dbro-nexia-open .dbro-nexia-floating-panel {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

/* Contenedor principal compacto */
.dbro-nexia-wrapper {
  max-width: 320px;
  width: 320px;
  margin: 0;
  padding: 10px 10px 12px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.16);
  box-sizing: border-box;
}

.dbro-nexia-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.dbro-nexia-logo {
  flex: 1;
  max-width: 180px;
  height: 32px;
  background-image: url("../img/packingstore-logo.png");
  background-repeat: no-repeat;
  background-position: left center;
  background-size: contain;
}

.dbro-nexia-title {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.dbro-nexia-name {
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #111827;
  font-size: 12px;
}

/* Marco glow rojo alrededor del chat */
.dbro-nexia-chat-frame {
  position: relative;
  border-radius: 14px;
  padding: 8px;
  background: #f9fafb;
  box-shadow:
    0 0 4px rgba(235, 54, 54, 0.32),
    0 0 8px rgba(235, 54, 54, 0.4);
  box-sizing: border-box;
}

.dbro-nexia-chat-window {
  background: #f3f4f6;
  border-radius: 10px;
  padding: 8px;
  height: 200px;
  overflow-y: auto;
  box-sizing: border-box;
  margin-bottom: 6px;
}

/* Mensajes */
.dbro-nexia-message {
  display: flex;
  margin-bottom: 6px;
}

.dbro-nexia-message-agent {
  justify-content: flex-start;
}

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

.dbro-nexia-message-bubble {
  max-width: 78%;
  padding: 6px 9px;
  border-radius: 13px;
  font-size: 12px;
  line-height: 1.4;
}

/* Burbujas Nexia (azul oscuro) */
.dbro-nexia-message-agent .dbro-nexia-message-bubble {
  background: #132245;
  color: #f9fafb;
  border-bottom-left-radius: 3px;
}

/* Burbujas Usuario (gris premium) */
.dbro-nexia-message-user .dbro-nexia-message-bubble {
  background: #e5e7eb;
  color: #111827;
  border-bottom-right-radius: 3px;
}

/* Input row compacta con textarea */
.dbro-nexia-input-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dbro-nexia-textarea {
  width: 100%;
  min-height: 72px;
  max-height: 120px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #111827;
  font-size: 12px;
  padding: 8px 10px;
  outline: none;
  box-sizing: border-box;
}

.dbro-nexia-textarea::placeholder {
  color: #9ca3af;
}

.dbro-nexia-textarea:focus {
  border-color: #eb3636;
  box-shadow: 0 0 0 1px rgba(235, 54, 54, 0.65);
}

/* Botón pill premium enviar */
.dbro-nexia-send-btn {
  align-self: flex-end;
  border-radius: 999px;
  border: none;
  padding: 7px 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  background: linear-gradient(135deg, #132245, #060b20);
  color: #f9fafb;
  box-shadow: 0 0 8px rgba(19, 34, 69, 0.5);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.08s ease;
}

.dbro-nexia-send-btn:hover {
  filter: brightness(1.03);
  box-shadow: 0 0 11px rgba(19, 34, 69, 0.65);
}

.dbro-nexia-send-btn:active {
  transform: scale(0.97);
}

/* Scrollbar minimal */
.dbro-nexia-chat-window::-webkit-scrollbar {
  width: 5px;
}
.dbro-nexia-chat-window::-webkit-scrollbar-thumb {
  background: #cbd5f5;
  border-radius: 999px;
}

/* Responsive: en móviles centrar */
@media (max-width: 640px) {
  .dbro-nexia-floating-root {
    right: 10px;
    left: 10px;
    bottom: 14px;
  }
  .dbro-nexia-wrapper {
    max-width: 100%;
    width: 100%;
  }
}
