/* ==========================================================================
   RGB LOGIX - Ray AI Advisor Styles
   Theme: Luxury Amber/Gold Header (#FAB733), Clean Slate & Front Pill Buttons
   ========================================================================== */

/* 1. Floating Launcher Button (Larger & More Prominent) */
.logix-ai-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px 12px 14px;
  background: linear-gradient(135deg, #131921 0%, #1e293b 100%);
  border: 2px solid #FF9900;
  border-radius: 50px;
  color: #FFFFFF;
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  cursor: pointer;
  box-shadow: 0 12px 28px -5px rgba(0, 0, 0, 0.4), 0 0 18px rgba(255, 153, 0, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logix-ai-launcher:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 16px 32px -5px rgba(0, 0, 0, 0.5), 0 0 25px rgba(255, 153, 0, 0.6);
  border-color: #FFA41C;
}

.logix-ai-launcher-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FF9900;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 19px;
  color: #131921;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.logix-ai-status-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #10B981;
  border: 2.5px solid #131921;
}

.logix-ai-launcher-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.logix-ai-launcher-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #FFFFFF;
  line-height: 1.2;
}

.logix-ai-launcher-sub {
  font-size: 12px;
  font-weight: 600;
  color: #FF9900;
  line-height: 1.2;
  letter-spacing: 0.3px;
}

/* Pulse Beacon */
.logix-ai-pulse-ring {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50px;
  border: 2px solid #FF9900;
  animation: logixAiPulse 2.2s cubic-bezier(0.24, 0, 0.38, 1) infinite;
  pointer-events: none;
}

@keyframes logixAiPulse {
  0% { transform: scale(1); opacity: 0.8; }
  70% { transform: scale(1.12, 1.25); opacity: 0; }
  100% { transform: scale(1.15, 1.3); opacity: 0; }
}

/* 2. Chat Modal Window */
.logix-ai-widget {
  position: fixed;
  bottom: 85px;
  right: 24px;
  width: 390px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 105px);
  background: #FFFFFF;
  border-radius: 20px;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25), 0 0 25px rgba(250, 183, 51, 0.2);
  border: 1px solid #E2E8F0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.logix-ai-widget.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.logix-ai-widget.expanded {
  width: 580px;
  height: 750px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
}

/* Header - Golden Amber Theme */
.logix-ai-header {
  background: #FAB733;
  color: #0F172A;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.logix-ai-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logix-ai-header-back-btn {
  background: none;
  border: none;
  color: #0F172A;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.2s;
}

.logix-ai-header-back-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

.logix-ai-header-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 2px solid #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.logix-ai-avatar-inner {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #FAB733;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 13px;
  color: #0F172A;
}

.logix-ai-header-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10B981;
  border: 2px solid #FFFFFF;
}

.logix-ai-header-title {
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 17px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -0.2px;
}

.logix-ai-header-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.logix-ai-btn-icon {
  background: transparent;
  border: none;
  color: #0F172A;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.logix-ai-btn-icon:hover {
  background: rgba(0, 0, 0, 0.08);
}

#logix-ai-reset-btn svg {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#logix-ai-reset-btn:hover svg {
  transform: rotate(-180deg);
}

/* Messages Body */
.logix-ai-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.logix-ai-messages::-webkit-scrollbar {
  width: 5px;
}

.logix-ai-messages::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 10px;
}

/* Message Rows */
.logix-ai-msg-row {
  display: flex;
  gap: 8px;
  max-width: 95%;
  animation: logixAiFadeIn 0.25s ease-out;
}

@keyframes logixAiFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.logix-ai-msg-row.ai {
  align-self: flex-start;
}

.logix-ai-msg-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.logix-ai-msg-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #FAB733;
  color: #0F172A;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 4px;
}

.logix-ai-bubble-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.logix-ai-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.5;
  word-break: break-word;
}

.logix-ai-msg-row.ai .logix-ai-bubble {
  background: #F3F4F6;
  color: #1F2937;
  border-top-left-radius: 4px;
}

.logix-ai-msg-row.user .logix-ai-bubble {
  background: #0F172A;
  color: #FFFFFF;
  border-top-right-radius: 4px;
}

.logix-ai-bubble p {
  margin: 0 0 8px 0;
}

.logix-ai-bubble p:last-child {
  margin-bottom: 0;
}

.logix-ai-bubble ul {
  margin: 6px 0;
  padding-left: 18px;
}

.logix-ai-bubble li {
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.45;
}

/* Interactive Choice Buttons (Pill Format in Front - Matches Image 2) */
.logix-ai-choice-container {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.logix-ai-choice-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  background: #FFFFFF;
  color: #1E293B;
  border: 1.5px solid #475569;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease-in-out;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.logix-ai-choice-btn:hover {
  background: #F8FAFC;
  border-color: #0F172A;
  color: #0F172A;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Nav Row: Back & Start Over */
.logix-ai-nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #E2E8F0;
  width: 100%;
}

.logix-ai-nav-link {
  font-size: 11.5px;
  font-weight: 600;
  color: #64748B;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.logix-ai-nav-link:hover {
  color: #D97706;
}

/* Action Group */
.logix-ai-action-group {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.logix-ai-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.logix-ai-action-btn.whatsapp {
  background: #25D366;
  color: #FFFFFF;
}

.logix-ai-action-btn.whatsapp:hover {
  background: #22BF5B;
  transform: translateY(-1px);
}

/* In-Chat Lead Form */
.logix-ai-inchat-form {
  margin-top: 10px;
  padding: 12px;
  background: #FFFDF9;
  border: 1.5px solid #FED7AA;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.logix-ai-form-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #9A3412;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.logix-ai-form-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #CBD5E1;
  border-radius: 6px;
  font-size: 12.5px;
  color: #1E293B;
  background: #FFFFFF;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

.logix-ai-form-input:focus {
  border-color: #FAB733;
  box-shadow: 0 0 0 2px rgba(250, 183, 51, 0.25);
}

.logix-ai-form-submit {
  width: 100%;
  padding: 8px 12px;
  background: #FAB733;
  color: #0F172A;
  border: none;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.logix-ai-form-submit:hover {
  background: #FFAE19;
}

.logix-ai-form-success {
  padding: 9px 12px;
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  border-radius: 8px;
  color: #065F46;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}

/* State Fee Card */
.logix-ai-fee-card {
  margin-top: 8px;
  padding: 10px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  font-size: 12px;
}

.logix-ai-fee-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
  color: #475569;
}

.logix-ai-fee-row:last-child {
  margin-bottom: 0;
  padding-top: 4px;
  border-top: 1px solid #E2E8F0;
  font-weight: 700;
  color: #0F172A;
}

/* Typing Indicator */
.logix-ai-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #F3F4F6;
  border-radius: 14px;
  border-top-left-radius: 4px;
  width: fit-content;
}

.logix-ai-typing-dot {
  width: 6px;
  height: 6px;
  background: #94A3B8;
  border-radius: 50%;
  animation: logixAiBounce 1.2s infinite ease-in-out;
}

.logix-ai-typing-dot:nth-child(1) { animation-delay: 0s; }
.logix-ai-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.logix-ai-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes logixAiBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-5px); background: #FAB733; }
}

/* Footer Input Area */
.logix-ai-footer {
  padding: 10px 12px;
  background: #FFFFFF;
  border-top: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logix-ai-input {
  flex: 1;
  background: #F8FAFC;
  border: 1px solid #CBD5E1;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  color: #1E293B;
  outline: none;
  font-family: inherit;
  transition: border-color 0.2s;
}

.logix-ai-input:focus {
  border-color: #FAB733;
  background: #FFFFFF;
  box-shadow: 0 0 0 2px rgba(250, 183, 51, 0.2);
}

.logix-ai-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FAB733;
  color: #0F172A;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.logix-ai-send-btn:hover {
  background: #FFAE19;
  transform: scale(1.05);
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .logix-ai-widget {
    bottom: 0;
    right: 0;
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    border-radius: 0;
  }
  
  .logix-ai-launcher {
    bottom: 16px;
    right: 16px;
  }
}
