/* =====================================================
   TERRAGNI CONSULTING CHATBOT - COMPANY BRAND COLORS
   Primary: #7030A0 (Purple) 
   Secondary: #FFDE00 (Yellow)
   Background: #F5F3E4 (Cream)
   Fonts: Neue Hass Grotesk (body), Hepta Slab/Forum (headers)
   ===================================================== */

/* Custom Font Imports */
@import url('https://fonts.googleapis.com/css2?family=Hepta+Slab:wght@300;400;500;600;700;800;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Forum&display=swap');

/* ── RESET & ROOT ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary:        #7030A0;      /* Company Purple - EXACT */
  --secondary:      #FFDE00;      /* Company Yellow - EXACT */
  --cream:          #F5F3E4;      /* Company Background */
  --dark:           #7030A0;      /* Dark background */
  --white:          #FFFFFF;
  --text:           #2C2C2C;
  --text-light:     #666666;
  --muted:          #999999;
  --border:         rgba(0, 0, 0, 0.08);
  --shadow-card:    0 4px 24px rgba(0, 0, 0, 0.08);
  --shadow-lg:      0 8px 32px rgba(0, 0, 0, 0.12);
  --radius-lg:      20px;
  --radius-md:      14px;
  --radius-sm:      8px;
  --transition:     0.2s ease;
  
  /* Custom Fonts */
  --font-body: 'Neue Hass Grotesk', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-headers: 'Hepta Slab', 'Forum', 'DM Serif Display', Georgia, serif;
}

/* ── FULL PAGE BODY ── */
body {
  font-family: var(--font-body);
  background: #1A0F26;
  min-height: 100vh;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
}

/* Animated gradient background with company colors */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(112, 48, 160, 0.08) 0%, transparent 60%),
              radial-gradient(ellipse at 80% 80%, rgba(255, 222, 0, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ── MAIN CONTAINER - FULL PAGE ── */
.container {
  width: 100%;
  height: 100vh;
  max-width: none;
  max-height: none;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  position: relative;
  z-index: 1;
  box-shadow: none;
  border-radius: 0;
  overflow: hidden;
}

/* ── HEADER - EXACT BRAND COLORS ── */
.header {
  background: #7030A0;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  border-bottom: 3px solid #FFDE00;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.logo-wrap {
  width: 52px;
  height: 52px;
  background: transparent;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.company-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-width: 52px;
  max-height: 52px;
}

.logo-wrap svg {
  width: 32px;
  height: 32px;
}

.header-text {
  flex: 1;
}

.header-text h1 {
  font-family: var(--font-headers);
  color: #FFFFFF;
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.header-text p {
  font-family: var(--font-body);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.7rem;
  margin-top: 4px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 400;
}

.status-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 12px;
  border-radius: 20px;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: #FF4444;
  border-radius: 50%;
  transition: all 0.3s ease;
}

.status-dot.online {
  background: #4ADE80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.7);
  animation: pulse 2s infinite;
}

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

.status-label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
}

/* ── MESSAGES AREA ── */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scroll-behavior: smooth;
  background: var(--cream);
}

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

.messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
}

.messages::-webkit-scrollbar-thumb {
  background: rgba(112, 48, 160, 0.3);
  border-radius: 3px;
}

.messages::-webkit-scrollbar-thumb:hover {
  background: rgba(112, 48, 160, 0.5);
}

/* ── SINGLE MESSAGE ── */
.msg {
  display: flex;
  gap: 12px;
  animation: fadeUp 0.3s ease forwards;
  opacity: 0;
  max-width: 85%;
}

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

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

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

/* ── AVATAR ── */
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
  letter-spacing: 0.03em;
  font-family: var(--font-headers);
}

.msg.bot .avatar { 
  background: #1A0F26;
  color: #FFDE00;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.msg.user .avatar { 
  background: #7030A0;
  color: #FFDE00;
  box-shadow: 0 2px 8px rgba(112, 48, 160, 0.3);
}

/* ── BUBBLE ── */
.bubble {
  max-width: 100%;
  padding: 14px 20px;
  line-height: 1.65;
  font-size: 0.9rem;
  color: var(--text);
  font-family: var(--font-body);
}

.msg.bot .bubble {
  background: var(--white);
  border-radius: 6px 20px 20px 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
}

.msg.user .bubble {
  background: #7030A0;
  color: var(--white);
  border-radius: 20px 6px 20px 20px;
  box-shadow: 0 2px 10px rgba(112, 48, 160, 0.2);
}

.msg.user .bubble strong {
  color: #FFDE00;
}

.bubble p { margin-bottom: 8px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble strong { font-weight: 700; }
.bubble em { font-style: italic; opacity: 0.85; }
.bubble ul { 
  padding-left: 20px; 
  margin: 8px 0;
  list-style-type: none;
}
.bubble ul li { 
  margin-bottom: 6px;
  position: relative;
  padding-left: 20px;
}
.bubble ul li::before {
  content: "•";
  color: #FFDE00;
  font-weight: bold;
  position: absolute;
  left: 0;
}

/* ── TYPING INDICATOR ── */
.typing-indicator {
  display: flex;
  gap: 6px;
  padding: 14px 20px;
  background: var(--white);
  border-radius: 6px 20px 20px 20px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  width: fit-content;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: #7030A0;
  border-radius: 50%;
  animation: bounce 1.4s infinite;
  opacity: 0.5;
}

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

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-8px); opacity: 1; }
}

/* ── SUGGESTION CHIPS ── */
.chips-label {
  padding: 8px 32px 0;
  font-size: 0.7rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  flex-shrink: 0;
  font-weight: 600;
  font-family: var(--font-body);
}

.suggestions {
  padding: 10px 32px 16px;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  flex-shrink: 0;
  background: var(--cream);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  scrollbar-width: thin;
}

.suggestions::-webkit-scrollbar {
  height: 4px;
}

.suggestions::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 2px;
}

.suggestions::-webkit-scrollbar-thumb {
  background: rgba(112, 48, 160, 0.3);
  border-radius: 2px;
}

/* Static Chips */
.chip {
  padding: 8px 18px;
  background: rgba(112, 48, 160, 0.1);
  border: 1.5px solid rgba(112, 48, 160, 0.3);
  border-radius: 30px;
  font-size: 0.75rem;
  color: #7030A0;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.chip:hover {
  background: #7030A0;
  color: #FFDE00;
  border-color: #FFDE00;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(112, 48, 160, 0.4);
}

/* ── INPUT AREA ── */
.input-area {
  padding: 16px 24px 20px;
  border-top: 1px solid var(--border);
  background: var(--white);
  display: flex;
  gap: 14px;
  align-items: flex-end;
  flex-shrink: 0;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.input-wrap {
  flex: 1;
  background: #F4EFE9;
  border-radius: 18px;
  padding: 12px 18px;
  border: 2px solid transparent;
  transition: all 0.25s ease;
}

.input-wrap:focus-within {
  border-color: #7030A0;
  background: white;
  box-shadow: 0 0 0 3px rgba(112, 48, 160, 0.1);
}

#userInput {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  resize: none;
  max-height: 120px;
  line-height: 1.5;
}

#userInput::placeholder {
  color: #BBAD9E;
  font-size: 0.9rem;
  font-family: var(--font-body);
}

/* Send Button */
#sendBtn {
  width: 46px;
  height: 46px;
  background: #7030A0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(112, 48, 160, 0.3);
}

#sendBtn:hover {
  transform: scale(1.08);
  background: #7030A0;
  box-shadow: 0 6px 20px rgba(112, 48, 160, 0.4);
}

#sendBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

#sendBtn svg {
  width: 20px;
  height: 20px;
}

/* ── FOOTER NOTE ── */
.footer-note {
  text-align: center;
  font-size: 0.7rem;
  color: var(--muted);
  padding: 10px 0 14px;
  background: var(--white);
  letter-spacing: 0.05em;
  flex-shrink: 0;
  border-top: 1px solid var(--border);
  font-family: var(--font-body);
}

/* ── DYNAMIC SUGGESTIONS STYLING ── */
.dynamic-suggestions {
  margin: 8px 0 16px 50px;
  padding: 12px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  animation: fadeUp 0.3s ease;
}

/* Dynamic Chips */
.dynamic-chip {
  padding: 6px 14px;
  background: rgba(112, 48, 160, 0.1);
  border: 1.5px solid rgba(112, 48, 160, 0.3);
  border-radius: 30px;
  font-size: 0.75rem;
  color: #7030A0;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.dynamic-chip:hover {
  background: #7030A0;
  color: #FFDE00;
  border-color: #FFDE00;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(112, 48, 160, 0.4);
}

/* ── EMAIL AND LINK STYLING ── */
.bubble a {
  color: #7030A0;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
}

.bubble a:hover {
  color: #7030A0;
  text-decoration: none;
}

.email-link {
  color: #7030A0;
  text-decoration: underline;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  font-family: var(--font-body);
}

.email-link:hover {
  color: #7030A0;
  background: rgba(112, 48, 160, 0.1);
  padding: 2px 4px;
  border-radius: 4px;
}

/* ── RESPONSIVE DESIGN ── */
@media (max-width: 768px) {
  .header {
    padding: 12px 20px;
  }
  
  .logo-wrap {
    width: 40px;
    height: 40px;
  }
  
  .header-text h1 {
    font-size: 1rem;
  }
  
  .header-text p {
    font-size: 0.55rem;
  }
  
  .messages {
    padding: 16px 20px;
  }
  
  .msg {
    max-width: 90%;
  }
  
  .avatar {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
  }
  
  .bubble {
    padding: 10px 14px;
    font-size: 0.85rem;
  }
  
  .chips-label {
    padding: 6px 20px 0;
    font-size: 0.65rem;
  }
  
  .suggestions {
    padding: 8px 20px 12px;
  }
  
  .chip {
    padding: 6px 14px;
    font-size: 0.7rem;
  }
  
  .dynamic-suggestions {
    margin: 8px 0 16px 42px;
  }
  
  .dynamic-chip {
    padding: 5px 12px;
    font-size: 0.7rem;
  }
  
  .input-area {
    padding: 12px 16px 16px;
  }
  
  .input-wrap {
    padding: 10px 14px;
  }
  
  #sendBtn {
    width: 42px;
    height: 42px;
  }
  
  .status-wrap {
    padding: 4px 10px;
  }
  
  .status-label {
    font-size: 0.6rem;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 10px 14px;
  }
  
  .logo-wrap {
    width: 34px;
    height: 34px;
  }
  
  .header-text h1 {
    font-size: 0.85rem;
  }
  
  .messages {
    padding: 12px 14px;
    gap: 14px;
  }
  
  .chips-label {
    padding: 5px 16px 0;
  }
  
  .suggestions {
    padding: 6px 16px 10px;
    gap: 8px;
  }
  
  .chip {
    padding: 5px 12px;
    font-size: 0.65rem;
  }
  
  .dynamic-suggestions {
    margin: 6px 0 12px 36px;
  }
  
  .dynamic-chip {
    padding: 4px 10px;
    font-size: 0.65rem;
  }
  
  .input-wrap {
    padding: 8px 12px;
  }
  
  #userInput {
    font-size: 0.85rem;
  }
  
  #sendBtn {
    width: 38px;
    height: 38px;
  }
  
  .footer-note {
    font-size: 0.6rem;
    padding: 6px 0 10px;
  }
}

/* ── FINAL CHIP HOVER OVERRIDES ── */
.chip:hover,
.dynamic-chip:hover {
  background: #7030A0 !important;
  color: #FFDE00 !important;
  border-color: #FFDE00 !important;
  transform: translateY(-2px) !important;
  box-shadow: 0 4px 12px rgba(112, 48, 160, 0.4) !important;
}

.suggestions .chip:hover {
  background: #7030A0 !important;
  color: #FFDE00 !important;
  border-color: #FFDE00 !important;
}

.dynamic-suggestions .dynamic-chip:hover {
  background: #7030A0 !important;
  color: #FFDE00 !important;
  border-color: #FFDE00 !important;
}

