/* =================================
   KD MOBILE DETAILING
   FREE CHAT ASSISTANT
================================= */

.kd-chat {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 99999;
  font-family: inherit;
}

/* Floating button */

.kd-chat-button {
  width: 62px;
  height: 62px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 50%;
  background: rgba(255,255,255,0.10);
  color: #fff;
  font-size: 25px;
  cursor: pointer;

  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);

  box-shadow:
    0 15px 40px rgba(0,0,0,0.35);

  transition:
    transform 0.2s ease,
    background 0.2s ease;
}

.kd-chat-button:hover {
  transform: translateY(-3px) scale(1.04);
  background: rgba(255,255,255,0.16);
}

/* Chat window */

.kd-chat-window {
  position: absolute;
  right: 0;
  bottom: 78px;

  width: 360px;
  max-width: calc(100vw - 30px);
  height: 520px;

  display: flex;
  flex-direction: column;

  overflow: hidden;

  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 25px;

  background: rgba(18,18,22,0.88);

  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);

  box-shadow:
    0 30px 80px rgba(0,0,0,0.45);

  opacity: 0;
  visibility: hidden;
  transform: translateY(15px) scale(0.96);
  transform-origin: bottom right;

  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
}

.kd-chat-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */

.kd-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 18px 20px;

  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.kd-chat-header strong {
  display: block;
  font-size: 16px;
}

.kd-chat-header span {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  opacity: 0.55;
}

.kd-chat-header span::first-letter {
  color: #55d66b;
}

.kd-chat-header button {
  width: 32px;
  height: 32px;

  border: 0;
  border-radius: 50%;

  background: rgba(255,255,255,0.08);
  color: inherit;

  font-size: 21px;
  cursor: pointer;
}

/* Messages */

.kd-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
}

.kd-message {
  max-width: 85%;
  padding: 12px 14px;
  margin-bottom: 12px;

  border-radius: 16px;

  font-size: 14px;
  line-height: 1.5;
}

.kd-bot {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.06);
}

.kd-user {
  margin-left: auto;
  background: #fff;
  color: #111;
}

/* Quick buttons */

.kd-chat-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 5px;
}

.kd-chat-options button {
  width: 100%;
  padding: 11px 13px;

  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;

  background: rgba(255,255,255,0.05);
  color: inherit;

  text-align: left;
  font: inherit;
  font-size: 13px;

  cursor: pointer;

  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.kd-chat-options button:hover {
  background: rgba(255,255,255,0.10);
  transform: translateX(2px);
}

/* Input */

.kd-chat-input {
  display: flex;
  gap: 8px;

  padding: 13px;

  border-top: 1px solid rgba(255,255,255,0.08);
}

.kd-chat-input input {
  flex: 1;
  min-width: 0;

  padding: 12px 14px;

  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 13px;

  outline: none;

  background: rgba(255,255,255,0.06);
  color: inherit;

  font: inherit;
}

.kd-chat-input input::placeholder {
  opacity: 0.45;
}

.kd-chat-input button {
  width: 45px;

  border: 0;
  border-radius: 13px;

  background: #fff;
  color: #111;

  font-size: 17px;
  cursor: pointer;
}

/* Mobile */

@media (max-width: 600px) {

  .kd-chat {
    right: 16px;
    bottom: 16px;
  }

  .kd-chat-button {
    width: 58px;
    height: 58px;
  }

  .kd-chat-window {
    right: -2px;
    bottom: 70px;

    width: calc(100vw - 30px);
    height: min(520px, 70vh);

    border-radius: 22px;
  }
}