:root {
  --primary-color: #012970;
  --primary-hover: #011a50;
  --primary-light: rgba(1, 41, 112, 0.1);
  --text-color: #2c3e50;
  --text-secondary: #5f6368;
  --background: #ffffff;
  --background-alt: #f5f7fa;
  --border-color: #e1e5eb;
  --shadow: 0 4px 12px rgba(1, 41, 112, 0.1);
  --shadow-hover: 0 6px 16px rgba(1, 41, 112, 0.15);
  --radius: 16px;
  --spacing: 16px;
  --success-color: #28a745;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Floating Button */
.chat-launch-btn {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 150px;
  height: 80px;
  background:transparent !important;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: pointer;
  padding: 5px 10px 5px 5px;
  overflow: hidden;
  box-shadow: 0 0 0 white;
}

.chat-launch-btn:focus {
  outline: none;
}

.chat-launch-btn .chat-icon {
  font-size: 28px;
  transition: transform 0.3s ease;
}

.chat-launch-btn:hover .chat-icon {
  transform: scale(1.1);
}

/* Chat Container */
.chat-container {
  position: fixed;
  bottom: 110px;
  right: 25px;
  width: 350px;
  max-width: calc(100% - 48px);
  height: 535px;
  max-height: calc(100vh - 160px);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 999998;
  opacity: 0;
  transform: translateY(20px);
  transition: var(--transition);
  pointer-events: none;
}

.chat-container[aria-hidden="false"] {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .chat-container {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 100%;
    border-radius: 0;
    bottom: 0;
    right: 0;
    border: none;
  }
  
  .chat-body {
    padding: 16px 16px 8px;
  }
  
  .user-message,
  .bot-message {
    max-width: 85%;
    min-width: 60px;
    margin-left: 0;
    margin-right: 0;
  }
  
  .user-message {
    margin-left: auto;
    margin-right: 0;
  }
  
  .bot-message {
    margin-right: 0;
    margin-left: 0;
  }
  
  .chat-footer {
    padding: 12px 16px 16px;
  }
  
  .chat-launch-btn {
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
  }
}
/* 
/* Responsive */
@media screen and (max-width: 480px) {
  .chat-container {
    width: 100%;
    height: 100%;
  }
} 

/* Header */
.chat-header {
  background: var(--primary-color);
  padding: 16px 24px;
  position: relative;
  z-index: 10000;
  color: white !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.chat-header-content {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  justify-content: space-between;
}

.chat-logo{
  background-color: white;
  border-radius: 50%;
  height: 48px;
  width: 48px;
}
.chat-avatar {
  width: 48px;
  height: 48px;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-title {
  font-size: 16px;
  font-weight: 600;
  color: white !important;
  font-size: 20px !important;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.5px;
}

.chat-status {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-status::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success-color);
  margin-right: 6px;
}

.close-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  width: 32px;
  height: 32px;
  margin-left: 8px;
}

.close-btn:hover {
  background-color: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.close-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5px;
}

/* Chat Body */
.chat-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--background);
  padding: 0;
}


/* Custom scrollbar for chat body */
.chat-body::-webkit-scrollbar {
  width: 6px;
}

.chat-body::-webkit-scrollbar-track {
  background: transparent;
  margin: 10px 0;
}

.chat-body::-webkit-scrollbar-thumb {
  background-color: rgba(1, 41, 112, 0.2);
  border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
  background-color: rgba(1, 41, 112, 0.3);
}

/* Messages container */
.chat-messages {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px 8px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
  will-change: transform;
  backface-visibility: hidden;
  transform: translateZ(0);
  box-sizing: border-box;
}

/* Welcome message */
.welcome-message {
  background: white;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  max-width: 90%;
  align-self: center;
  text-align: center;
}

.welcome-message .message-content p {
  margin: 8px 0;
  line-height: 1.5;
  color: var(--text-color);
}

.welcome-message .message-content p:first-child {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 12px;
}

.welcome-message .message-time {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-secondary);
  text-align: right;
}

/* Better scrollbar */
.chat-body::-webkit-scrollbar {
  width: 6px;
}

.chat-body::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.chat-body::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* Message Bubbles */
.message {
  max-width: 85%;
  font-size: 14px;
  line-height: 1.5;
  border-radius: 18px;
  word-wrap: break-word;
  margin-bottom: 16px;
  position: relative;
  clear: both;
  opacity: 0;
  transform: translateY(10px);
  animation: messageAppear 0.3s ease-out forwards;
  animation-delay: 0.1s;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

@keyframes messageAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* User messages (on the right) */
.user-message {
  float: right;
  background: var(--primary-color);
  color: white;
  border: 1px solid var(--border-color);
  border-top-left-radius: 18px;
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  border-bottom-left-radius: 18px;
  margin: 0 0 16px 15%;
  padding: 10px 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  max-width: 85%;
  min-width: 80px;
  width: fit-content;
  position: relative;
  transition: var(--transition);
  line-height: 1.5;
  word-wrap: break-word;
  align-self: flex-end;
}

.user-message:last-child {
  margin-bottom: 8px;
}

.user-message .message-content {
  color: white;
}

.user-message .message-time {
  color: rgba(255, 255, 255, 0.7);
  text-align: right;
}

/* Bot messages (on the left) */
.bot-message {
  float: left;
  background: white;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  border-top-left-radius: 6px;
  border-top-right-radius: 18px;
  border-bottom-right-radius: 18px;
  border-bottom-left-radius: 6px;
  margin: 0 15% 16px 0;
  padding: 10px 16px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  max-width: 85%;
  min-width: 80px;
  width: fit-content;
  position: relative;
  transition: var(--transition);
  line-height: 1.5;
  word-wrap: break-word;
  align-self: flex-start;
}

.bot-message:last-child {
  margin-bottom: 8px;
}

.bot-message .message-content {
  color: var(--text-color);
}

.bot-message .message-time {
  color: var(--text-secondary);
  text-align: left;
}

/* Message content and time */
.message-content {
  margin: 0;
  word-break: break-word;
  line-height: 1.5;
}

.message-content p {
  margin: 0.5em 0;
}

.message-content p:first-child {
  margin-top: 0;
}

.message-content p:last-child {
  margin-bottom: 0;
}

.message-time {
  font-size: 11px;
  margin-top: 6px;
  opacity: 0.8;
  font-weight: 400;
  display: flex;
  align-items: center;
}

.user-message .message-time {
  justify-content: flex-end;
  color: rgba(255, 255, 255, 0.8);
}

.bot-message .message-time {
  justify-content: flex-start;
  color: var(--text-secondary);
}

/* Footer / Input */
.chat-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  background: white;
  flex-shrink: 0;
  position: relative;
  z-index: 50000;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.05);
  min-height: 72px;
  display: flex;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.chat-form {
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
}

.input-group {
  display: flex;
  align-items: center;
  background: white;
  border-radius: 50px;
  transition: var(--transition);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  width: 100%;
  height: 50px;
  max-width: 100%;
  padding: 0 16px 0 20px;
  box-sizing: border-box;
}
.input-group:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.input-group:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(1, 41, 112, 0.2);
}

.input-wrapper {
  flex: 1;
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}

.chat-input {
  flex: 1;
  background: transparent;
  border: none !important;
  font-size: 14px;
  padding: 0;
  outline: none;
  resize: none;
  overflow-y: auto;
  min-height: 20px;
  max-height: 120px;
  line-height: 1.4;
  color: var(--text-color);
  font-family: inherit;
  margin: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(1, 41, 112, 0.2) transparent;
  box-shadow: 0 0 0 white !important;
  transition: var(--transition);
  width: 100%;
  min-width: 0;
  align-self: center;
  box-shadow: none;
  height: 100%; 
}

/* Custom scrollbar for textarea */
.chat-input::-webkit-scrollbar {
  width: 4px;
}

.chat-input::-webkit-scrollbar-track {
  background: transparent;
  margin: 4px 0;
}

.chat-input::-webkit-scrollbar-thumb {
  background-color: rgba(1, 41, 112, 0.2);
  border-radius: 2px;
}
.chat-input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}


.send-btn {
  background: var(--primary-color);
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  margin: 0 0 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 2px 6px rgba(1, 41, 112, 0.2);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  padding: 8px;
  flex: 0 0 36px;
}

.send-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.send-btn:hover::after {
  opacity: 1;
}

.send-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(1, 41, 112, 0.25);
}

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

.send-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.5px;
}

/* Typing Indicator */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  background: white;
  padding: 10px 16px;
  border-radius: 18px;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  max-width: 85%;
  margin-bottom: 16px;
}

.typing-dots {
  display: flex;
  gap: 4px;
  margin-right: 8px;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background: var(--text-secondary);
  border-radius: 50%;
  opacity: 0.4;
  animation: bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
  0%, 80%, 100% { 
    transform: translateY(0);
    opacity: 0.4;
  }
  40% { 
    transform: translateY(-6px);
    opacity: 0.8;
  }
}

/* Animations */
@keyframes slideInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Message animations */
.message {
  animation: slideInUp 0.3s ease-out forwards;
  opacity: 0;
  transform: translateY(10px);
}

/* Typing indicator */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  background: white;
  padding: 12px 18px;
  border-radius: 24px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  margin-bottom: 16px;
  animation: fadeIn 0.3s ease-out;
}

.typing-dot {
  width: 8px;
  height: 8px;
  background-color: var(--primary-color);
  border-radius: 50%;
  margin: 0 2px;
  animation: typingAnimation 1.4s infinite ease-in-out;
}

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

@keyframes typingAnimation {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.6; }
  30% { transform: translateY(-4px); opacity: 1; }
}





/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Screen Reader Only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 768px) {
  .chat-launch-btn {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 120px;        /* smaller but same proportion */
  }
}

/* Mobile */
@media (max-width: 480px) {
  .chat-launch-btn {
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    right: 10px;
    width: 130px;        /* smallest size */
  }
}