/* Import nplan design system fonts */
@import url("https://fonts.googleapis.com/css2?family=Public+Sans:wght@300;400;500;600&display=swap");

/* nplan Design System Variables */
:root {
  /* Colors */
  --color-primary: #172b38;
  --color-secondary: #3d85d0;
  --color-secondary-300: #cee0f3;
  --color-white: #fff;
  --color-black: #000;
  
  /* Greys */
  --color-grey-700: #33404b;
  --color-grey-600: #687987;
  --color-grey-500: #8e9ba5;
  --color-grey-400: #b4bcc3;
  --color-grey-300: #d9dee1;
  --color-grey-200: #f0f2f3;
  --color-grey-100: #f8f8f9;
  
  /* Blues */
  --color-blue-700: #356482;
  --color-blue-600: #417a9f;
  --color-blue-500: #709bb7;
  --color-blue-400: #a0bdcf;
  --color-blue-300: #cfdee7;
  --color-blue-200: #ecf2f5;
  --color-blue-100: #f6f8fa;
  
  /* Typography */
  --font-sans: "Public Sans", sans-serif;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  
  /* Shadows */
  --shadow-custom-md: 0px 4px 8px -2px rgba(9, 30, 66, 0.1), 0px 0px 0px 1px rgba(9, 30, 66, 0.08);
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  
  /* Call Button State Colors */
  --call-button-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --call-button-calling-bg: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --call-button-connected-bg: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  --call-button-hover-bg: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  --call-button-calling-hover-bg: linear-gradient(135deg, #f5576c 0%, #f093fb 100%);
  --call-button-connected-hover-bg: linear-gradient(135deg, #ee5a24 0%, #ff6b6b 100%);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-blue-700) 50%, var(--color-secondary) 100%);
  color: var(--color-primary);
  font-weight: var(--font-weight-regular);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Animated background particles */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(61, 133, 208, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(23, 43, 56, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(112, 155, 183, 0.1) 0%, transparent 50%);
  animation: float 20s ease-in-out infinite;
  z-index: -1;
}

@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(1deg); }
  66% { transform: translateY(20px) rotate(-1deg); }
}

.chat-container {
  width: 100%;
  height: 100vh;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 0;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.chat-header {
  background: rgba(23, 43, 56, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--color-white);
  padding: 25px 30px;
  border-bottom: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}

.chat-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(61, 133, 208, 0.1), transparent);
  animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.header-top {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  position: relative;
  z-index: 1;
}

.logo-container {
  display: flex;
  align-items: center;
  animation: logoFloat 3s ease-in-out infinite;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
}

.logo-container svg {
  color: var(--color-white);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.chat-header h1 {
  margin: 0;
  font-size: 1.5rem;
  line-height: 2rem;
  font-weight: var(--font-weight-medium);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.8s ease-out;
}

.chat-header p {
  margin: 12px 0 0 0;
  font-size: 0.95rem;
  line-height: 1.2rem;
  color: var(--color-grey-300);
  position: relative;
  z-index: 1;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* Voice Call Section - Integrated into header */
.voice-call-section {
  position: absolute;
  top: 25px;
  right: 30px;
  z-index: 10;
  animation: fadeInUp 0.8s ease-out 0.4s both;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  /* Ensure it doesn't overlap with header content */
  min-width: 140px;
}

/* Mobile viewport handling - proper safe area support */
@media (max-width: 1024px) {
  /* Use dynamic viewport height for mobile */
  html {
    height: 100vh;
    height: -webkit-fill-available;
  }
  
  body {
    height: 100vh;
    height: -webkit-fill-available;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
  
  .chat-container {
    height: 100vh;
    height: -webkit-fill-available;
    height: calc(var(--vh, 1vh) * 100);
    margin: 0;
    padding-top: 0;
  }
  
  .chat-header {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(23, 43, 56, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    padding: max(20px, env(safe-area-inset-top, 20px)) 20px 15px 20px;
    margin: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    /* Ensure header is above browser UI */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
  }
  
  .voice-call-section {
    position: absolute;
    top: 25px;
    right: 30px;
    z-index: 1001;
    /* Ensure voice call button is above browser UI */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    /* Force positioning relative to header */
    margin: 0;
    padding: 0;
  }
  
  /* Force hardware acceleration for mobile */
  .chat-header,
  .voice-call-section {
    -webkit-backface-visibility: hidden;
    -webkit-perspective: 1000;
  }
  
  /* Ensure voice call button positioning is not affected by header padding */
  .voice-call-section {
    top: 25px !important;
    right: 30px !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

/* iOS Safari specific safe area handling */
@supports (padding: max(0px)) {
  .chat-header {
    padding-top: max(20px, env(safe-area-inset-top) + 10px);
  }
}

/* Additional mobile browser UI handling */
@media (max-width: 1024px) {
  /* Use CSS Grid for better mobile layout control */
  .chat-container {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    min-height: -webkit-fill-available;
    min-height: calc(var(--vh, 1vh) * 100);
  }
  
  /* Ensure header stays at top even with browser UI changes */
  .chat-header {
    grid-row: 1;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(23, 43, 56, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    /* Add top padding to account for browser UI */
    padding-top: max(20px, env(safe-area-inset-top, 20px), var(--safe-top, 20px));
  }
  
  /* Keep voice call button in original position */
  .voice-call-section {
    position: absolute;
    top: 25px;
    right: 30px;
    z-index: 1001;
    /* Override any conflicting positioning */
    margin-top: 0 !important;
    padding-top: 0 !important;
  }
  
  /* Messages area takes remaining space */
  .messages {
    grid-row: 2;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  /* Form stays at bottom */
  .chat-form {
    grid-row: 3;
    position: sticky;
    bottom: 0;
    z-index: 1000;
  }
}

.voice-call-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--call-button-bg);
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s ease;
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}

.voice-call-button:hover {
  background: var(--call-button-hover-bg);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.voice-call-button:active {
  transform: translateY(0);
}

/* State-based styling */
.voice-call-button.calling {
  background: var(--call-button-calling-bg);
  animation: pulse 2s infinite;
}

.voice-call-button.calling:hover {
  background: var(--call-button-calling-hover-bg);
}

.voice-call-button.connected {
  background: var(--call-button-connected-bg);
  animation: none;
}

.voice-call-button.connected:hover {
  background: var(--call-button-connected-hover-bg);
}

/* Pulse animation for calling state */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(240, 147, 251, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(240, 147, 251, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(240, 147, 251, 0);
  }
}

/* Show Suggestions Button */
.show-suggestions-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: linear-gradient(135deg, #28a745, #20c997);
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: var(--font-weight-medium);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  overflow: hidden;
  margin-left: 0;
  box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
}

.show-suggestions-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.show-suggestions-button:hover::before {
  left: 100%;
}

.show-suggestions-button:hover {
  background: linear-gradient(135deg, #20c997, #28a745);
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(40, 167, 69, 0.4);
}

.show-suggestions-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.show-suggestions-button:disabled {
  background: var(--color-gray-400);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.suggestions-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  animation: suggestionsIconPulse 2s ease-in-out infinite;
}

@keyframes suggestionsIconPulse {
  0%, 100% { 
    transform: scale(1);
  }
  50% { 
    transform: scale(1.1);
  }
}

.suggestions-text {
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

/* Suggestions button state when suggestions are available */
.show-suggestions-button.has-suggestions {
  background: linear-gradient(135deg, #ff6b6b, #ee5a24);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
  animation: suggestionsAvailable 2s ease-in-out infinite;
}

.show-suggestions-button.has-suggestions:hover {
  background: linear-gradient(135deg, #ee5a24, #ff6b6b);
  box-shadow: 0 12px 35px rgba(255, 107, 107, 0.5);
}

@keyframes suggestionsAvailable {
  0%, 100% { 
    box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
  }
  50% { 
    box-shadow: 0 12px 35px rgba(255, 107, 107, 0.6);
  }
}

/* Clear Chat Button */
.clear-chat-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  background: var(--color-red-500);
  color: white;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-weight: var(--font-weight-medium);
  font-size: 0.95rem;
  font-family: var(--font-sans);
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  overflow: hidden;
  margin-left: 0;
  box-shadow: 0 8px 25px rgba(220, 53, 69, 0.3);
}

.clear-chat-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.clear-chat-button:hover::before {
  left: 100%;
}

.clear-chat-button:hover {
  background: var(--color-red-600);
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(220, 53, 69, 0.4);
}

.clear-chat-button:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.clear-chat-button:disabled {
  background: var(--color-gray-400);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Phone link styling */
.phone-link-container {
  text-align: center;
}

.phone-link {
  color: var(--color-blue-600);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.3s ease;
  opacity: 0.8;
  position: relative;
}

/* Show desktop version by default, hide mobile version */
.phone-link-mobile {
  display: none;
}

.phone-link-desktop {
  display: inline;
}

.phone-link:hover {
  color: var(--color-blue-700);
  opacity: 1;
  transform: translateY(-1px);
}

.phone-link:active {
  transform: translateY(0);
}

/* Add a subtle underline on hover */
.phone-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 1px;
  bottom: -2px;
  left: 50%;
  background: var(--color-blue-600);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.phone-link:hover::after {
  width: 100%;
}

.call-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  animation: callIconPulse 2s ease-in-out infinite;
}

@keyframes callIconPulse {
  0%, 100% { 
    transform: scale(1);
  }
  50% { 
    transform: scale(1.1);
  }
}

.call-text {
  font-weight: var(--font-weight-medium);
  white-space: nowrap;
}

/* Call button states */
.voice-call-button.calling {
  background: linear-gradient(135deg, #dc3545, #c82333);
  animation: callingPulse 1s ease-in-out infinite;
}

@keyframes callingPulse {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 8px 25px rgba(220, 53, 69, 0.3);
  }
  50% { 
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(220, 53, 69, 0.4);
  }
}

.voice-call-button.connected {
  background: linear-gradient(135deg, #28a745, #20c997);
  animation: connectedGlow 2s ease-in-out infinite;
}

@keyframes connectedGlow {
  0%, 100% { 
    box-shadow: 0 8px 25px rgba(40, 167, 69, 0.3);
  }
  50% { 
    box-shadow: 0 12px 35px rgba(40, 167, 69, 0.5);
  }
}

/* Hidden Convai Widget Container */
#convai-widget {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: none;
}

#convai-widget:not([style*="display: none"]) {
  display: flex !important;
  align-items: center;
  justify-content: center;
}

/* Force visibility when not hidden */
#convai-widget[style*="display: block"],
#convai-widget[style*="display: flex"] {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
}

/* Ensure Convai widget elements don't interfere when hidden */
#convai-widget[style*="display: none"] elevenlabs-convai,
#convai-widget[style*="display: none"] .overlay,
#convai-widget[style*="display: none"] .rounded-compact-sheet {
  display: none !important;
}

/* Style the widget when visible */
#convai-widget:not([style*="display: none"]) elevenlabs-convai {
  width: 100%;
  height: 100%;
  max-width: 600px;
  max-height: 500px;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Force the widget element to be visible */
#convai-widget:not([style*="display: none"]) elevenlabs-convai {
  position: relative !important;
  z-index: 10000 !important;
}

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

.messages {
  flex: 1;
  padding: 30px;
  overflow-y: auto;
  background: transparent;
  position: relative;
}

/* Custom scrollbar */
.messages::-webkit-scrollbar {
  width: 8px;
}

.messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.messages::-webkit-scrollbar-thumb {
  background: rgba(61, 133, 208, 0.3);
  border-radius: 4px;
  transition: background 0.3s ease;
}

.messages::-webkit-scrollbar-thumb:hover {
  background: rgba(61, 133, 208, 0.5);
}

.message {
  margin-bottom: 20px;
  max-width: 80%;
  animation: messageSlideIn 0.5s ease-out;
  transform-origin: bottom;
  transition: all 0.3s ease;
}

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

@keyframes welcomeMessageSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.message.user {
  margin-left: auto;
  text-align: right;
}

.message.bot {
  margin-right: auto;
}

.message-content {
  display: inline-block;
  padding: 16px 20px;
  border-radius: 20px;
  font-size: 0.95rem;
  line-height: 1.4rem;
  word-wrap: break-word;
  position: relative;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.message.user .message-content {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-blue-600));
  color: var(--color-white);
  border-bottom-right-radius: 8px;
  box-shadow: 0 8px 25px rgba(61, 133, 208, 0.3);
  transform: translateZ(0);
}

.message.user .message-content:hover {
  transform: translateZ(0) translateY(-2px);
  box-shadow: 0 12px 35px rgba(61, 133, 208, 0.4);
}

.message.bot .message-content {
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-primary);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 8px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.message.bot .message-content:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.95);
}

/* Typing indicator styles */
.typing-indicator .message-content {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--glass-border);
  animation: typingPulse 2s ease-in-out infinite;
}

/* Welcome message special styling */
.message.bot.welcome-message .message-content {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(240, 242, 243, 0.95));
  border: 2px solid var(--color-secondary);
  box-shadow: 0 12px 40px rgba(61, 133, 208, 0.3);
  position: relative;
  overflow: hidden;
}

.message.bot.welcome-message .message-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-secondary), var(--color-blue-600), var(--color-secondary));
  animation: welcomeShimmer 3s ease-in-out infinite;
}

@keyframes welcomeShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

@keyframes typingPulse {
  0%, 100% { 
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1);
  }
  50% { 
    background: rgba(255, 255, 255, 0.9);
    transform: scale(1.02);
  }
}

/* Markdown content styling */
.message-content h1,
.message-content h2,
.message-content h3 {
  margin: 0.5em 0 0.3em 0;
  color: var(--color-primary);
  font-weight: 600;
  line-height: 1.3;
}

.message-content h1 {
  font-size: 1.4em;
  border-bottom: 2px solid var(--glass-border);
  padding-bottom: 0.2em;
}

.message-content h2 {
  font-size: 1.2em;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 0.1em;
}

.message-content h3 {
  font-size: 1.1em;
}

.message-content strong {
  font-weight: 700;
  color: var(--color-primary);
}

.message-content em {
  font-style: italic;
  color: var(--color-primary);
  opacity: 0.9;
}

.message-content code {
  background: rgba(61, 133, 208, 0.1);
  color: var(--color-secondary);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.9em;
  border: 1px solid rgba(61, 133, 208, 0.2);
}

.message-content pre {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 1em;
  margin: 0.5em 0;
  overflow-x: auto;
}

.message-content pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: var(--color-primary);
}

.message-content ul,
.message-content ol {
  margin: 0.5em 0;
  padding-left: 1.5em;
}

.message-content li {
  margin: 0.3em 0;
  line-height: 1.4;
}

.message-content a {
  color: var(--color-secondary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s ease;
}

.message-content a:hover {
  border-bottom-color: var(--color-secondary);
}

.message-content blockquote {
  border-left: 4px solid var(--color-secondary);
  margin: 0.5em 0;
  padding-left: 1em;
  color: var(--color-grey-600);
  font-style: italic;
}

.chat-form {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 25px 30px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.chat-form::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  animation: formShimmer 4s ease-in-out infinite;
}

@keyframes formShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.chat-form input {
  flex: 1;
  padding: 16px 20px;
  border: 2px solid var(--glass-border);
  border-radius: 25px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-primary);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  z-index: 1;
}

.chat-form input::placeholder {
  color: var(--color-grey-600);
  opacity: 0.8;
}

.chat-form input:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 4px rgba(61, 133, 208, 0.2);
  background: rgba(255, 255, 255, 1);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.chat-form input:disabled {
  background-color: rgba(248, 248, 249, 0.8);
  color: var(--color-grey-600);
  cursor: not-allowed;
  transform: none;
}

.chat-form button {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-blue-600));
  color: var(--color-white);
  border: none;
  padding: 16px 24px;
  margin-left: 0;
  border-radius: 25px;
  font-size: 0.95rem;
  font-weight: var(--font-weight-medium);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(61, 133, 208, 0.3);
}

.chat-form button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.chat-form button:hover::before {
  left: 100%;
}

.chat-form button:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--color-blue-600), var(--color-blue-700));
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(61, 133, 208, 0.4);
}

.chat-form button:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 4px 15px rgba(61, 133, 208, 0.3);
}

.chat-form button:disabled {
  background: var(--color-grey-400);
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.loading {
  font-style: italic;
  color: var(--color-grey-600);
  display: flex;
  align-items: center;
  gap: 8px;
}

.loading::after {
  content: '';
  width: 20px;
  height: 20px;
  border: 2px solid var(--color-grey-300);
  border-top: 2px solid var(--color-secondary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Enhanced message animations */
.message {
  position: relative;
}

.message::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.message:hover::before {
  opacity: 1;
}

/* Floating particles animation */
@keyframes particleFloat {
  0%, 100% {
    transform: translateY(0px) translateX(0px) rotate(0deg);
    opacity: 0.7;
  }
  25% {
    transform: translateY(-20px) translateX(10px) rotate(90deg);
    opacity: 1;
  }
  50% {
    transform: translateY(-40px) translateX(-5px) rotate(180deg);
    opacity: 0.5;
  }
  75% {
    transform: translateY(-20px) translateX(-15px) rotate(270deg);
    opacity: 0.8;
  }
}

/* Success and error states */
.chat-form.success {
  border-color: rgba(61, 133, 208, 0.5);
  animation: successPulse 0.6s ease;
}

.chat-form.error {
  border-color: rgba(220, 53, 69, 0.5);
  animation: errorPulse 0.6s ease;
}

@keyframes successPulse {
  0%, 100% { border-color: rgba(61, 133, 208, 0.5); }
  50% { border-color: rgba(61, 133, 208, 0.8); }
}

@keyframes errorPulse {
  0%, 100% { border-color: rgba(220, 53, 69, 0.5); }
  50% { border-color: rgba(220, 53, 69, 0.8); }
}

/* Responsive design for tablets and smaller screens */
@media (max-width: 1024px) {
  .voice-call-section {
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 120px;
  }
  
  .phone-link-container {
    margin: 0;
    text-align: right;
  }
  
  .phone-link {
    font-size: 13px;
    white-space: nowrap;
  }
  
  /* Show mobile version, hide desktop version */
  .phone-link-mobile {
    display: inline;
  }
  
  .phone-link-desktop {
    display: none;
  }
  
  /* Ensure header content doesn't overlap */
  .header-top h1 {
    font-size: 1.3rem;
    line-height: 1.6rem;
  }
  
  .chat-header p {
    font-size: 0.9rem;
    line-height: 1.1rem;
  }
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .chat-container {
    height: 100vh;
    max-width: none;
    border-radius: 0;
  }
  
  .chat-header {
    padding: 20px 25px;
  }
  
  .voice-call-section {
    top: 20px;
    right: 25px;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 110px;
  }
  
  .voice-call-button {
    padding: 10px 16px;
    font-size: 0.85rem;
  }
  
  .call-text {
    display: none; /* Hide text on mobile, show only icon */
  }
  
  .phone-link-container {
    margin: 0;
    text-align: right;
  }
  
  .phone-link {
    font-size: 12px;
    white-space: nowrap;
  }
  
  /* Ensure mobile phone link is visible */
  .phone-link-mobile {
    display: inline;
  }
  
  .phone-link-desktop {
    display: none;
  }
  
  .messages {
    padding: 25px;
  }
  
  .chat-form {
    padding: 20px 25px;
    gap: 8px;
  }
  
  .message {
    max-width: 90%;
  }
  
  .message-content {
    padding: 14px 18px;
    font-size: 0.9rem;
  }
  
  .chat-form input,
  .chat-form button {
    padding: 14px 20px;
    font-size: 0.9rem;
  }
  
  .clear-chat-button {
    padding: 14px 16px;
    font-size: 0.9rem;
    margin-left: 0;
  }
  
  .show-suggestions-button .suggestions-text {
    display: none;
  }
  
  .show-suggestions-button .suggestions-icon {
    margin: 0;
  }
  
  .clear-chat-button .clear-text {
    display: none;
  }
  
  .clear-chat-button .clear-icon {
    margin: 0;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, #0f1a22 0%, #1a2d3a 50%, #2a4a5a 100%);
  }
  
  .chat-container {
    background: rgba(0, 0, 0, 0.1);
  }
  
  .chat-header {
    background: rgba(23, 43, 56, 0.9);
  }
  
  .message.bot .message-content {
    background: rgba(23, 43, 56, 0.9);
    color: var(--color-white);
  }
  
  .chat-form {
    background: rgba(0, 0, 0, 0.1);
  }
  
  .chat-form input {
    background: rgba(23, 43, 56, 0.9);
    color: var(--color-white);
  }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .message-content {
    border-width: 2px;
  }
  
  .chat-form input {
    border-width: 3px;
  }
  
  .chat-form button {
    border: 2px solid var(--color-white);
  }
  
  .voice-call-button {
    border-width: 3px;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  body::before {
    animation: none;
  }
  
  .chat-header::before {
    animation: none;
  }
  
  .chat-form::before {
    animation: none;
  }
  
  .logo-container {
    animation: none;
  }
  
  .call-icon {
    animation: none;
  }
}

/* Suggestion Bubbles System */
.suggestion-bubbles {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 20px 0;
  padding: 20px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  border: 2px solid rgba(61, 133, 208, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: relative;
  overflow: hidden;
  animation: suggestionContainerSlideIn 0.6s ease-out;
  box-shadow: 0 8px 32px rgba(61, 133, 208, 0.2);
}

.suggestion-bubbles-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  width: 100%;
}

.suggestion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 8px;
}

.suggestion-title {
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
  font-size: 1rem;
  opacity: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.dismiss-suggestions {
  background: none;
  border: none;
  color: var(--color-grey-500);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.dismiss-suggestions:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--color-grey-600);
  transform: scale(1.1);
}

.dismiss-suggestions:active {
  transform: scale(0.95);
}

.suggestion-bubbles .suggestion-bubble {
  width: 100%;
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.suggestion-bubbles::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(45deg, transparent, rgba(61, 133, 208, 0.15), transparent);
  animation: suggestionShimmer 4s ease-in-out infinite;
}

@keyframes suggestionContainerSlideIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes suggestionShimmer {
  0% { transform: translateX(-100%) rotate(45deg); }
  100% { transform: translateX(100%) rotate(45deg); }
}

.suggestion-bubble {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.95));
  color: var(--color-primary);
  border: 2px solid rgba(61, 133, 208, 0.6);
  border-radius: 25px;
  padding: 16px 24px;
  font-size: 0.9rem;
  font-weight: var(--font-weight-medium);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.3;
  box-shadow: 0 4px 15px rgba(61, 133, 208, 0.2);
}

.suggestion-bubble::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.suggestion-bubble:hover::before {
  left: 100%;
}

.suggestion-bubble:hover {
  background: linear-gradient(135deg, rgba(61, 133, 208, 0.1), rgba(112, 155, 183, 0.1));
  border-color: var(--color-secondary);
  color: var(--color-secondary);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(61, 133, 208, 0.3);
}

.suggestion-bubble:active {
  transform: translateY(0) scale(1);
  box-shadow: 0 4px 15px rgba(61, 133, 208, 0.15);
}

.suggestion-bubble:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 4px rgba(61, 133, 208, 0.4), 0 8px 25px rgba(61, 133, 208, 0.3);
}

/* Responsive design for suggestion bubbles */
@media (max-width: 1024px) {
  .suggestion-bubbles {
    gap: 12px;
    padding: 16px;
    margin: 16px 0;
  }
  
  .suggestion-bubbles-container {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
  }
  
  .suggestion-bubble {
    padding: 14px 20px;
    font-size: 0.85rem;
    border-radius: 20px;
    min-height: 52px;
  }
  
  .suggestion-header {
    padding-bottom: 10px;
    margin-bottom: 6px;
  }
  
  .suggestion-title {
    font-size: 0.9rem;
  }
}

@media (max-width: 768px) {
  .suggestion-bubbles {
    gap: 10px;
    padding: 12px;
    margin: 12px 0;
  }
  
  .suggestion-bubbles-container {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  
  .suggestion-bubble {
    padding: 16px 20px;
    font-size: 0.9rem;
    border-radius: 20px;
    white-space: normal;
    text-align: center;
    width: 100%;
    max-width: none;
    min-height: 56px;
    line-height: 1.4;
  }
  
  .suggestion-bubble:hover {
    transform: translateY(-1px) scale(1.02);
  }
  
  .suggestion-header {
    padding-bottom: 8px;
    margin-bottom: 4px;
  }
  
  .suggestion-title {
    font-size: 0.85rem;
  }
  
  .dismiss-suggestions {
    width: 20px;
    height: 20px;
  }
}

/* Dark mode support for suggestion bubbles */
@media (prefers-color-scheme: dark) {
  .suggestion-bubbles {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(61, 133, 208, 0.5);
    box-shadow: 0 8px 32px rgba(61, 133, 208, 0.3);
  }
  
  .suggestion-bubble {
    background: linear-gradient(135deg, rgba(23, 43, 56, 0.9), rgba(23, 43, 56, 0.95));
    color: var(--color-white);
    border-color: rgba(61, 133, 208, 0.6);
  }
  
  .suggestion-bubble:hover {
    background: linear-gradient(135deg, rgba(61, 133, 208, 0.2), rgba(112, 155, 183, 0.2));
    color: var(--color-blue-200);
    border-color: var(--color-secondary);
  }
  
  .suggestion-title {
    color: var(--color-white);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

/* High contrast mode support for suggestion bubbles */
@media (prefers-contrast: high) {
  .suggestion-bubble {
    border-width: 3px;
    background: rgba(61, 133, 208, 0.2);
    color: var(--color-primary);
  }
  
  .suggestion-bubble:hover {
    background: rgba(61, 133, 208, 0.3);
    border-color: var(--color-secondary);
  }
}

/* Reduced motion support for suggestion bubbles */
@media (prefers-reduced-motion: reduce) {
  .suggestion-bubbles {
    animation: none;
  }
  
  .suggestion-bubbles::before {
    animation: none;
  }
  
  .suggestion-bubble {
    transition: none;
  }
  
  .suggestion-bubble:hover {
    transform: none;
  }
}
