/**
 * Kirve Chatbot CSS - Modern ve Şık Tasarım
 */

/* Chatbot Container */
.kirve-chatbot-container {
  position: fixed;
  z-index: 9999;
  bottom: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Chatbot Position */
.kirve-chatbot-right {
  right: 20px;
}

.kirve-chatbot-left {
  left: 20px;
}

.kirve-chatbot-center {
  left: 50%;
  transform: translateX(-50%);
}

/* Chatbot Button */
.kirve-chatbot-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--primary-color, #4a6cf7);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(74, 108, 247, 0.3);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 2px solid rgba(255, 255, 255, 0.2);
}

.kirve-chatbot-button:hover {
  transform: scale(1.1) translateY(-5px);
  box-shadow: 0 6px 20px rgba(74, 108, 247, 0.4);
}

.kirve-chatbot-icon {
  font-size: 24px;
}

/* Chatbot Window */
.kirve-chatbot-window {
  position: absolute;
  bottom: 80px;
  width: 350px;
  height: 500px;
  background-color: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: visible; /* Changed from hidden to visible */
  border: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.kirve-chatbot-right .kirve-chatbot-window {
  right: 0;
}

.kirve-chatbot-left .kirve-chatbot-window {
  left: 0;
}

.kirve-chatbot-center .kirve-chatbot-window {
  left: 50%;
  transform: translateX(-50%);
}

/* Chatbot Header */
.kirve-chatbot-header {
  background-color: var(--primary-color, #4a6cf7);
  color: #fff;
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.kirve-chatbot-title {
  font-weight: 600;
  font-size: 16px;
  display: flex;
  align-items: center;
  letter-spacing: 0.3px;
}

/* Logo styling */
.kirve-chatbot-logo {
  max-height: 30px;
  max-width: 150px;
  vertical-align: middle;
  margin-right: 10px;
  border-radius: 4px;
}

.kirve-chatbot-title-text {
  margin-left: 8px;
}

.kirve-chatbot-close {
  cursor: pointer;
  font-size: 22px;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.kirve-chatbot-close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Chatbot Messages - Düzeltilmiş kaydırma ve görünürlük */
.kirve-chatbot-messages {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
  background-color: var(--secondary-color, #f8f9fa);
  display: flex;
  flex-direction: column;
  scroll-behavior: smooth;
  max-height: calc(100% - 140px); /* Header and input area space */
  gap: 12px;
  overflow-x: hidden; /* Prevent horizontal scrolling */
}

/* Mesaj görünümü düzeltmeleri */
.kirve-chatbot-message {
  margin-bottom: 8px;
  padding: 12px 16px;
  border-radius: 18px;
  max-width: 85%;
  word-wrap: break-word;
  position: relative;
  clear: both;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  line-height: 1.5;
}

.kirve-chatbot-message-bot {
  background-color: #fff;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  float: none;
  border-left: 3px solid var(--primary-color, #4a6cf7);
}

.kirve-chatbot-message-user {
  background-color: var(--primary-color, #4a6cf7);
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 5px;
  align-self: flex-end;
  float: none;
}

/* Kategori Seçimi */
.kirve-chatbot-category-container {
  padding: 15px 20px;
  background-color: #fff;
  border-top: 1px solid #eee;
}

.kirve-chatbot-category-title {
  font-weight: 600;
  margin-bottom: 12px;
  color: #333;
  font-size: 14px;
}

.kirve-chatbot-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.kirve-chatbot-categories-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.kirve-chatbot-categories-dropdown {
  display: block;
}

.kirve-chatbot-category-button {
  padding: 10px 16px;
  background-color: #f0f0f0;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.kirve-chatbot-category-button:hover {
  background-color: #e0e0e0;
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.kirve-chatbot-category-button.active {
  background-color: var(--primary-color, #4a6cf7);
  color: #fff;
  border-color: var(--primary-color, #4a6cf7);
}

.kirve-chatbot-category-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kirve-chatbot-category-select {
  width: 100%;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background-color: #f8f9fa;
  transition: all 0.2s ease;
}

.kirve-chatbot-category-select:focus {
  border-color: var(--primary-color, #4a6cf7);
  box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.2);
  outline: none;
}

/* Chatbot Input Container - Görünürlük düzeltmesi */
.kirve-chatbot-input-container {
  padding: 15px;
  border-top: 1px solid #eee;
  background-color: #fff;
  position: relative;
  z-index: 10;
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  display: block;
  bottom: 0;
}

/* Input alanı düzeltmeleri */
.kirve-chatbot-input-wrapper {
  display: flex;
  align-items: center;
  min-height: 44px;
  width: 100%;
}

.kirve-chatbot-input-field {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
}

.kirve-chatbot-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 24px;
  outline: none;
  font-size: 14px;
  transition: all 0.2s ease;
  background-color: #f8f9fa;
  height: 44px;
  box-sizing: border-box;
  display: block;
  width: 100%;
}

.kirve-chatbot-send-button {
  padding: 0 16px;
  background-color: var(--primary-color, #4a6cf7);
  color: #fff;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  height: 44px;
  white-space: nowrap;
}

/* Select Input */
.kirve-chatbot-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 24px;
  outline: none;
  background-color: #f8f9fa;
  font-size: 14px;
  transition: all 0.2s ease;
}

.kirve-chatbot-select:focus {
  border-color: var(--primary-color, #4a6cf7);
  box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.2);
}

/* Radio Input */
.kirve-chatbot-radio-wrapper {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  padding: 8px 0;
}

.kirve-chatbot-radio-wrapper input[type="radio"] {
  margin-right: 10px;
}

/* Yükleniyor göstergesi */
.kirve-chatbot-loading {
  text-align: center;
  padding: 15px;
  color: #666;
  font-style: italic;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.kirve-chatbot-loading:after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid #ddd;
  border-top: 2px solid var(--primary-color, #4a6cf7);
  border-radius: 50%;
  animation: kirve-spin 1s linear infinite;
}

@keyframes kirve-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Yeni sohbet başlatma butonu */
.kirve-chatbot-restart-button {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--primary-color, #4a6cf7);
  color: #fff;
  border: none;
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  font-weight: 500;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(74, 108, 247, 0.2);
}

.kirve-chatbot-restart-button:hover {
  background-color: #3a5bd9;
  transform: translateY(-2px);
  box-shadow: 0 2px 12px rgba(74, 108, 247, 0.3);
}

/* Select ve Radio için gönder butonu */
.kirve-chatbot-select {
  flex: 1;
  margin-right: 10px;
}

/* Mesaj içindeki butonlar - Geliştirilmiş */
.kirve-chatbot-message-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  width: 100%;
}

.kirve-chatbot-message-button {
  padding: 10px 16px;
  background-color: #fff;
  color: var(--primary-color, #4a6cf7);
  border: 1px solid var(--primary-color, #4a6cf7);
  border-radius: 20px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  margin-bottom: 5px;
  font-weight: 500;
}

.kirve-chatbot-message-button:hover {
  background-color: var(--primary-color, #4a6cf7);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(74, 108, 247, 0.2);
}

.kirve-chatbot-message-button.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Dış Baloncuk - Chat dışında gösterilen mesaj ve kategoriler */
.kirve-chatbot-bubble {
  position: absolute;
  bottom: 80px;
  width: 350px;
  background-color: #fff;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  padding: 20px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.kirve-chatbot-right .kirve-chatbot-bubble {
  right: 0;
}

.kirve-chatbot-left .kirve-chatbot-bubble {
  left: 0;
}

.kirve-chatbot-center .kirve-chatbot-bubble {
  left: 50%;
  transform: translateX(-50%);
}

.kirve-chatbot-bubble-message {
  margin-bottom: 15px;
  font-size: 15px;
  color: #333;
  line-height: 1.5;
}

.kirve-chatbot-bubble-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 15px;
}

.kirve-chatbot-bubble-category {
  padding: 10px 16px;
  background-color: #f8f9fa;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 24px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.kirve-chatbot-bubble-category:hover {
  background-color: var(--primary-color, #4a6cf7);
  color: #fff;
  border-color: var(--primary-color, #4a6cf7);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(74, 108, 247, 0.2);
}

/* Üçgen şekli (baloncuk için) */
.kirve-chatbot-bubble:after {
  content: "";
  position: absolute;
  bottom: -10px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #fff;
}

.kirve-chatbot-right .kirve-chatbot-bubble:after {
  right: 20px;
}

.kirve-chatbot-left .kirve-chatbot-bubble:after {
  left: 20px;
}

.kirve-chatbot-center .kirve-chatbot-bubble:after {
  left: 50%;
  transform: translateX(-50%);
}

/* Responsive Design */
@media (max-width: 480px) {
  .kirve-chatbot-window {
    width: 320px;
    height: 480px;
    bottom: 70px;
  }

  .kirve-chatbot-bubble {
    width: 280px;
    padding: 15px;
  }

  .kirve-chatbot-right {
    right: 10px;
  }

  .kirve-chatbot-left {
    left: 10px;
  }

  .kirve-chatbot-button {
    width: 50px;
    height: 50px;
  }

  .kirve-chatbot-categories {
    gap: 8px;
  }

  .kirve-chatbot-category-button {
    padding: 8px 12px;
    font-size: 13px;
  }

  .kirve-chatbot-input-container {
    padding: 12px 15px;
  }

  .kirve-chatbot-input {
    padding: 10px 14px;
  }

  .kirve-chatbot-send-button {
    padding: 10px 14px;
    min-width: 70px;
  }
}

/* Bekleme mesajı */
.kirve-chatbot-waiting {
  text-align: center;
  padding: 15px;
  color: #666;
  font-style: italic;
  width: 100%;
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
}

/* Mesaj alanı temizleme */
.kirve-chatbot-message:after {
  content: "";
  display: table;
  clear: both;
}

/* Yeni giriş tipleri için CSS */

/* Textarea */
.kirve-chatbot-textarea {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 16px;
  outline: none;
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  font-size: 14px;
  background-color: #f8f9fa;
  transition: all 0.2s ease;
}

.kirve-chatbot-textarea:focus {
  border-color: var(--primary-color, #4a6cf7);
  box-shadow: 0 0 0 2px rgba(74, 108, 247, 0.2);
  background-color: #fff;
}

/* File input */
.kirve-chatbot-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.kirve-chatbot-file-label {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid #ddd;
  border-radius: 24px;
  background-color: #f8f9fa;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.kirve-chatbot-file-label:before {
  content: "📎";
  font-size: 16px;
}

.kirve-chatbot-file-label:hover {
  background-color: #f0f0f0;
  border-color: #ccc;
}

/* Checkbox seçenekleri */
.kirve-chatbot-message-button.selected {
  background-color: var(--primary-color, #4a6cf7);
  color: #fff;
  box-shadow: 0 2px 8px rgba(74, 108, 247, 0.2);
}

.kirve-chatbot-checkbox-send {
  margin-top: 12px;
  width: 100%;
  background-color: #4a6cf7;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 24px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.kirve-chatbot-checkbox-send:hover {
  background-color: #3a5bd9;
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(74, 108, 247, 0.3);
}

/* Doğrulama hata mesajları */
.kirve-chatbot-validation-error {
  color: #e74c3c;
  font-size: 13px;
  margin-top: 8px;
  padding: 8px 12px;
  background-color: #fdeaea;
  border-radius: 8px;
  text-align: center;
  border-left: 3px solid #e74c3c;
}

/* Tarih seçici */
input[type="date"].kirve-chatbot-input {
  padding: 11px 16px;
  color: #333;
}

/* Media upload in admin */
.kirve-media-upload {
  margin-bottom: 15px;
}

.kirve-media-preview {
  margin-bottom: 15px;
  padding: 15px;
  background: #f9f9f9;
  border: 1px solid #ddd;
  border-radius: 8px;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.kirve-media-upload-button {
  margin-right: 8px !important;
}

/* Mesaj zaman damgası */
.kirve-chatbot-message-time {
  font-size: 11px;
  color: #999;
  margin-top: 5px;
  display: block;
  text-align: right;
}

/* Mesaj metni */
.kirve-chatbot-message-text {
  line-height: 1.5;
}

/* Yazıyor göstergesi */
.kirve-chatbot-typing {
  display: flex;
  align-items: center;
  padding: 10px 15px;
  background-color: #f0f0f0;
  border-radius: 18px;
  max-width: 60px;
  margin-bottom: 15px;
  align-self: flex-start;
}

.kirve-chatbot-typing-dot {
  width: 8px;
  height: 8px;
  background-color: #999;
  border-radius: 50%;
  margin: 0 2px;
  animation: kirve-typing 1.4s infinite ease-in-out both;
}

.kirve-chatbot-typing-dot:nth-child(1) {
  animation-delay: -0.32s;
}

.kirve-chatbot-typing-dot:nth-child(2) {
  animation-delay: -0.16s;
}

@keyframes kirve-typing {
  0%,
  80%,
  100% {
    transform: scale(0);
  }
  40% {
    transform: scale(1);
  }
}

/* Baloncuk kapatma butonu - Daha belirgin */
.kirve-chatbot-bubble-close {
  position: absolute;
  top: 2px;
  right: 8px;
  font-size: 22px;
  cursor: pointer;
  color: #666;
  z-index: 10;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  background-color: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.kirve-chatbot-bubble-close:hover {
  color: #333;
  background-color: rgba(0, 0, 0, 0.1);
  transform: scale(1.1);
}

/* Kategori toggle butonu - Daha büyük */
.kirve-chatbot-bubble-toggle {
  text-align: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.kirve-chatbot-bubble-toggle-btn {
  background-color: rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: #555;
  cursor: pointer;
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  width: 80%;
  margin: 0 auto;
  display: block;
}

.kirve-chatbot-bubble-toggle-btn:hover {
  background-color: rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.kirve-chatbot-toggle-icon {
  display: inline-block;
  transition: transform 0.3s ease;
}

.kirve-chatbot-toggle-icon.collapsed {
  transform: rotate(180deg);
}

/* Baloncuk gizli durumu */
.kirve-chatbot-bubble.hidden {
  display: none !important;
}

/* Kategoriler gizli durumu */
.kirve-chatbot-bubble-categories.hidden {
  display: none !important;
}
