/* ==========================================================================
   LITOS Growth Assistant — Professional Widget Styles
   Designed for litos.co.in | Mobile-First & Glassmorphism Aesthetics
   ========================================================================== */

:root {
  --litos-navy-dark: #0b1329;
  --litos-navy-card: #131d38;
  --litos-navy-light: #1c2b4e;
  --litos-gold: #d4af37;
  --litos-gold-hover: #b89326;
  --litos-gold-glow: rgba(212, 175, 55, 0.25);
  --litos-text-main: #f8fafc;
  --litos-text-muted: #94a3b8;
  --litos-border: rgba(212, 175, 55, 0.22);
  --litos-user-bubble: #1e3a8a;
  --litos-bot-bubble: #16203a;
  --litos-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  --litos-font: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, sans-serif;
}

/* Floating Launcher Trigger */
#litos-widget-launcher {
  position: fixed;
  bottom: 95px; /* Floats comfortably above the WhatsApp button */
  right: 20px;
  z-index: 99999999;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-family: var(--litos-font);
  transition: transform 0.25s ease, filter 0.25s ease;
}

#litos-widget-launcher:hover {
  transform: translateY(-2px);
  filter: drop-shadow(0 6px 20px var(--litos-gold-glow));
}

.litos-launcher-bubble {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #182648 0%, #0b1329 100%);
  border: 1.5px solid var(--litos-gold);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.litos-launcher-bubble svg {
  width: 28px;
  height: 28px;
  fill: var(--litos-gold);
  transition: transform 0.25s ease;
}

.litos-launcher-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 13px;
  height: 13px;
  background-color: #10b981;
  border: 2px solid #0b1329;
  border-radius: 50%;
}

.litos-launcher-prompt {
  background: #111a33;
  color: var(--litos-text-main);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid var(--litos-border);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  animation: litosPulse 3.5s infinite;
}

.litos-launcher-prompt span {
  color: var(--litos-gold);
  font-weight: 600;
}

@keyframes litosPulse {
  0%, 100% { opacity: 0.95; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

/* Chat Main Window */
#litos-chat-window {
  position: fixed;
  bottom: 96px;
  right: 20px;
  width: 390px;
  height: 590px;
  max-height: calc(100vh - 120px);
  background-color: var(--litos-navy-dark);
  border: 1px solid var(--litos-border);
  border-radius: 18px;
  box-shadow: var(--litos-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 99999999;
  font-family: var(--litos-font);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.97);
  transition: opacity 0.25s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

#litos-chat-window.litos-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Header */
.litos-chat-header {
  background: linear-gradient(135deg, #172447 0%, #0c142c 100%);
  border-bottom: 1px solid var(--litos-border);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.litos-header-profile {
  display: flex;
  align-items: center;
  gap: 12px;
}

.litos-header-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #0b1329;
  border: 1px solid var(--litos-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--litos-gold);
  font-size: 16px;
  font-weight: 700;
}

.litos-header-title {
  color: var(--litos-text-main);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.litos-header-subtitle {
  color: var(--litos-text-muted);
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.litos-status-indicator {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
}

.litos-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.litos-header-btn {
  background: transparent;
  border: none;
  color: var(--litos-text-muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: background 0.2s, color 0.2s;
}

.litos-header-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--litos-text-main);
}

/* Chat Body */
.litos-chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: radial-gradient(circle at top right, rgba(212, 175, 55, 0.04) 0%, transparent 60%);
  scroll-behavior: smooth;
}

.litos-chat-body::-webkit-scrollbar {
  width: 5px;
}
.litos-chat-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

/* Message Styles */
.litos-msg-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 90%;
}

.litos-msg-row.litos-bot-row {
  align-self: flex-start;
}

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

.litos-bubble {
  padding: 12px 15px;
  font-size: 13.5px;
  line-height: 1.5;
  border-radius: 14px;
  word-break: break-word;
}

.litos-bot-bubble {
  background-color: var(--litos-bot-bubble);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom-left-radius: 4px;
}

.litos-user-bubble {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e3a8a 100%);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.litos-bubble strong {
  color: var(--litos-gold);
}

.litos-bubble p {
  margin: 0 0 6px 0;
}
.litos-bubble p:last-child {
  margin-bottom: 0;
}

/* Category Quick-Select Pills */
.litos-category-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.litos-category-btn {
  background: #131e3b;
  border: 1px solid var(--litos-border);
  color: #f1f5f9;
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 12.8px;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  font-family: var(--litos-font);
}

.litos-category-btn:hover {
  background: #1b294e;
  border-color: var(--litos-gold);
  transform: translateX(3px);
  color: #ffffff;
}

.litos-cat-icon {
  font-size: 15px;
}

/* Typing Indicator */
.litos-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background-color: var(--litos-bot-bubble);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  align-self: flex-start;
}

.litos-dot {
  width: 6px;
  height: 6px;
  background-color: var(--litos-gold);
  border-radius: 50%;
  animation: litosBounce 1.4s infinite ease-in-out;
}
.litos-dot:nth-child(2) { animation-delay: 0.2s; }
.litos-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes litosBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* Lead Capture Card inside chat */
.litos-lead-card {
  background: #101a33;
  border: 1px solid var(--litos-gold);
  border-radius: 12px;
  padding: 14px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.litos-lead-title {
  color: var(--litos-gold);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.litos-lead-privacy {
  font-size: 11px;
  color: var(--litos-text-muted);
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 8px;
  border-radius: 6px;
}

.litos-form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.litos-form-input, .litos-form-select {
  background: #0b1329;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12.5px;
  outline: none;
  font-family: var(--litos-font);
}
.litos-form-input:focus, .litos-form-select:focus {
  border-color: var(--litos-gold);
}

.litos-lead-submit {
  background: linear-gradient(135deg, #d4af37 0%, #b89326 100%);
  color: #0b1329;
  font-weight: 700;
  font-size: 12.5px;
  padding: 9px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity 0.2s;
  margin-top: 4px;
}
.litos-lead-submit:hover {
  opacity: 0.92;
}

/* Footer / Input Bar */
.litos-chat-footer {
  padding: 12px 14px;
  background: #0e1731;
  border-top: 1px solid var(--litos-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.litos-chat-input {
  flex: 1;
  background: #070d1e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 22px;
  color: #fff;
  padding: 10px 14px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  font-family: var(--litos-font);
}

.litos-chat-input:focus {
  border-color: var(--litos-gold);
}

.litos-send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--litos-gold);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0b1329;
  transition: transform 0.2s, background 0.2s;
  flex-shrink: 0;
}

.litos-send-btn:hover {
  background: var(--litos-gold-hover);
  transform: scale(1.05);
}

.litos-send-btn svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}

.litos-powered-by {
  text-align: center;
  font-size: 10.5px;
  color: #64748b;
  padding: 5px 0 3px 0;
  background: #0b1329;
}
.litos-powered-by a {
  color: var(--litos-gold);
  text-decoration: none;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  #litos-chat-window {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
    border: none;
  }
  #litos-widget-launcher {
    bottom: 16px;
    right: 16px;
  }
  .litos-launcher-prompt {
    display: none;
  }
}
