/* uniform.css - v3 with Layout Fixes and Improved CTA */

/* --- 1. GLOBAL & BAUHAUS FOUNDATION --- */
:root {
  --color-background: #F0EFEA;
  --color-text: #1a1a1a;
  --color-primary: #D4AF37; /* Gold */
  --color-secondary: #2c3e50; /* Dark Blue-Grey */
  --color-accent: #c0392b; /* Red */
  --color-bot-bubble: #EAEAEA;
  --font-primary: 'Helvetica', 'Arial', sans-serif;
  --font-size-base: 16px;
  --line-height-base: 1.6;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* --- THE STICKY FOOTER & LAYOUT FIX --- */
html, body {
  height: 100%; /* Ensure both html and body can take full height */
}
body {
  display: flex;
  flex-direction: column; /* This is key: Arranges direct children of body (header, main, footer) vertically */
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  background-color: var(--color-background);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
main {
  flex-grow: 1; /* This is the magic: The main content area will grow to push the footer down */
}
/* --- END STICKY FOOTER FIX --- */


.page-wrapper { max-width: 900px; margin: 0 auto; padding: 0 20px; }


/* --- 2. HEADER --- */
.header {
  padding: 20px 0;
  border-bottom: 2px solid var(--color-text);
  flex-shrink: 0; /* Prevents header from shrinking */
}
.header .page-wrapper { display: flex; justify-content: space-between; align-items: center; }
.logo-image { display: block; }
.navigation .nav-link { color: var(--color-text); text-decoration: none; font-weight: bold; margin-left: 25px; transition: color 0.2s; }
.navigation .nav-link:hover { color: var(--color-accent); }


/* --- 3. HERO SECTION with ANIMATION --- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.hero { padding: 80px 0; text-align: left; }
.hero-title { font-size: 3.5rem; font-weight: bold; line-height: 1.1; text-transform: lowercase; margin-bottom: 20px; }
.hero-title span { display: inline-block; opacity: 0; animation: fadeInUp 0.5s ease-out forwards; }
.hero-subtitle { font-size: 1.2rem; max-width: 50ch; margin-bottom: 15px; }
.hero-disclaimer { font-size: 0.9rem; color: #666; margin-bottom: 30px; }
.button-primary { display: inline-block; background-color: var(--color-text); color: var(--color-background); text-decoration: none; font-weight: bold; padding: 15px 35px; transition: background-color 0.2s; }
.button-primary:hover { background-color: var(--color-accent); }


/* --- 4. CHAT INTERFACE with BUBBLES (Corrected) --- */

.chat-section { background-color: #FFFFFF; border: 2px solid var(--color-text); padding: 20px; margin: 60px 0; }

#chatbox {
  height: 350px;
  overflow-y: auto;
  margin-bottom: 20px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  /* KEY FIX: This sets the default horizontal alignment for all children */
  align-items: flex-start;
  scrollbar-gutter: stable;
}

/* Base message container styling */
.message {
  display: flex; /* This is important for the bubble content */
  margin-bottom: 15px;
  max-width: 80%;
  /* This container gets aligned by its parent, #chatbox */
}
.message-content {
  padding: 10px 15px;
  border-radius: 18px;
  line-height: 1.4;
  word-break: break-word;
}

/* User message (Right) */
.user-message {
  /* This overrides the parent's align-items: flex-start */
  align-self: flex-end;
}
.user-message .message-content {
  background-color: var(--color-secondary);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

/* Bot message (Left) */
.bot-message {
  /* This explicitly follows the parent's default alignment */
  align-self: flex-start;
}
.bot-message .message-content {
  background-color: var(--color-bot-bubble);
  color: var(--color-text);
  border-bottom-left-radius: 4px;
}

/* --- 4b. THINKING ANIMATION (Corrected) --- */

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

/* Your JS creates a div with id="typing-indicator" and class="message bot-message" */
/* This rule targets that specific element by its ID to style it as a bubble */
#typing-indicator {
  padding: 14px 18px; /* Give it bubble-like padding */
  background-color: var(--color-bot-bubble);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  display: flex;
  align-items: center;
}

/* This rule targets the spans INSIDE the #typing-indicator bubble */
#typing-indicator span {
  height: 8px;
  width: 8px;
  margin: 0 3px;
  background-color: #999;
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.4s infinite ease-in-out both;
}
#typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
#typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
#typing-indicator span:nth-child(3) { animation-delay: 0s; }


/* --- Chat Form and Terms Link (Unchanged) --- */
.chat-form { display: flex; border: 2px solid var(--color-text); }
.chat-input { flex-grow: 1; border: none; padding: 15px; font-size: 1rem; background-color: transparent; }
.chat-input:focus { outline: 2px solid var(--color-primary); outline-offset: -2px; }
.send-button { background-color: var(--color-text); border: none; color: var(--color-background); padding: 15px; cursor: pointer; transition: background-color 0.2s; flex-shrink: 0; }
.send-button:hover { background-color: var(--color-accent); }
.send-button svg { width: 24px; height: 24px; display: block; }
.terms-link { font-size: 0.8rem; text-align: center; margin-top: 15px; color: #666; }
.terms-link a { color: var(--color-text); font-weight: bold; }


/* --- 5. FAQ SECTION --- */
.faq-section { padding: 60px 0; }
.section-title { text-align: center; font-size: 2rem; font-weight: bold; text-transform: lowercase; margin-bottom: 40px; }
.faq-item { border-bottom: 2px solid var(--color-text); padding: 20px 0; }
.faq-item:first-of-type { border-top: 2px solid var(--color-text); }
.faq-question { font-size: 1.2rem; font-weight: bold; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after { content: '+'; font-size: 2rem; font-weight: normal; }
.faq-item[open] .faq-question::after { content: '−'; }
.faq-answer { padding-top: 15px; max-width: 75ch; }


/* --- 6. GENERIC CONTENT PAGE STYLES (for Privacy, Contact, etc.) --- */
.content-section {
  padding: 60px 0;
  max-width: 75ch;
  margin: 0 auto;
}
.content-section h1 { font-size: 3rem; font-weight: bold; text-transform: lowercase; border-bottom: 2px solid var(--color-text); padding-bottom: 10px; margin-bottom: 30px; }
.content-section h2 { font-size: 1.8rem; font-weight: bold; text-transform: lowercase; margin-top: 40px; margin-bottom: 15px; }
.content-section h3 { font-size: 1.2rem; font-weight: bold; margin-top: 25px; margin-bottom: 10px; }
.content-section p, .content-section li { margin-bottom: 15px; line-height: 1.7; }
.content-section ul { list-style-position: inside; padding-left: 10px; }
.content-section a { color: var(--color-accent); font-weight: bold; text-decoration: none; }
.content-section a:hover { text-decoration: underline; }


/* --- 7. CTA SECTION - REVAMPED --- */
.cta-section {
  padding: 60px 20px;
  background-color: var(--color-text); /* Black for high contrast */
  color: var(--color-background);
  border-top: 2px solid var(--color-primary); /* Gold accent line */
  border-bottom: 2px solid var(--color-primary);
}
.cta-section .page-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.cta-section h2 {
  font-size: 2.5rem;
  font-weight: bold;
  text-transform: lowercase;
  margin-bottom: 15px;
}
.cta-section p {
  font-size: 1.1rem;
  max-width: 50ch;
  margin-bottom: 30px;
  opacity: 0.9;
}
.button-cta {
  display: inline-block;
  background-color: var(--color-primary); /* Gold button */
  color: var(--color-text);
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem;
  padding: 15px 40px;
  transition: all 0.3s ease;
  border: 2px solid var(--color-primary);
}
.button-cta:hover {
  background-color: transparent;
  color: var(--color-primary);
  transform: translateY(-3px);
}


/* --- 8. FOOTER --- */
.footer {
  padding: 20px 0;
  border-top: 2px solid var(--color-text);
  flex-shrink: 0; /* Prevents footer from shrinking */
}
.footer .page-wrapper { display: flex; justify-content: space-between; align-items: center; font-size: 0.9rem; color: #666; }
.footer a { color: var(--color-text); font-weight: bold; text-decoration: none; }
.footer a:hover { text-decoration: underline; }


/* --- 9. RESPONSIVENESS --- */
@media (max-width: 768px) {
  .hero-title { font-size: 2.5rem; }
  .footer .page-wrapper { flex-direction: column; gap: 10px; }
}