/* Chat Widget Launcher Button */
.chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00a8ef 0%, #1a3a6b 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 168, 239, 0.4);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chat-launcher:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(0, 168, 239, 0.5);
}

.chat-launcher svg {
  width: 28px;
  height: 28px;
  fill: white;
}

.chat-launcher--open {
  transform: rotate(90deg);
}

/* Chat Window */
.chat-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  height: 500px;
  max-height: calc(100vh - 120px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  z-index: 9998;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

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

.chat-window--open {
  display: flex;
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, #00a8ef 0%, #1a3a6b 100%);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header__title {
  color: white;
  font-family: 'Ubuntu', sans-serif;
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

.chat-header__close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.chat-header__close svg {
  width: 24px;
  height: 24px;
  fill: white;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.chat-header__close:hover svg {
  opacity: 1;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Message Bubbles */
.chat-message {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

.chat-message--user {
  align-self: flex-end;
  background: #00a8ef;
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message--bot {
  align-self: flex-start;
  background: #f0f2f5;
  color: #1a1a1a;
  border-bottom-left-radius: 4px;
}

.chat-message__time {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 4px;
}

/* Chat Input */
.chat-input {
  padding: 16px 20px;
  border-top: 1px solid #e8e8e8;
  display: flex;
  gap: 12px;
}

.chat-input__field {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 24px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input__field:focus {
  border-color: #00a8ef;
}

.chat-input__send {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #00a8ef;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.chat-input__send:hover {
  background: #0095d9;
}

.chat-input__send svg {
  width: 20px;
  height: 20px;
  fill: white;
}

/* Typing Indicator */
.chat-typing {
  display: none;
  padding: 12px 16px;
  background: #f0f2f5;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.chat-typing--visible {
  display: flex;
  gap: 4px;
}

.chat-typing__dot {
  width: 8px;
  height: 8px;
  background: #999;
  border-radius: 50%;
  animation: bounce 1.4s infinite ease-in-out;
}

.chat-typing__dot:nth-child(1) {
  animation-delay: 0s;
}

.chat-typing__dot:nth-child(2) {
  animation-delay: 0.2s;
}

.chat-typing__dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes bounce {
  0%, 80%, 100% {
    transform: scale(0.6);
    opacity: 0.5;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Welcome Message */
.chat-welcome {
  text-align: center;
  padding: 20px;
}

.chat-welcome__title {
  font-family: 'Ubuntu', sans-serif;
  font-size: 18px;
  color: #1a1a1a;
  margin-bottom: 8px;
}

.chat-welcome__text {
  font-size: 14px;
  color: #666;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .chat-launcher {
    bottom: 16px;
    right: 16px;
    width: 52px;
    height: 52px;
  }
  
  .chat-window {
    bottom: 80px;
    right: 16px;
    left: 16px;
    width: auto;
    height: calc(100vh - 100px);
  }
}
