/* ══════════════════════════════════════════════
   ShuttersCheap Chatbot Widget Styles
   ══════════════════════════════════════════════ */

/* ── Chat Bubble (Trigger) ── */
.chatbot-bubble {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #1d4ed8;
  border: 3px solid #fcd34d;
  box-shadow: 0 6px 24px rgba(29, 78, 216, 0.45);
  cursor: pointer;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: chatbotFadeIn 0.4s ease forwards;
  opacity: 0;
}
.chatbot-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 32px rgba(29, 78, 216, 0.55);
}
.chatbot-bubble svg {
  width: 32px;
  height: 32px;
  fill: #ffffff;
}
.chatbot-bubble.is-hidden {
  display: none;
}

/* Notification dot */
.chatbot-bubble__dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  background: #fcd34d;
  border-radius: 50%;
  border: 2px solid #1d4ed8;
  animation: chatbotPulse 2s ease infinite;
}

/* ── Chat Window ── */
.chatbot-window {
  position: fixed;
  bottom: 108px;
  right: 28px;
  width: 440px;
  height: 600px;
  background: #ffffff;
  border-radius: 1.5rem;
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.2);
  z-index: 10002;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: chatbotSlideUp 0.35s ease forwards;
}
.chatbot-window.is-open {
  display: flex;
}

/* ── Chat Header ── */
.chatbot-header {
  background: #fcd34d;
  border-bottom: 2px solid #1d4ed8;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chatbot-header__info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.chatbot-header__avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1d4ed8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chatbot-header__avatar svg {
  width: 24px;
  height: 24px;
  fill: #ffffff;
}
.chatbot-header__name {
  font-weight: 700;
  font-size: 1.1rem;
  color: #0f172a;
  line-height: 1.2;
}
.chatbot-header__status {
  font-size: 0.82rem;
  color: #15803d;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Blinking live dot */
.chatbot-live-dot {
  width: 8px;
  height: 8px;
  background: #22c55e;
  border-radius: 50%;
  display: inline-block;
  animation: chatbotLiveBlink 1.5s ease-in-out infinite;
}

.chatbot-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1d4ed8;
  border: 2px solid #fcd34d;
  color: #ffffff;
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
  line-height: 1;
}
.chatbot-close:hover {
  transform: scale(1.1);
}

/* ── Messages Area ── */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  scroll-behavior: smooth;
}
.chatbot-messages::-webkit-scrollbar {
  width: 5px;
}
.chatbot-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
}

/* ── Message Bubbles ── */
.chatbot-msg {
  max-width: 88%;
  padding: 0.85rem 1.15rem;
  font-size: 0.95rem;
  line-height: 1.55;
  animation: chatbotMsgIn 0.25s ease forwards;
  word-wrap: break-word;
}
.chatbot-msg--bot {
  background: #f1f5f9;
  color: #0f172a;
  border-radius: 0.3rem 1.1rem 1.1rem 1.1rem;
  align-self: flex-start;
}
.chatbot-msg--user {
  background: #1d4ed8;
  color: #ffffff;
  border-radius: 1.1rem 0.3rem 1.1rem 1.1rem;
  align-self: flex-end;
}
.chatbot-msg--bot strong {
  color: #1d4ed8;
  font-weight: 700;
}
.chatbot-msg--bot a {
  color: #1d4ed8;
  text-decoration: underline;
  font-weight: 600;
}
.chatbot-msg--bot a:hover {
  color: #1e40af;
}

/* ── Quick Replies ── */
.chatbot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.35rem 0 0.35rem;
  align-self: flex-start;
  max-width: 100%;
  animation: chatbotMsgIn 0.25s ease forwards;
}
.chatbot-quick-btn {
  background: #ffffff;
  border: 2px solid #1d4ed8;
  color: #1d4ed8;
  border-radius: 999px;
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
}
.chatbot-quick-btn:hover {
  background: #1d4ed8;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(29, 78, 216, 0.3);
}
.chatbot-quick-btn--phone {
  background: #1d4ed8;
  color: #ffffff;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.chatbot-quick-btn--phone:hover {
  background: #1e40af;
}

/* ── Input Area ── */
.chatbot-input-area {
  border-top: 1px solid #e5e7eb;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
  background: #ffffff;
}
.chatbot-input {
  flex: 1;
  border: 2px solid #e5e7eb;
  border-radius: 999px;
  padding: 0.75rem 1.15rem;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease;
  color: #0f172a;
}
.chatbot-input:focus {
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, 0.1);
}
.chatbot-input::placeholder {
  color: #94a3b8;
}
.chatbot-send {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #1d4ed8;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s ease;
  flex-shrink: 0;
}
.chatbot-send:hover {
  background: #1e40af;
  transform: scale(1.06);
}
.chatbot-send:disabled {
  background: #cbd5e1;
  cursor: default;
  transform: none;
}
.chatbot-send svg {
  width: 20px;
  height: 20px;
  fill: #ffffff;
}

/* ── Typing Indicator ── */
.chatbot-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0.85rem 1.15rem;
  background: #f1f5f9;
  border-radius: 0.3rem 1.1rem 1.1rem 1.1rem;
  align-self: flex-start;
  animation: chatbotMsgIn 0.25s ease forwards;
}
.chatbot-typing__dot {
  width: 8px;
  height: 8px;
  background: #94a3b8;
  border-radius: 50%;
  animation: chatbotTyping 1.4s ease infinite;
}
.chatbot-typing__dot:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing__dot:nth-child(3) { animation-delay: 0.4s; }

/* ── Booking Summary ── */
.chatbot-summary {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  margin-top: 0.35rem;
  font-size: 0.9rem;
  line-height: 1.65;
}
.chatbot-summary strong {
  color: #1d4ed8;
}

/* ── Animations ── */
@keyframes chatbotFadeIn {
  from { opacity: 0; transform: scale(0.8); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes chatbotSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes chatbotMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes chatbotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%      { transform: scale(1.3); opacity: 0.7; }
}
@keyframes chatbotTyping {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-6px); opacity: 1; }
}
@keyframes chatbotLiveBlink {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.25; }
}

/* ── Mobile Responsive (max-width: 1024px) ── */
@media (max-width: 1024px) {
  .chatbot-bubble {
    bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    width: 62px;
    height: 62px;
  }
  .chatbot-bubble svg {
    width: 28px;
    height: 28px;
  }
  .chatbot-window {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    bottom: 0;
    right: 0;
    animation: chatbotFadeIn 0.25s ease forwards;
  }
  .chatbot-header {
    padding-top: calc(1rem + env(safe-area-inset-top, 0px));
  }
  .chatbot-input-area {
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0px));
  }
  .chatbot-msg {
    font-size: 1rem;
    max-width: 90%;
  }
  .chatbot-quick-btn {
    font-size: 0.92rem;
    padding: 0.6rem 1.15rem;
  }
  .chatbot-input {
    font-size: 1rem;
    padding: 0.8rem 1.15rem;
  }
}

/* ── Small phones ── */
@media (max-width: 400px) {
  .chatbot-quick-btn {
    font-size: 0.85rem;
    padding: 0.5rem 0.9rem;
  }
  .chatbot-msg {
    font-size: 0.95rem;
    max-width: 92%;
  }
}
