/* AI Chatbot Styles - Aditya Laxmi Enterprises */

:root {
  --chat-primary: #6B2737;
  --chat-primary-dark: #4E1C29;
  --chat-accent: #C9A227;
  --chat-bg: #FFFFFF;
  --chat-border: #E5E5E5;
  --chat-text: #2D2A26;
  --chat-text-light: #666666;
  --chat-user-bg: #6B2737;
  --chat-bot-bg: #F5F0E8;
}

/* Chat Button */
.chat-button {
  position: fixed;
  bottom: 100px;
  right: 24px;
  z-index: 998;
}

.chat-trigger {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-dark) 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(107, 39, 55, 0.4);
  transition: all 0.3s ease;
  position: relative;
}

.chat-trigger:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(107, 39, 55, 0.5);
}

.chat-trigger svg {
  width: 28px;
  height: 28px;
  fill: white;
  transition: all 0.3s ease;
}

.chat-trigger.has-message::after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 12px;
  height: 12px;
  background: #25D366;
  border-radius: 50%;
  border: 2px solid white;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
}

/* Chat Window */
.chat-window {
  position: fixed;
  bottom: 180px;
  right: 24px;
  width: 380px;
  height: 520px;
  max-height: calc(100vh - 160px);
  background: var(--chat-bg);
  border-radius: 20px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.3s ease;
  overflow: hidden;
}

.chat-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

@media (max-width: 480px) {
  .chat-window {
    bottom: 100px;
    right: 12px;
    left: 12px;
    width: auto;
    height: calc(100vh - 140px);
    max-height: none;
    border-radius: 16px;
  }
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-dark) 100%);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-avatar {
  width: 44px;
  height: 44px;
  background: var(--chat-accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-avatar svg {
  width: 24px;
  height: 24px;
  fill: var(--chat-primary-dark);
}

.chat-info {
  flex: 1;
}

.chat-info h3 {
  color: white;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.chat-info span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

.chat-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chat-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.chat-close svg {
  width: 20px;
  height: 20px;
  stroke: white;
}

/* Chat Body */
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Messages */
.message {
  display: flex;
  gap: 10px;
  animation: messageIn 0.3s ease;
}

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

.message.bot {
  align-self: flex-start;
  max-width: 85%;
}

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

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.message.bot .message-avatar {
  background: var(--chat-primary);
}

.message.bot .message-avatar svg {
  width: 18px;
  height: 18px;
  fill: white;
}

.message.user .message-avatar {
  background: var(--chat-accent);
}

.message.user .message-avatar span {
  font-size: 14px;
  font-weight: 600;
  color: var(--chat-primary-dark);
}

.message-content {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
}

.message.bot .message-content {
  background: var(--chat-bot-bg);
  border-bottom-left-radius: 4px;
  color: var(--chat-text);
}

.message.user .message-content {
  background: var(--chat-user-bg);
  border-bottom-right-radius: 4px;
  color: white;
}

/* Phone Capture Form */
.phone-capture {
  background: var(--chat-bot-bg);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
}

.phone-capture h4 {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  color: var(--chat-text);
  margin-bottom: 8px;
}

.phone-capture p {
  font-size: 13px;
  color: var(--chat-text-light);
  margin-bottom: 16px;
}

.phone-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.phone-prefix {
  width: 60px;
  padding: 12px;
  background: var(--chat-border);
  border: 2px solid var(--chat-border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--chat-text);
  text-align: center;
}

.phone-input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid var(--chat-border);
  border-radius: 10px;
  font-size: 14px;
  transition: all 0.2s ease;
}

.phone-input:focus {
  outline: none;
  border-color: var(--chat-primary);
}

.phone-submit {
  width: 100%;
  padding: 14px;
  background: var(--chat-accent);
  color: var(--chat-primary-dark);
  font-size: 15px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.phone-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(201, 162, 39, 0.35);
}

.phone-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.phone-error {
  color: #DC2626;
  font-size: 12px;
  margin-top: 8px;
  display: none;
}

.phone-error.visible {
  display: block;
}

/* CTA Button */
.cta-message {
  background: linear-gradient(135deg, var(--chat-primary) 0%, var(--chat-primary-dark) 100%);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  margin-top: 8px;
}

.cta-message p {
  color: white;
  font-size: 14px;
  margin-bottom: 12px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--chat-accent);
  color: var(--chat-primary-dark);
  font-size: 14px;
  font-weight: 700;
  border-radius: 25px;
  text-decoration: none;
  transition: all 0.2s ease;
}

.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(201, 162, 39, 0.35);
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: var(--chat-bot-bg);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--chat-text-light);
  border-radius: 50%;
  animation: typing 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
}

/* Quick Actions */
.quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.quick-action {
  padding: 8px 14px;
  background: white;
  border: 1px solid var(--chat-border);
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--chat-text);
}

.quick-action:hover {
  border-color: var(--chat-primary);
  background: var(--chat-bot-bg);
}

/* Chat Footer */
.chat-footer {
  padding: 16px;
  border-top: 1px solid var(--chat-border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input-wrapper {
  flex: 1;
  position: relative;
}

.chat-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--chat-border);
  border-radius: 25px;
  font-size: 14px;
  resize: none;
  max-height: 120px;
  transition: all 0.2s ease;
}

.chat-input:focus {
  outline: none;
  border-color: var(--chat-primary);
}

.chat-send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--chat-primary);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chat-send:hover {
  background: var(--chat-primary-dark);
  transform: scale(1.05);
}

.chat-send:disabled {
  background: var(--chat-border);
  cursor: not-allowed;
  transform: none;
}

.chat-send svg {
  width: 20px;
  height: 20px;
  stroke: white;
}

/* Suggested Questions */
.suggested-questions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.suggested-question {
  padding: 12px 16px;
  background: white;
  border: 1px solid var(--chat-border);
  border-radius: 12px;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--chat-text);
}

.suggested-question:hover {
  border-color: var(--chat-primary);
  background: var(--chat-bot-bg);
}

/* API Key Notice */
.api-key-notice {
  background: #FEF3C7;
  border: 1px solid #F59E0B;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #92400E;
  margin-bottom: 12px;
}

.api-key-notice strong {
  display: block;
  margin-bottom: 4px;
}
