:root {
  --primary-color: #6d5dfc;
  --primary-light: #8a7fff;
  --primary-gradient: linear-gradient(135deg, #6d5dfc 0%, #8a7fff 100%);
  --secondary-color: #f0eefe;
  --accent-color: #5e60ce;
  --light-color: #f9fafc;
  --text-color: #2c3e50;
  --text-light: #64748b;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;
  --success-color: #10b981;
  --warning-color: #fbbf24;
  --error-color: #ef4444;
  --border-radius-sm: 8px;
  --border-radius: 16px;
  --border-radius-lg: 24px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.04), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 10px 10px -5px rgba(0, 0, 0, 0.02);
  --shadow-input: inset 2px 2px 5px rgba(0, 0, 0, 0.05), inset -2px -2px 5px rgba(255, 255, 255, 0.9);
  --kb-width: 380px; /* Knowledge base width */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background-color: var(--light-color);
  color: var(--text-color);
  line-height: 1.6;
  font-weight: 400;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2.5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* New header styling */
header {
  margin-bottom: 3rem;
  position: relative;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-left: 100px; /* Keep the left padding */
}

.logo-section {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 70%;
}

.logo-container {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.brand-text {
  display: flex;
  align-items: center;
  flex-wrap: wrap; /* Allow wrapping on small screens */
}

.badge {
  background-color: var(--accent-color);
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 1rem;
  margin-left: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}

.logo {
  width: 56px;
  height: 56px;
  margin-right: 0.75rem; /* Space between logo and text on desktop */
  filter: drop-shadow(0 4px 6px rgba(109, 93, 252, 0.2));
}

h1 {
  font-size: 2.75rem;
  font-weight: 700;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  letter-spacing: -0.03em;
  margin: 0;
}

.tagline-container {
  margin-top: 0.5rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.highlight {
  color: var(--primary-color);
  position: relative;
  font-weight: 700;
}

.highlight::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background-color: rgba(109, 93, 252, 0.2);
  border-radius: 1rem;
  z-index: -1;
}

.subheading {
  color: var(--gray-500);
  font-size: 0.9rem;
}

.username {
  color: var(--primary-color);
  font-weight: 600;
}

.date {
  color: var(--gray-600);
}

.header-cta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.stats {
  display: flex;
  gap: 1.5rem;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Main content */
h3 {
  font-size: 1.5rem;
  margin-bottom: 1.75rem;
  color: var(--gray-800);
  font-weight: 600;
  letter-spacing: -0.02em;
}

main {
  flex: 1;
  position: relative;
}

/* Layout with chat on left and knowledge base on right */
.demo-section {
  display: flex;
  position: relative;
  height: calc(100vh - 280px);
  min-height: 550px;
  gap: 20px;
}

/* Card styling */
.card {
  background-color: white;
  border-radius: var(--border-radius-lg);
  padding: 2.25rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--gray-100);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

/* Chat interface styling */
.chat-interface {
  flex: 1;
  height: 100%;
}

/* Knowledge base styling */
.knowledge-base {
  width: var(--kb-width);
  height: 100%;
}

/* Warning message - Smaller version */
.warning-message {
  background-color: rgba(251, 191, 36, 0.1);
  border-left: 4px solid var(--warning-color);
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius-sm);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}

.warning-message.compact {
  padding: 0.5rem 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.85rem;
}

.info-icon {
  color: var(--warning-color);
  margin-right: 0.75rem;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.warning-message p {
  color: var(--gray-700);
  font-size: 0.95rem;
}

.warning-message.compact p {
  font-size: 0.82rem;
  line-height: 1.4;
}

.textarea-container {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

textarea {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  padding: 1.25rem;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 1rem;
  resize: none;
  flex: 1;
  line-height: 1.5;
  color: var(--gray-800);
  background-color: var(--gray-100);
  box-shadow: var(--shadow-input);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

textarea::placeholder {
  color: var(--gray-400);
}

textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(109, 93, 252, 0.1);
}

.character-count {
  text-align: right;
  color: var(--gray-500);
  margin-top: 0.75rem;
  font-size: 0.875rem;
}

.chat-container {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 1.5rem;
  padding-right: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.message {
  display: flex;
  margin-bottom: 0.5rem;
  opacity: 0;
  animation: slideIn 0.3s forwards;
}

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

.avatar-container {
  margin-right: 0.75rem;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.8rem;
  box-shadow: var(--shadow-sm);
}

.avatar svg {
  width: 24px;
  height: 24px;
  stroke: white;
}

.bot-avatar {
  background: var(--primary-gradient);
  color: white;
}

.user-avatar {
  background-color: var(--gray-200);
  color: var(--gray-800);
}

.message-content {
  background-color: var(--gray-100);
  padding: 1rem 1.25rem;
  border-radius: var(--border-radius-lg);
  max-width: 80%;
  overflow-wrap: break-word;
  color: var(--gray-800);
  box-shadow: var(--shadow-sm);
}

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

.message.user .avatar-container {
  margin-right: 0;
  margin-left: 0.75rem;
}

.message.user .message-content {
  background: var(--primary-gradient);
  color: white;
}

.input-container {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  background-color: var(--gray-100);
  border-radius: var(--border-radius);
  padding: 0.75rem;
  border: 1px solid var(--gray-200);
}

.input-container textarea {
  flex: 1;
  min-height: 3rem;
  max-height: 8rem;
  border-radius: var(--border-radius);
  padding: 0.875rem 1rem;
  background-color: white;
  box-shadow: none;
  border: 1px solid var(--gray-200);
}

#send-button {
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: 50%;
  width: 3.25rem;
  height: 3.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

#send-button:hover {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(109, 93, 252, 0.4);
}

#send-button svg {
  width: 1.5rem;
  height: 1.5rem;
  stroke: white;
}

footer {
  margin-top: 2rem;
  text-align: center;
  color: var(--gray-500);
  font-size: 0.9rem;
}

/* Responsive design - UPDATED FOR BETTER MOBILE COMPATIBILITY */
@media (max-width: 1200px) {
  .header-content {
    flex-direction: column;
  }
  
  .logo-section {
    max-width: 100%;
    margin-bottom: 1.5rem;
  }
  
  .header-cta {
    align-items: flex-start;
    width: 100%;
  }
  
  .stats {
    width: 100%;
  }
}

@media (max-width: 1024px) {
  .demo-section {
    flex-direction: column;
    height: auto;
    gap: 20px;
  }
  
  .chat-interface {
    height: 450px;
  }
  
  .knowledge-base {
    width: 100%;
    height: 350px;
  }
}

/* Enhanced mobile styles */
@media (max-width: 767px) {
  .container {
    padding: 1.25rem;
  }
  
  .header-content {
    padding-left: 100px; /* Restore the left padding as requested */
  }
  
  .language-toggle {
    position: relative;
    top: 0;
    left: 0;
    margin-bottom: 1.5rem;
  }
  
  /* Remove logo on mobile devices */
  .logo {
    display: none; /* Hide the logo on mobile */
  }
  
  .logo-container {
    justify-content: flex-start;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.2rem;
  }
  
  .stats {
    flex-direction: row;
    justify-content: space-around;
    flex-wrap: wrap;
    padding: 0.75rem;
  }
  
  .stat-item {
    flex-basis: 45%;
    margin-bottom: 0.5rem;
  }
  
  .card {
    padding: 1.25rem;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 1rem;
  }
  
  .header-content {
    padding-left: 20px; /* Reduce but don't eliminate the padding on very small screens */
  }
  
  h1 {
    font-size: 1.75rem;
  }
  
  .card {
    padding: 1rem;
  }
  .logo {
    display: none; /* Hide the logo on mobile */
  }
  
  .logo-container {
    justify-content: flex-start;
  }
  .stats {
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
  }

  .stat-item {
    flex-basis: 100%;
    width: 100%;
  }
  
  .message-content {
    max-width: 90%;
  }
  
  /* Fix for input container on smaller screens */
  .input-container {
    padding: 0.5rem;
  }
  
  #send-button {
    width: 2.75rem;
    height: 2.75rem;
  }
}

/* For scroll in chat */
.chat-container::-webkit-scrollbar {
  width: 6px;
}

.chat-container::-webkit-scrollbar-track {
  background: transparent;
}

.chat-container::-webkit-scrollbar-thumb {
  background-color: var(--gray-300);
  border-radius: 20px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
  background-color: var(--gray-400);
}

/* Error state for character limit */
.error {
  color: var(--error-color);
}

textarea.error {
  border-color: var(--error-color);
}

/* Typing indicator animation */
.typing-indicator .message-content {
  display: flex;
  align-items: center;
  min-width: 60px;
  padding: 0.75rem 1.25rem;
}

.typing-indicator .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--gray-400);
  margin-right: 5px;
  animation: bounce 1.4s infinite ease-in-out;
  opacity: 0.6;
}

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

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

.temp-message {
  transition: opacity 0.3s ease, transform 0.3s ease;
  margin-bottom: 1rem;
}
