.chat-bubble {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 72px;
  height: 72px;
  background-color: #059669;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  z-index: 1095;
  transition: transform 0.3s ease;
}

.chat-bubble:hover {
  transform: scale(1.1);
}

.chat-bubble i {
  font-size: 30px;
}

.demo-calendar-chat-bubble {
  width: auto;
  min-width: 210px;
  height: 74px;
  gap: 0.75rem;
  justify-content: flex-start;
  padding: 0.7rem 1rem 0.7rem 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 18px 42px rgba(5, 150, 105, 0.32);
}

.demo-calendar-chat-bubble:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 22px 50px rgba(5, 150, 105, 0.38);
}

.chat-bubble-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  flex: 0 0 auto;
}

.chat-bubble-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  line-height: 1.05;
}

.chat-bubble-copy strong {
  color: #fff;
  font-size: 0.98rem;
  letter-spacing: 0;
  white-space: nowrap;
}

.chat-bubble-copy small {
  margin-top: 0.22rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.chat-modal {
  position: fixed;
  bottom: 105px;
  right: 20px;
  width: min(430px, calc(100vw - 40px));
  height: min(590px, calc(100vh - 130px));
  background-color: white;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  display: none;
  flex-direction: column;
  z-index: 1094;
  overflow: hidden;
}

.chat-header {
  padding: 18px;
  background-color: #059669;
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.close-chat {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 20px;
}

.chat-messages {
  flex-grow: 1;
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.message {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 18px;
  margin-bottom: 10px;
  position: relative;
}

.user-message {
  background-color: #e9f5ff;
  color: #333;
  align-self: flex-end;
  border-bottom-right-radius: 5px;
}

.bot-message {
  background-color: #f0f0f0;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}

.typing-indicator {
  display: flex;
  align-items: center;
  background-color: #f0f0f0;
  padding: 8px 15px;
  border-radius: 18px;
  margin-bottom: 10px;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  margin: 0 1px;
  background-color: #606060;
  display: block;
  border-radius: 50%;
  opacity: 0.4;
  animation: typing 1s infinite;
}

.typing-indicator span:nth-child(1) {
  animation-delay: 0s;
}

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

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

@keyframes typing {
  0% {
    transform: translateY(0px);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-5px);
    opacity: 0.9;
  }
  100% {
    transform: translateY(0px);
    opacity: 0.4;
  }
}

.chat-input-container {
  display: flex;
  padding: 14px;
  border-top: 1px solid #e0e0e0;
}

#chat-input {
  flex-grow: 1;
  padding: 12px 14px;
  border: 1px solid #ccc;
  border-radius: 20px;
  margin-right: 10px;
  outline: none;
}

.send-message-btn {
  background-color: #059669;
  color: white;
  border: none;
  border-radius: 50%;
  width: 46px;
  height: 46px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.send-message-btn:hover {
  background-color: #047857;
}

[data-theme="dark"] .chat-modal {
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: #111827;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
}

[data-theme="dark"] .chat-header {
  background: linear-gradient(135deg, #065f46 0%, #047857 100%);
}

[data-theme="dark"] .chat-messages {
  background: #0f172a;
}

[data-theme="dark"] .bot-message,
[data-theme="dark"] .typing-indicator {
  background: #1f2937;
  color: #e5e7eb;
}

[data-theme="dark"] .user-message {
  background: rgba(16, 185, 129, 0.18);
  color: #d1fae5;
}

[data-theme="dark"] .chat-input-container {
  border-top-color: rgba(255, 255, 255, 0.09);
  background: #111827;
}

[data-theme="dark"] #chat-input {
  border-color: rgba(255, 255, 255, 0.12);
  background: #0f172a;
  color: #f8fafc;
}

[data-theme="dark"] #chat-input::placeholder {
  color: #94a3b8;
}

@media (max-width: 640px) {
  .demo-calendar-chat-bubble {
    min-width: 0;
    height: 66px;
    padding: 0.55rem;
  }

  .demo-calendar-chat-bubble .chat-bubble-copy {
    display: none;
  }

  .chat-bubble-icon {
    width: 54px;
    height: 54px;
  }

  .chat-modal {
    right: 12px;
    bottom: 92px;
    width: calc(100vw - 24px);
    height: min(590px, calc(100vh - 112px));
  }
}
