/**
 * Estilos del chat flotante ImBlasco (embed).
 * Solo afectan a elementos .floating-chat-* para no interferir con la página.
 */
.floating-chat-root {
  --indigo-600: #4f46e5;
  --indigo-700: #4338ca;
  --indigo-100: #e0e7ff;
  --indigo-200: #c7d2fe;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-800: #1f2937;
}

.floating-chat-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999998;
  width: 3.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 9999px;
  background: var(--indigo-600);
  color: white;
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.floating-chat-btn:hover {
  background: var(--indigo-700);
  transform: scale(1.05);
}

.floating-chat-btn:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.3);
}

.floating-chat-btn-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.floating-chat-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  z-index: 999997;
  width: 380px;
  height: 480px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid var(--gray-200);
  background: white;
  box-shadow: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

.floating-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: 0.75rem 1rem;
  background: var(--indigo-600);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.floating-chat-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: white;
}

.floating-chat-subtitle {
  font-size: 0.875rem;
  color: var(--indigo-100);
}

.floating-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.floating-chat-empty {
  margin: 0;
  text-align: center;
  color: var(--gray-400);
  font-size: 1.125rem;
  padding: 2rem 0;
}

.floating-chat-messages-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.floating-chat-scroll-anchor {
  height: 0;
  overflow: hidden;
}

.floating-chat-msg-wrap {
  display: flex;
  max-width: 85%;
}

.floating-chat-msg-user {
  align-self: flex-end;
  margin-left: auto;
}

.floating-chat-msg-assistant {
  align-self: flex-start;
}

.floating-chat-bubble {
  border-radius: 1rem;
  padding: 0.625rem 1rem;
  font-size: 1.125rem;
}

.floating-chat-msg-user .floating-chat-bubble {
  border-bottom-right-radius: 0.25rem;
  background: var(--indigo-600);
  color: white;
}

.floating-chat-msg-assistant .floating-chat-bubble {
  border-bottom-left-radius: 0.25rem;
  background: var(--gray-100);
  color: var(--gray-800);
}

.floating-chat-bubble-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.floating-chat-bubble-time {
  margin: 0.25rem 0 0;
  font-size: 0.75rem;
  line-height: 1.2;
}

.floating-chat-msg-user .floating-chat-bubble-time {
  color: var(--indigo-200);
}

.floating-chat-msg-assistant .floating-chat-bubble-time {
  color: var(--gray-500);
}

.floating-chat-loading {
  display: flex;
  justify-content: flex-start;
}

.floating-chat-loading[hidden] {
  display: none !important;
}

.floating-chat-spinner {
  display: inline-block;
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid var(--gray-200);
  border-top-color: var(--indigo-600);
  border-radius: 50%;
  animation: floating-chat-spin 0.7s linear infinite;
}

.floating-chat-loading .floating-chat-spinner {
  margin: 0.625rem 1rem;
}

@keyframes floating-chat-spin {
  to {
    transform: rotate(360deg);
  }
}

.floating-chat-footer {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.75rem;
  border-top: 1px solid var(--gray-100);
}

.floating-chat-input {
  flex: 1;
  min-height: 2.75rem;
  max-height: 120px;
  padding: 0.5rem 1rem;
  font-size: 1rem;
  line-height: 1.5;
  border: 1px solid var(--gray-200);
  border-radius: 0.75rem;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
  overflow-y: auto;
  font-family: inherit;
  box-sizing: border-box;
}

.floating-chat-input:focus {
  border-color: var(--indigo-600);
}

.floating-chat-input:disabled {
  background: var(--gray-100);
  cursor: not-allowed;
}

.floating-chat-send {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: none;
  border-radius: 0.75rem;
  background: var(--indigo-600);
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.floating-chat-send:hover:not(:disabled) {
  background: var(--indigo-700);
}

.floating-chat-send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.floating-chat-send span {
  line-height: 1;
}
