@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&display=swap");

/* ================================================
   CHATBOT WIDGET
   chatbot-assistant-prototype'tan uyarlandı
   ================================================ */

.chatbot {
  position: fixed;
  bottom: 24px;
  z-index: 9999;
  font-family: "Inter", "Open Sans", sans-serif;
}
.chatbot.chatbot--right {
  right: 24px;
  left: auto;
}
.chatbot.chatbot--right .chatbot__modal {
  right: 0;
  left: auto;
  transform-origin: bottom right;
}
.chatbot.chatbot--left {
  left: 24px;
  right: auto;
}
.chatbot.chatbot--left .chatbot__modal {
  left: 0;
  right: auto;
  transform-origin: bottom left;
}
.chatbot.chatbot--left .chatbot__arrow--right {
  order: -1;
  border-left: none;
  border-right: 6px solid rgb(253.1806451613, 252.2, 254.6);
  margin-left: 0;
  margin-right: 4px;
}
.chatbot.chatbot--left .chatbot__messages li.is-user {
  flex-direction: row-reverse;
}

.chatbot__fab {
  position: relative;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7226e0, rgb(80.0342741935, 23.1875, 162.3125));
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(114, 38, 224, 0.5);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  z-index: 2;
}
.chatbot__fab:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 28px rgba(114, 38, 224, 0.65);
}
.chatbot--open .chatbot__fab {
  display: none;
}

.chatbot__fab-pulse {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: rgba(114, 38, 224, 0.4);
  animation: chatbotFabPulse 2s ease-out infinite;
  pointer-events: none;
}
.chatbot--open .chatbot__fab-pulse {
  display: none;
}

@keyframes chatbotFabPulse {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  70% {
    transform: scale(1.6);
    opacity: 0;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}
.chatbot__fab-icon {
  fill: #fff;
  width: 26px;
  height: 26px;
  position: relative;
  z-index: 1;
}

.chatbot__modal {
  position: absolute;
  bottom: calc(60px + 12px);
  width: 380px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2), 0 8px 24px rgba(114, 38, 224, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.85) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}
@media screen and (max-width: 440px) {
  .chatbot__modal {
    width: calc(100vw - 48px);
  }
}
.chatbot--open .chatbot__modal {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

.chatbot__header {
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #1e1b4b, rgb(22.5, 20.25, 56.25));
  height: 64px;
  padding: 0 16px;
  width: 100%;
  flex-shrink: 0;
}
.chatbot__header::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: linear-gradient(135deg, rgba(114, 38, 224, 0.3), transparent);
  pointer-events: none;
}

.chatbot__header-info {
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1;
}

.chatbot__avatar-small {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.3);
  overflow: hidden;
}
.chatbot__avatar-small .icon-avatar {
  width: 34px;
  height: 34px;
}

.chatbot__header-name {
  margin: 0 0 2px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.chatbot__header-status {
  margin: 0;
  font-size: 11px;
  color: #22c55e;
  font-weight: 400;
}

.chatbot__close-button {
  fill: rgba(255, 255, 255, 0.8);
  width: 16px;
  height: 16px;
  cursor: pointer;
  transition: fill 0.2s ease, transform 0.2s ease;
  z-index: 1;
  flex-shrink: 0;
}
.chatbot__close-button:hover {
  fill: #fff;
  transform: rotate(90deg);
}

.chatbot__message-window {
  min-height: 180px;
  max-height: 420px;
  height: auto;
  padding: 16px 16px 8px;
  background: linear-gradient(180deg, #fafbff 0%, #fff 100%);
  overflow-x: hidden;
  overflow-y: auto;
  flex: 1;
  scrollbar-width: thin;
  scrollbar-color: rgba(114, 38, 224, 0.25) transparent;
}
.chatbot__message-window::-webkit-scrollbar {
  width: 3px;
}
.chatbot__message-window::-webkit-scrollbar-track {
  background: transparent;
  margin: 6px 0;
}
.chatbot__message-window::-webkit-scrollbar-thumb {
  background: rgba(114, 38, 224, 0.25);
  border-radius: 999px;
  transition: background 0.2s ease;
}
.chatbot__message-window::-webkit-scrollbar-thumb:hover {
  background: rgba(114, 38, 224, 0.5);
}

.chatbot__messages {
  padding: 0;
  margin: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chatbot__messages li {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.chatbot__messages li.is-ai {
  align-self: flex-start;
  max-width: 90%;
}
.chatbot__messages li.is-user {
  align-self: flex-end;
  flex-direction: row-reverse;
  max-width: 90%;
}

.is-ai__profile-picture {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(114, 38, 224, 0.15), rgba(114, 38, 224, 0.05));
  border: 1.5px solid rgba(114, 38, 224, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.is-ai__profile-picture .icon-avatar {
  width: 28px;
  height: 28px;
}

.chatbot__message {
  display: inline-block;
  padding: 10px 14px;
  word-break: break-word;
  margin: 0;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.01em;
}
.is-ai .chatbot__message {
  background: #f0f0f0;
  color: #1a1a2e;
  border-bottom-left-radius: 4px;
}
.is-user .chatbot__message {
  background: linear-gradient(135deg, #7226e0, rgb(91.0362903226, 26.375, 184.625));
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chatbot__message a {
  color: #7226e0;
  word-break: break-all;
  display: inline-block;
  text-decoration: underline;
}
.chatbot__message p {
  margin: 0 0 6px;
}
.chatbot__message p:last-child {
  margin-bottom: 0;
}
.chatbot__message button {
  background-color: #fff;
  font-weight: 500;
  font-size: 13px;
  border: 1.5px solid #7226e0;
  border-radius: 20px;
  padding: 6px 14px;
  margin: 4px 6px 4px 0;
  transition: all 0.2s ease;
  cursor: pointer;
  color: #7226e0;
  font-family: inherit;
}
.chatbot__message button:hover {
  background-color: #7226e0;
  color: #fff;
  transform: translateY(-1px);
}
.chatbot__message button:focus {
  outline: none;
}
.chatbot__message img {
  max-width: 100%;
  border-radius: 8px;
}
.chatbot__message .card {
  background-color: #fff;
  text-decoration: none;
  overflow: hidden;
  border-radius: 12px;
  color: #1a1a2e;
  word-break: normal;
  border: 1px solid #e6eaee;
  display: block;
  transition: box-shadow 0.2s ease;
}
.chatbot__message .card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.chatbot__message .card .card-content {
  padding: 16px;
}
.chatbot__message .card .card-title {
  margin-top: 0;
  font-size: 14px;
}
.chatbot__message .card .card-button {
  color: #7226e0;
  text-decoration: underline;
  font-size: 13px;
}

.chatbot__arrow {
  width: 0;
  height: 0;
  flex-shrink: 0;
  margin-bottom: 8px;
  display: none;
}

.chatbot__contact-bar {
  padding: 10px 16px 8px;
  background: linear-gradient(135deg, #fafbff, #f5f3ff);
  border-top: 1px solid rgba(230, 234, 238, 0.7);
  border-bottom: 1px solid rgba(230, 234, 238, 0.5);
}

.chatbot__contact-label {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #a0a0a0;
  margin-bottom: 7px;
}

.chatbot__contact-actions {
  display: flex;
  gap: 6px;
}

.chatbot__contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 1;
  justify-content: center;
  padding: 7px 6px;
  border-radius: 10px;
  text-decoration: none;
  font-size: 11px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.01em;
  border: 1.5px solid transparent;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background 0.2s ease;
  cursor: pointer;
}
.chatbot__contact-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: currentColor;
}
.chatbot__contact-btn:hover {
  transform: translateY(-2px);
}
.chatbot__contact-btn:active {
  transform: translateY(0);
}
.chatbot__contact-btn--whatsapp {
  background: #e8f8f0;
  color: #128c3e;
  border-color: rgba(18, 140, 62, 0.2);
}
.chatbot__contact-btn--whatsapp:hover {
  background: #25d366;
  color: #fff;
  border-color: #25d366;
  box-shadow: 0 4px 14px rgba(37, 211, 102, 0.45);
}
.chatbot__contact-btn--mail {
  background: #e8f1fb;
  color: #1a6bc5;
  border-color: rgba(26, 107, 197, 0.2);
}
.chatbot__contact-btn--mail:hover {
  background: #2b7de9;
  color: #fff;
  border-color: #2b7de9;
  box-shadow: 0 4px 14px rgba(43, 125, 233, 0.4);
}
.chatbot__contact-btn--card {
  background: rgb(253.1806451613, 252.2, 254.6);
  color: #7226e0;
  border-color: rgba(114, 38, 224, 0.2);
}
.chatbot__contact-btn--card:hover {
  background: #7226e0;
  color: #fff;
  border-color: #7226e0;
  box-shadow: 0 4px 14px rgba(114, 38, 224, 0.45);
}

.chatbot__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px 16px;
  background: #fff;
  border-top: 1px solid rgba(230, 234, 238, 0.6);
}

.chatbot__suggestion-btn {
  background: transparent;
  border: 1.5px solid rgba(114, 38, 224, 0.35);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-family: inherit;
  color: #7226e0;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-weight: 500;
}
.chatbot__suggestion-btn:hover {
  background: #7226e0;
  border-color: #7226e0;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(114, 38, 224, 0.3);
}
.chatbot__suggestion-btn:focus {
  outline: none;
}
.chatbot__suggestion-btn:active {
  transform: translateY(0);
}

.chatbot__entry {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 64px;
  padding: 0 16px;
  border-top: 1px solid #e6eaee;
  background-color: #fff;
  flex-shrink: 0;
}

.chatbot__input {
  flex: 1;
  height: 40px;
  border: 1.5px solid #e6eaee;
  border-radius: 20px;
  padding: 0 14px;
  font-size: 14px;
  font-family: "Inter", "Open Sans", sans-serif;
  background: #f8f9fc;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.chatbot__input:focus {
  outline: none;
  border-color: rgba(114, 38, 224, 0.5);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(114, 38, 224, 0.08);
}
.chatbot__input::placeholder {
  color: #a0a0a0;
}

.chatbot__submit {
  fill: #7226e0;
  height: 20px;
  width: 20px;
  transition: all 0.2s ease;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
}
.chatbot__submit:hover {
  fill: rgb(80.0342741935, 23.1875, 162.3125);
  transform: scale(1.15);
}

.chatbot .animation:last-child {
  animation: chatbotMessageIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes chatbotMessageIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.chatbot .loader {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 0;
}

.chatbot .loader__dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  animation: chatbotLoaderBounce 0.6s infinite alternate;
}
.chatbot .loader__dot:nth-of-type(2) {
  animation-delay: 0.2s;
}
.chatbot .loader__dot:nth-of-type(3) {
  animation-delay: 0.4s;
}

@keyframes chatbotLoaderBounce {
  0% {
    transform: translateY(0);
    opacity: 0.4;
  }
  100% {
    transform: translateY(-6px);
    opacity: 1;
  }
}
