/* ==========================================================================
   Andino AI - Modern Floating Chatbot Widget for SoftAndino
   ========================================================================== */

#andino-chat-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Floating Trigger Button */
.andino-chat-trigger {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0052cc 0%, #00b4d8 100%);
  border: 2px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(0, 114, 239, 0.45);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
}

.andino-chat-trigger:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 15px 35px rgba(0, 114, 239, 0.6);
}

.andino-chat-trigger i {
  font-size: 26px;
  transition: transform 0.3s ease;
}

.andino-chat-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 14px;
  height: 14px;
  background-color: #00e676;
  border: 2px solid #0b0f19;
  border-radius: 50%;
  box-shadow: 0 0 10px #00e676;
  animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.7); }
  70% { transform: scale(1.1); box-shadow: 0 0 0 6px rgba(0, 230, 118, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 230, 118, 0); }
}

/* Chat Window Box */
.andino-chat-window {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 110px);
  background: #0d121f;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 114, 239, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(16px);
}

.andino-chat-window.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.andino-chat-header {
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(14, 22, 40, 0.95) 0%, rgba(8, 12, 22, 0.98) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.andino-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.andino-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0052cc, #00b4d8);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  box-shadow: 0 0 12px rgba(0, 180, 216, 0.4);
}

.andino-title-wrap h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
}

.andino-title-wrap p {
  margin: 0;
  font-size: 11px;
  color: #00e676;
  display: flex;
  align-items: center;
  gap: 5px;
}

.andino-title-wrap p::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #00e676;
}

.andino-close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.andino-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

/* Chat Messages Area */
.andino-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.andino-chat-messages::-webkit-scrollbar {
  width: 5px;
}
.andino-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.andino-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
}

.andino-msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border-bottom-left-radius: 4px;
}

.andino-msg.bot a {
  color: #38bdf8;
  text-decoration: underline;
}

.andino-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #0052cc 0%, #0077b6 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 82, 204, 0.3);
}

/* Quick Chips / Suggestions */
.andino-quick-chips {
  padding: 8px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(11, 15, 25, 0.5);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.andino-quick-chips::-webkit-scrollbar {
  display: none;
}

.andino-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
}

.andino-chip:hover {
  background: rgba(0, 180, 216, 0.15);
  border-color: #00b4d8;
  color: #38bdf8;
  transform: translateY(-1px);
}

/* Typing Indicator */
.andino-typing {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  padding: 10px 16px;
  border-radius: 16px;
  display: none;
  align-items: center;
  gap: 5px;
}

.andino-typing.active {
  display: flex;
}

.andino-dot {
  width: 6px;
  height: 6px;
  background: #38bdf8;
  border-radius: 50%;
  animation: andino-bounce 1.4s infinite ease-in-out both;
}

.andino-dot:nth-child(1) { animation-delay: -0.32s; }
.andino-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes andino-bounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

/* Chat Input Bar */
.andino-chat-input-wrap {
  padding: 12px 16px;
  background: #090d16;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.andino-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 10px 16px;
  font-size: 13.5px;
  color: #ffffff;
  outline: none;
  transition: all 0.2s ease;
}

.andino-chat-input:focus {
  border-color: #00b4d8;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(0, 180, 216, 0.25);
}

.andino-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0052cc 0%, #00b4d8 100%);
  border: none;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.andino-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 180, 216, 0.4);
}

.andino-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  #andino-chat-widget {
    bottom: 16px;
    right: 16px;
  }
  .andino-chat-window {
    width: calc(100vw - 32px);
    height: calc(100vh - 90px);
    bottom: 70px;
  }
}
