/* Chat Widget Styles */

.chat-launcher {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3A529B 0%, #2c3e7a 100%);
  color: white;
  border: none;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(58, 82, 155, 0.5);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-launcher:hover {
  transform: scale(1.12);
  box-shadow: 0 8px 24px rgba(58, 82, 155, 0.7);
}

.chat-launcher:active {
  transform: scale(0.92);
}

/* Chat Widget Container */
#chatWidget {
  position: fixed;
  bottom: 100px;
  right: 20px;
  width: 300px;
  /* height: 640px; */
  background: white;
  border-radius: 16px;
  box-shadow: 0 5px 50px rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  font-family: 'Open Sans', serif;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
      /* width: min-content; */
}

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

.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, #3A529B 0%, #2c3e7a 100%);
  color: white;
  padding: 18px 20px;
  border-radius: 16px 16px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
}

.chat-user-info {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}

.chat-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.3);
  flex-shrink: 0;
}

.chat-user-details h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  font-family: 'Roboto Condensed', sans-serif;
  text-transform: none;
  letter-spacing: 0.3px;
  font-weight: 600;
    color: #fff !important;
}

.chat-status {
  font-size: 11px;
  opacity: 0.85;
  display: block;
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

.chat-close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  padding: 6px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  /* transition: all 0.2s ease; */
  flex-shrink: 0;
  font-weight: 600;
}
.chat-close-btn:focus {
  outline: none;
}
/* .chat-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
} */

/* Chat Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  /* background: linear-gradient(180deg, #f8f9fb 0%, #f5f7fa 100%); */
}

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

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

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(58, 82, 155, 0.3);
  border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: rgba(58, 82, 155, 0.5);
}

/* Chat Message */
.chat-message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  animation: fadeIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.user-message {
  justify-content: flex-end;
  margin-left: 20px;
}

.bot-message {
  justify-content: flex-start;
  margin-right: 20px;
}

.message-content {
  padding: 12px 16px;
  border-radius: 14px;
  max-width: 80%;
  word-wrap: break-word;
  line-height: 1.5;
  font-size: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.user-message .message-content {
  background: linear-gradient(135deg, #3A529B 0%, #2c3e7a 100%);
  color: white;
  border-bottom-right-radius: 4px;
  font-weight: 500;
}

.bot-message .message-content {
  background: white;
  color: #333;
  border: 1.5px solid #e8eef5;
  border-bottom-left-radius: 4px;
}

.message-content p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.message-time {
  font-size: 11px;
  color: #aaa;
  margin-bottom: 4px;
  opacity: 0;
  transition: opacity 0.3s ease;
  flex-shrink: 0;
  white-space: nowrap;
}

.chat-message:hover .message-time {
  opacity: 1;
}

/* Quick Reply Buttons */
.quick-replies {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.quick-reply-btn {
  background: linear-gradient(135deg, #f5f7fa 0%, #eef2f8 100%);
  border: 1.5px solid #d8dfe8;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
  font-weight: 500;
  color: #3A529B;
  letter-spacing: 0.3px;
}

.quick-reply-btn:hover {
  background: linear-gradient(135deg, #3A529B 0%, #2c3e7a 100%);
  color: white;
  border-color: #3A529B;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(58, 82, 155, 0.3);
}

.quick-reply-btn:active {
  transform: translateY(0);
}

/* Typing Indicator */
.typing-indicator {
  align-self: flex-start;
}

.typing-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #999;
  border-radius: 50%;
  margin: 0 2px;
  animation: typing 1.4s infinite;
}

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

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

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

/* Chat Footer */
.chat-footer {
  padding: 14px 16px;
  border-top: 1.5px solid #e8eef5;
  background: white;
  border-radius: 0 0 16px 16px;
  flex-shrink: 0;
 
}

.chat-input-wrapper {
  display: flex;
  gap: 44px;
  align-items: center;
}

.chat-input {
  flex: 1;
  border: 1.5px solid #d8dfe8;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: 'Open Sans', serif;
  outline: none;
  transition: all 0.2s ease;
  background: white;
  color: #333;
}

.chat-input::placeholder {
  color: #aaa;
}

.chat-input:focus {
  border-color: #3A529B;
  box-shadow: 0 0 0 3px rgba(58, 82, 155, 0.1);
  background: #fafbfc;
}

.chat-input:disabled {
  background: #f5f7fa;
  cursor: not-allowed;
  color: #aaa;
}

.chat-send-btn {
  background: linear-gradient(135deg, #3A529B 0%, #2c3e7a 100%);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(58, 82, 155, 0.3);
  flex-shrink: 0;
}

.chat-send-btn:hover:not(:disabled) {
  transform: scale(1.06);
  box-shadow: 0 4px 12px rgba(58, 82, 155, 0.4);
}

.chat-send-btn:active:not(:disabled) {
  transform: scale(0.94);
}

.chat-send-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Chat Status Message */
.chat-status-message {
  font-size: 12px;
  color: #3A529B;
  margin-top: 8px;
  min-height: 18px;
  display: none;
  animation: slideDown 0.3s ease;
  font-weight: 500;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Mobile Responsive */
@media (max-width: 600px) {
  #chatWidget {
    width: calc(100% - 20px);
    height: 70vh;
    bottom: 80px;
    right: 10px;
    left: 10px;
    max-height: 500px;
    border-radius: 14px;
  }

  .chat-launcher {
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    font-size: 26px;
  }

  .message-content {
    max-width: 85%;
  }

  .chat-header {
    padding: 14px 16px;
  }

  .chat-avatar {
    width: 40px;
    height: 40px;
  }

  .chat-user-details h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff !important;
  }

  .chat-messages {
    padding: 16px 12px;
    gap: 12px;
  }

  .chat-footer {
    padding: 12px 14px;
  }

  .chat-input {
    padding: 11px 12px;
    font-size: 13px;
  }

  .chat-send-btn {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 480px) {
  #chatWidget {
    width: 100%;
    height: 100vh;
    bottom: 0;
    right: 0;
    left: 0;
    border-radius: 0;
    max-height: 100vh;
  }

  .chat-launcher {
    bottom: 15px;
    right: 15px;
    width: 52px;
    height: 52px;
    font-size: 24px;
  }

  .message-content {
    max-width: 90%;
    font-size: 13px;
  }

  .chat-header {
    padding: 12px 14px;
    border-radius: 0;
  }

  .chat-avatar {
    width: 38px;
    height: 38px;
  }

  .chat-user-details h3 {
    font-size: 16px;
    font-weight: 600;
    color: #fff !important;
  }

  .chat-status {
    font-size: 10px;
  }

  .chat-messages {
    padding: 14px 10px;
  }

  .user-message {
    margin-left: 12px;
  }

  .bot-message {
    margin-right: 12px;
  }

  .quick-reply-btn {
    padding: 9px 12px;
    font-size: 12px;
  }
}

@media (max-height: 500px) {
  #chatWidget {
    height: 100vh;
  }

  .chat-messages {
    padding: 12px 10px;
    gap: 10px;
  }

  .message-content {
    padding: 10px 14px;
    font-size: 13px;
  }
}
