/* Dream Buddy Chatbot - Modern Professional Design */

.chatbot {
  position: fixed;
  bottom: 24px;
  left: 24px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.chatbot__trigger {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4), 0 4px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.chatbot__trigger::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
  transform: scale(0);
  transition: transform 0.6s ease;
}

.chatbot__trigger:hover::before {
  transform: scale(1);
}

.chatbot__trigger:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5), 0 6px 12px rgba(0, 0, 0, 0.15);
}

.chatbot__trigger:active {
  transform: translateY(-2px) scale(1.02);
}

.chatbot__trigger-icon {
  width: 32px;
  height: 32px;
  color: white;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 1;
}

.chatbot__trigger-icon--close {
  position: absolute;
  opacity: 0;
  transform: rotate(90deg) scale(0.8);
}

.chatbot.is-open .chatbot__trigger {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.chatbot.is-open .chatbot__trigger-icon--chat {
  opacity: 0;
  transform: rotate(-90deg) scale(0.8);
}

.chatbot.is-open .chatbot__trigger-icon--close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.chatbot__window {
  position: absolute;
  bottom: 84px;
  left: 0;
  width: 400px;
  height: 650px;
  background: white;
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(0, 0, 0, 0.1);
  display: none;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.chatbot.is-open .chatbot__window {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chatbot__header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.chatbot__header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
}

.chatbot__header-info {
  display: flex;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 1;
}

.chatbot__avatar {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.1) 100%);
  backdrop-filter: blur(10px);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,0.3);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.chatbot__avatar svg {
  width: 26px;
  height: 26px;
}

.chatbot__title {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 3px;
  letter-spacing: -0.3px;
}

.chatbot__status {
  font-size: 13px;
  opacity: 0.95;
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
}

.chatbot__status-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 5px rgba(16, 185, 129, 0.2);
  }
}

.chatbot__close {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: none;
  color: white;
  cursor: pointer;
  padding: 10px;
  display: flex;
  align-items: center;
  border-radius: 12px;
  transition: all 0.2s;
  position: relative;
  z-index: 1;
}

.chatbot__close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.chatbot__close svg {
  width: 20px;
  height: 20px;
}

.chatbot__messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  background: linear-gradient(180deg, #f8f9ff 0%, #ffffff 100%);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.chatbot__messages::-webkit-scrollbar {
  width: 6px;
}

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

.chatbot__messages::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
  border-radius: 3px;
}

.chatbot__message {
  display: flex;
  animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.chatbot__message--user {
  justify-content: flex-end;
}

.chatbot__message-bubble {
  max-width: 78%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14.5px;
  line-height: 1.6;
  position: relative;
}

.chatbot__message--bot .chatbot__message-bubble {
  background: white;
  border: 1px solid #e8ebf7;
  border-bottom-left-radius: 6px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
  color: #2d3748;
}

.chatbot__message--user .chatbot__message-bubble {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.chatbot__message-text {
  margin-bottom: 6px;
}

.chatbot__message-time {
  font-size: 11px;
  opacity: 0.65;
  text-align: right;
  font-weight: 500;
}

.chatbot__quick-replies {
  padding: 16px 24px;
  background: white;
  border-top: 1px solid #e8ebf7;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chatbot__quick-btn {
  padding: 10px 16px;
  background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
  border: 1.5px solid #e8ebf7;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  color: #4c5c7c;
}

.chatbot__quick-btn:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.chatbot__input-area {
  padding: 20px 24px;
  background: white;
  border-top: 1px solid #e8ebf7;
  display: flex;
  gap: 12px;
  align-items: center;
}

.chatbot__input {
  flex: 1;
  padding: 14px 18px;
  border: 2px solid #e8ebf7;
  border-radius: 28px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: #f8f9ff;
}

.chatbot__input:focus {
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.chatbot__input::placeholder {
  color: #a0aec0;
}

.chatbot__send {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.chatbot__send:hover {
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.chatbot__send:active {
  transform: scale(1.05) rotate(15deg);
}

.chatbot__send svg {
  width: 20px;
  height: 20px;
}

.chatbot__footer {
  padding: 16px 24px 20px;
  background: linear-gradient(180deg, #ffffff 0%, #f8f9ff 100%);
  border-top: 1px solid #e8ebf7;
  display: flex;
  gap: 10px;
}

.chatbot__footer-btn {
  flex: 1;
  padding: 14px;
  background: linear-gradient(135deg, #25d366 0%, #20ba5a 100%);
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.chatbot__footer-btn:hover {
  background: linear-gradient(135deg, #20ba5a 0%, #1da851 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

.chatbot__footer-btn svg {
  width: 22px;
  height: 22px;
}

.chatbot__footer-btn--support {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.chatbot__footer-btn--support:hover {
  background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* Mobile responsive */
@media (max-width: 480px) {
  .chatbot {
    bottom: 16px;
    left: 16px;
  }

  .chatbot__window {
    position: fixed;
    width: calc(100vw - 32px);
    height: calc(100vh - 120px);
    max-height: 600px;
    bottom: 96px;
    left: 16px;
  }

  .chatbot__trigger {
    width: 60px;
    height: 60px;
  }

  .chatbot__trigger-icon {
    width: 28px;
    height: 28px;
  }

  .chatbot__messages {
    padding: 16px;
  }

  .chatbot__quick-btn {
    font-size: 12px;
    padding: 8px 14px;
  }

  .chatbot__footer {
    flex-direction: column;
  }
}

@media (max-width: 380px) {
  .chatbot__window {
    width: calc(100vw - 24px);
    left: 12px;
  }

  .chatbot__header {
    padding: 16px 20px;
  }

  .chatbot__title {
    font-size: 15px;
  }

  .chatbot__status {
    font-size: 12px;
  }
}

/* Phone and small tablet: the site shows a bottom action bar (WhatsApp,
   Call now) with the back-to-top arrow above it on the right. The chat
   button sits level with that arrow on the left, clear of the bar. */
@media (max-width: 768px) {
  .chatbot {
    left: .55rem;
    bottom: calc(64px + .7rem - 2px);
  }

  .chatbot__trigger {
    width: 52px;
    height: 52px;
  }

  .chatbot__trigger-icon {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 480px) {
  .chatbot__window {
    left: 16px;
    bottom: 150px;
    height: calc(100vh - 190px);
  }
}
