/*
╔════════════════════════════════════════════════════════════════════╗
║  ROOTED VITALITY, INC.                                             ║
║  File: chat-bot/styles/chatbot.css                                 ║
║  Purpose: Universal chatbot styling with brand colors              ║
║  Holistic Wellness · Modern Connection Platform                    ║
║  rootedvitality.health | 2025                                         ║
╚════════════════════════════════════════════════════════════════════╝

TABLE OF CONTENTS:
  1. VARIABLES & IMPORTS
  2. CHATBOT CONTAINER & LAUNCHER
  3. CHAT WINDOW
  4. MESSAGE BUBBLES
  5. INPUT AREA
  6. RESPONSIVE DESIGN
*/

/* ============================================================
   1. VARIABLES & IMPORTS
   ============================================================ */

:root {
  /* Brand Colors */
  --sage-green: #77883e;
  --gold: #d4c47c;
  --cream: #f8f5e2;
  --dark-brown: #6b5b47;
  --light-bg: #fbf7ec;
  --border-light: #e0dcd5;
  
  /* Neutral Colors */
  --text-dark: #2e2b28;
  --text-muted: #6b6b6b;
  --white: #ffffff;
  
  /* Typography */
  --font-inter: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-lora: 'Lora', Georgia, serif;
}

/* ============================================================
   2. CHATBOT CONTAINER & LAUNCHER
   ============================================================ */

#chatbot-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
}

.chatbot-launcher-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sage-green) 0%, #5f7030 100%);
  color: var(--white);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(119, 136, 62, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
}

.chatbot-launcher-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(119, 136, 62, 0.4);
}

.chatbot-launcher-btn:active {
  transform: scale(0.95);
}

.chatbot-launcher-btn.open {
  background: linear-gradient(135deg, var(--dark-brown) 0%, #4a3f37 100%);
}

/* Notification badge */
.chatbot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e74c3c;
  color: var(--white);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

/* ============================================================
   3. CHAT WINDOW
   ============================================================ */

#chatbot-window {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 420px;
  max-height: 600px;
  background: var(--light-bg);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 9998;
  animation: slideUp 0.3s ease;
}

#chatbot-window.open {
  display: flex;
}

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

/* Header */
.chatbot-header {
  background: linear-gradient(135deg, var(--sage-green) 0%, #5f7030 100%);
  color: var(--white);
  padding: 16px 20px;
  border-bottom: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.chatbot-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  flex-shrink: 0;
  background: rgba(248, 245, 226, 0.6);
  border-radius: 50%;
  padding: 6px;
  box-sizing: border-box;
}

.chatbot-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  font-family: var(--font-inter);
  letter-spacing: -0.3px;
  color: var(--white);
}

.chatbot-header p {
  margin: 4px 0 0 0;
  font-size: 13px;
  font-family: var(--font-inter);
  color: var(--white) !important;
  opacity: 1;
  font-weight: 500;
}

.chatbot-header-close {
  background: none;
  border: none;
  color: var(--white);
  font-size: 24px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.chatbot-header-close:hover {
  opacity: 0.8;
}

/* Messages Container */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-family: var(--font-inter);
  background: var(--white);
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: var(--cream);
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: #c0bbb0;
}

/* ============================================================
   4. MESSAGE BUBBLES
   ============================================================ */

.chatbot-message {
  display: flex;
  margin-bottom: 8px;
  animation: fadeIn 0.3s ease;
}

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

/* Bot messages */
.chatbot-message.bot {
  justify-content: flex-start;
}

.chatbot-message.bot .message-bubble {
  background: var(--cream);
  color: var(--text-dark);
  border-radius: 12px 12px 12px 4px;
  max-width: 85%;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
}

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

.message-bubble ul {
  margin: 8px 0;
  padding-left: 20px;
}

.message-bubble li {
  margin: 4px 0;
  list-style-type: disc;
}

/* User messages */
.chatbot-message.user {
  justify-content: flex-end;
}

.chatbot-message.user .message-bubble {
  background: var(--sage-green);
  color: var(--white);
  border-radius: 12px 12px 4px 12px;
  max-width: 85%;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
}

/* Message bubble links */
.message-bubble a {
  color: inherit;
  text-decoration: underline;
  font-weight: 500;
  transition: opacity 0.2s ease;
}

.message-bubble a:hover {
  opacity: 0.8;
}

.chatbot-message.bot .message-bubble a {
  color: var(--sage-green);
}

.chatbot-message.user .message-bubble a {
  color: var(--white);
}

/* Avatar images */
.message-avatar {
  width: 32px;
  height: 32px;
  object-fit: contain;
  object-position: center;
  flex-shrink: 0;
}

/* ============================================================
   5. INPUT AREA
   ============================================================ */

.chatbot-input-area {
  padding: 12px;
  border-top: 1px solid var(--border-light);
  background: var(--light-bg);
  display: flex;
  gap: 8px;
}

.chatbot-input {
  flex: 1;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font-inter);
  font-size: 14px;
  color: var(--text-dark);
  background: var(--white);
  transition: all 0.2s ease;
}

.chatbot-input:focus {
  outline: none;
  border-color: var(--sage-green);
  box-shadow: 0 0 0 3px rgba(119, 136, 62, 0.1);
}

.chatbot-input::placeholder {
  color: var(--text-muted);
}

.chatbot-send-btn {
  background: var(--sage-green);
  color: var(--white);
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-send-btn:hover:not(:disabled) {
  background: #5f7030;
}

.chatbot-send-btn:active:not(:disabled) {
  transform: scale(0.95);
}

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

/* ============================================================
   6. RESPONSIVE DESIGN
   ============================================================ */

@media (max-width: 768px) {
  #chatbot-window {
    width: calc(100% - 48px);
    max-height: 50vh;
    bottom: 88px;
    right: 24px;
    left: 24px;
  }

  .chatbot-message.bot .message-bubble,
  .chatbot-message.user .message-bubble {
    max-width: 90%;
  }
}

@media (max-width: 480px) {
  #chatbot-launcher {
    bottom: 20px;
    right: 20px;
  }

  .chatbot-launcher-btn {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }

  #chatbot-window {
    width: calc(100% - 40px);
    max-height: 60vh;
    bottom: 80px;
    right: 20px;
    left: 20px;
    border-radius: 8px;
  }

  .chatbot-header h3 {
    font-size: 14px;
  }

  .chatbot-messages {
    padding: 12px;
    gap: 10px;
  }

  .chatbot-message.bot .message-bubble,
  .chatbot-message.user .message-bubble {
    max-width: 95%;
  }

  .chatbot-input {
    font-size: 13px;
    padding: 8px 10px;
  }

  .chatbot-send-btn {
    padding: 8px 12px;
    font-size: 13px;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --light-bg: #1a1714 !important;
    --white: #1a1714 !important;
    --text-dark: #f5f5f5 !important;
    --text-muted: #b0b0b0 !important;
    --border-light: #2a2622 !important;
    --cream: #2a2622 !important;
  }

  #chatbot-window {
    background: #1a1714 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5) !important;
  }

  .chatbot-messages {
    background: #1a1714 !important;
  }

  .chatbot-messages::-webkit-scrollbar-track {
    background: #2a2622 !important;
  }

  .chatbot-messages::-webkit-scrollbar-thumb {
    background: #3a3530 !important;
    border-radius: 3px;
  }

  .chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #4a4540 !important;
  }

  .chatbot-message.bot .message-bubble {
    background: #2a2622 !important;
    color: #f5f5f5 !important;
    border: 1px solid #3a3530 !important;
  }

  .chatbot-message.user .message-bubble {
    background: #5f7030 !important;
    color: #f5f5f5 !important;
  }

  .chatbot-input-area {
    background: #1a1714 !important;
    border-top-color: #2a2622 !important;
  }

  #chatbot-input {
    background: #2a2622 !important;
    border-color: #3a3530 !important;
    color: #f5f5f5 !important;
  }

  #chatbot-input::placeholder {
    color: #b0b0b0 !important;
  }
}




