
/**
 * BLPbot Widget Styles - Professional Re-Design
 */

/* Botón flotante */
.blpbot-button {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background: #002d92;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 9998;
  color: white;
  border: none;
}

.blpbot-button svg {
  width: 28px;
  height: 28px;
  color: white;
}

.blpbot-button:hover {
  transform: scale(1.05);
  background: #001f66;
  box-shadow: 0 6px 16px rgba(0, 45, 146, 0.5);
}

.blpbot-button.active {
  transform: scale(0.95);
}

.blpbot-notification-badge {
  position: absolute;
  top: 0;
  right: 0;
  background: #ef4444;
  color: white;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  border: 2px solid white;
}

/* Mensaje de ayuda flotante */
.blpbot-help-message {
  position: fixed;
  bottom: 34px;
  right: 100px;
  background: #ffffff;
  color: #1f2937;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  z-index: 9997;
  white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  animation: slideInRight 0.5s ease-out;
  border: 1px solid #e5e7eb;
}

.blpbot-help-message::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 6px solid #ffffff;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.blpbot-help-message::before {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 7px solid #e5e7eb;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  z-index: -1;
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Contenedor del chat */
.blpbot-container {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  height: 600px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  border: 1px solid #e5e7eb;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Header */
.blpbot-header {
  background: #002d92;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
}

.blpbot-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.blpbot-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.blpbot-avatar {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  flex-shrink: 0;
}

.blpbot-avatar svg {
  width: 20px;
  height: 20px;
}

.blpbot-header-text {
  display: flex;
  flex-direction: column;
}

.blpbot-title {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
}

.blpbot-status {
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  opacity: 0.9;
}

.blpbot-status-dot {
  width: 8px;
  height: 8px;
  background: #00c2e0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.blpbot-close-btn, .blpbot-new-chat-btn {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.8;
  transition: all 0.2s;
}

.blpbot-close-btn:hover, .blpbot-new-chat-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

/* User Form */
.blpbot-user-form {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 24px;
  background: #f9fafb;
}

.blpbot-form-header {
  margin-bottom: 24px;
  text-align: center;
}

.blpbot-form-header h3 {
  margin: 0 0 8px 0;
  color: #111827;
  font-size: 20px;
}

.blpbot-form-header p {
  margin: 0;
  color: #4b5563;
  font-size: 14px;
}

.blpbot-form-group {
  margin-bottom: 16px;
}

.blpbot-form-group label {
  display: block;
  margin-bottom: 6px;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
}

.blpbot-form-group input {
  width: 100%;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  color: #111827;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color 0.2s;
}

.blpbot-form-group input:focus {
  outline: none;
  border-color: #002d92;
  box-shadow: 0 0 0 3px rgba(0, 45, 146, 0.1);
}

.blpbot-form-submit {
  width: 100%;
  padding: 12px;
  background: #002d92;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  margin-top: 8px;
}

.blpbot-form-submit:hover {
  background: #001f66;
}

/* Messages */
.blpbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f9fafb;
}

.blpbot-messages::-webkit-scrollbar {
  width: 6px;
}

.blpbot-messages::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 3px;
}

.blpbot-message {
  display: flex;
  gap: 12px;
  max-width: 85%;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.blpbot-message-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.blpbot-message-assistant {
  align-self: flex-start;
}

.blpbot-message-avatar {
  width: 28px;
  height: 28px;
  background: #002d92;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: white;
}

.blpbot-message-avatar svg {
  width: 16px;
  height: 16px;
}

.blpbot-message-content {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}

.blpbot-message-assistant .blpbot-message-content {
  background: #ffffff;
  color: #1f2937;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.blpbot-message-user .blpbot-message-content {
  background: #002d92;
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.2);
}

/* Typing Indicator */
.blpbot-typing-indicator {
  display: flex;
  gap: 4px;
  padding: 8px 4px;
}

.blpbot-typing-indicator span {
  width: 6px;
  height: 6px;
  background: #9ca3af;
  border-radius: 50%;
  animation: typing 1.4s infinite ease-in-out both;
}

.blpbot-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.blpbot-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing {
  0%, 80%, 100% { transform: scale(0); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* Input Area */
.blpbot-input-container {
  padding: 16px;
  background: #ffffff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.blpbot-input {
  flex: 1;
  max-height: 120px;
  min-height: 44px;
  padding: 12px 16px;
  background: #f3f4f6;
  border: 1px solid transparent;
  border-radius: 24px;
  color: #111827;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  box-sizing: border-box;
  outline: none;
  transition: all 0.2s;
  line-height: 1.4;
}

.blpbot-input:focus {
  background: #ffffff;
  border-color: #002d92;
  box-shadow: 0 0 0 3px rgba(0, 45, 146, 0.1);
}

.blpbot-input::placeholder {
  color: #9ca3af;
}

.blpbot-voice-btn, .blpbot-send-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.2s;
}

.blpbot-voice-btn {
  background: transparent;
  color: #6b7280;
}

.blpbot-voice-btn:hover {
  background: #f3f4f6;
  color: #1f2937;
}

.blpbot-voice-btn.recording {
  color: #ef4444;
  animation: pulse-recording 1.5s infinite;
}

.blpbot-send-btn {
  background: #002d92;
  color: white;
}

.blpbot-send-btn:hover {
  background: #001f66;
}

/* Footer */
.blpbot-footer {
  padding: 8px;
  text-align: center;
  background: #ffffff;
  border-top: 1px solid #f3f4f6;
  font-size: 11px;
  color: #9ca3af;
}

.blpbot-footer strong {
  color: #002d92;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .blpbot-container {
    width: 100%;
    height: 100% !important;
    max-height: 100% !important;
    bottom: 0;
    right: 0;
    border-radius: 0;
    border: none;
  }
  
  .blpbot-button {
    bottom: 16px;
    right: 16px;
  }
}
