/* ChatBot */

.chatbot-toggle {
  position: fixed;
  bottom: 25px;
  right: 25px;
  width: 65px;
  height: 65px;
  background-color: white;
  border-radius: 50%;
  padding: 2px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  animation: bounce-mini 1.2s infinite;
  z-index: 999;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

.chatbot-toggle img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 50%;
}

@keyframes bounce-mini {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-5px);
  }
}

.chatbox {
  display: none;
  position: fixed;
  bottom: 100px;
  right: 60px;
  width: 360px;
  height: 420px;
  background: url("https://aday.pirireis.edu.tr/public_html/wp-content/themes/aday/assets/images/chatbox-bg.png") center/cover no-repeat, white;
  border: 2px solid #005f99;
  border-radius: 15px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  font-family: "Poppins", sans-serif;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.5s ease, height 0.5s ease, right 0.5s ease,
    bottom 0.5s ease;
  padding-bottom: 0px; /* ya da düşük bir değer */

}

.chatbox.expanded {
  width: 600px;
  height: 600px;
}

.chat-header {
  background-color: #005f99;
  position: relative;
  font-size: 12px;
  color: white;
  padding: 10px 48px 18px 10px;
  border-radius: 15px 15px 0 0;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.designer-link {
  position: absolute;
  bottom: 2px;
  right: 10px;
  font-size: 10px;
  opacity: 0.6;
  font-style: italic;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}

.designer-link a {
  text-decoration: none;
  color: #ffffffcc;
}

.chat-header:hover .designer-link {
  opacity: 1;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  scroll-behavior: smooth;
  max-height: 300px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-message {
  max-width: 80%;
  margin: 6px 0;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
  word-wrap: break-word;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  color: #000;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.chat-message.user {
  background: rgba(189, 231, 255, 0.6);
  align-self: flex-end;
  margin-left: auto;
  text-align: right;
  border-bottom-right-radius: 2px;
}

.chat-message.bot {
  background: rgba(255, 255, 255, 0.6);
  align-self: flex-start;
  margin-right: auto;
  text-align: left;
  border-bottom-left-radius: 2px;
}

.chat-input {
  display: flex;
  background: linear-gradient(to right, #ffffff, #f0f8ff);
  border-top: 1px solid #ccc;
  border-radius: 0 0 15px 15px;
  z-index: 10;
  box-sizing: border-box;
  padding: 6px 10px 0px 10px; /* alt padding azaltıldı */
  
}

.chat-input input {
  flex: 1;
  border: 1px solid #ccc;
  padding: 10px;
  border-radius: 10px 0 0 10px;
  outline: none;
}

.chat-input button {
  background: #005f99;
  color: white;
  border: none;
  padding: 10px 15px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

.chat-input button:hover {
  transform: scale(0.95);
  box-shadow: 0 0 12px rgba(0, 95, 153, 0.7);
  transition: all 0.4s ease;
}

.close-btn {
  position: absolute;
  top: 4px;
  background: transparent;
  color: white !important;
  border: none;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s ease;
}

.close-btn {
  right: 8px;
}
.close-btn:hover {
  transform: scale(1.1);
  color: #f8d7da;
}
.typing-indicator {
  display: flex;
  align-items: center;
  padding: 0 10px;
  margin: 8px 0;
}

.typing-indicator span {
  height: 8px;
  width: 8px;
  margin: 0 2px;
  background: #005f99;
  border-radius: 50%;
  display: inline-block;
  animation: blink 1.4s infinite both;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}
.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes blink {
  0% {
    opacity: 0.2;
    transform: translateY(0);
  }
  20% {
    opacity: 1;
    transform: translateY(-4px);
  }
  100% {
    opacity: 0.2;
    transform: translateY(0);
  }
}

.chat-bubble {
  position: absolute;
  top: -45px;
  right: 0;
  background: white;
  color: #005f99;
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 12px;
  border: 1px solid #005f99;
  font-family: "Poppins", sans-serif;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
  z-index: 1001;
  display: none;
  opacity: 0;
}

.chat-bubble::after {
  content: "";
  position: absolute;
  bottom: -7px;
  right: 15px;
  border-width: 7px 7px 0;
  border-style: solid;
  border-color: #005f99 transparent transparent transparent;
}

@keyframes bubbleFade {
  0% {
    opacity: 0;
    transform: translateY(5px);
  }
  10% {
    opacity: 1;
    transform: translateY(0);
  }
  80% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-5px);
  }
}

.show-bubble {
  display: block;
  animation: bubbleFade 6s ease-in-out forwards;
}

.chatbot-toggle:hover .chat-bubble {
  display: block;
  animation: bubbleFade 6s ease-in-out forwards;
}
.maximize-btn {
  position: absolute;
  top: 2px; /* biraz yukarıda durması için */
  right: 25px; /* ❗ kapatma butonunun soluna yerleşmesi için */
  background: transparent;
  color: white;
  border: none;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.2s ease;
}

.maximize-btn:hover {
  transform: scale(1.1);
  color: rgb(202, 253, 202);
}
/* Chatbox büyütüldüğünde uygulanacak stiller */
.chatbox.maximized {
  width: 80vw;
  height: 80vh;
  right: 1.5vw;
  bottom: 17vh;
  transition: width 0.5s ease, height 0.5s ease, right 0.5s ease,
    bottom 0.5s ease;
  overflow: hidden; /* ✅ önemli */
  display: flex;
  flex-direction: column;
}
.chatbox.maximized .chat-input {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  border-radius: 0 0 12px 12px;
}
.chatbox.maximized .chat-messages {
  flex: 1;
  overflow-y: auto;
  max-height: 59.89vh; /* bunu ekleyerek sınırlandırdık */
}
/* Scrollbar için özel tema rengi */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.2); /* daha opak beyaz */
  border-radius: 10px;
}
.chat-messages::-webkit-scrollbar-track:hover {
  background: rgba(255, 255, 255, 0.2); /* daha opak beyaz */
}
.chat-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(#2a8dd8, #005f99);
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(#1f7fc3, #004b7d);
}
.chatbox.maximized .maximize-btn {
  top: 4px; /* ya da dilediğin başka bir değer */
}
/* ─────────────── Feedback Butonları ─────────────── */
.chat-message.bot {
  position: relative;
  padding-bottom: 20px; /* ikonlar için alt boşluk */
}

.chat-message.bot .feedback {
  position: absolute;
  bottom: 1px;
  right: 8px;
  display: flex;
  gap: 4px;
}

.chat-message.bot .feedback .feedback-btn {
  background: none; /* dikdörtgen arkaplan yok */
  border: none; /* kenarlık yok */
  padding: 4px; /* tıklanabilir alan korunsun */
  cursor: pointer;
}

.chat-message.bot .feedback .feedback-btn i {
  font-size: 15px;
  display: block;
  line-height: 1;
  transition: transform 0.3s ease;
}

.chat-message.bot .feedback .feedback-btn:hover i {
  transform: scale(1.2);
}
/* Butonları relative yapıyoruz ki tooltip mutlak pozisyona yerleşebilsin */
.feedback-btn {
  position: relative;
}

/* ::after ile içeriği oluştur, önce görünmez */
.feedback-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 120%; /* butonun üstünde */
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
  border-radius: 8px;
}

/* Hover’da göster */
.feedback-btn:hover::after,
.feedback-btn:hover::before {
  opacity: 1;
}

.chat-message.bot .feedback .like-btn {
  color: #4caf50;
}

.chat-message.bot .feedback .dislike-btn {
  color: #f44336;
}
/* Feedback bölümünü biraz hizala */
.feedback {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* İkonlara tıklanabilir imajı ver */
.feedback-icon {
  cursor: pointer;
  font-size: 1.2rem;
  transition: color 0.2s ease;
}

/* Seçildiğinde renk doldurma (solid icon) ve renk ayarı */
.feedback-icon.like.selected {
  color: green;
}

.feedback-icon.dislike.selected {
  color: red;
}

/* Teşekkür mesajını gizle, sonra JS ile göster */
.feedback-message {
  display: none;
  font-size: 0.9rem;
  color: #555;
}
/* Butonlar sabit, sıçrama olmadan */
.feedback {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.feedback-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.1s ease;
}
.feedback-btn:hover {
  transform: scale(1.1);
}
/* İkon dolu hali (renk): */
.selected-like i.fa-solid { color: green; }
.selected-dislike i.fa-solid { color: red; }

/* Toast bildirimi: */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 10px 20px;
  border-radius: 4px;
  opacity: 1;
  transition: opacity 0.5s ease;
  pointer-events: none;
  z-index: 9999;
}
.toast.fade-out {
  opacity: 0;
}
.like-btn.active i {
  color: green;
  font-weight: bolder;
}

.dislike-btn.active i {
  color: red;
  font-weight: bolder;
}
.chat-input {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px;
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.input-wrapper input {
  padding: 8px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
}

.input-warning {
  font-size: 10px;
  color: black;
  font-family: "Poppins", sans-serif;
  margin-top: 2px;       /* üst boşluk azaltıldı */
  margin-bottom: 0px;    /* alt boşluk eklendi ama çok az */
  margin-left: 4px;      /* sola hizalama için */
  color: #004b7d;
}
/* Mobil cihazlarda büyütme butonunu gizle */
@media (max-width: 767px) {
  .maximize-btn {
    display: none !important;
  }
}

/* Responsive Tasarım */
/* Mobil cihazlar için özel görünüm (örnek: 6.4 inç telefonlar) */
@media screen and (max-width: 450px) {
  .chatbox {
    width: 95vw !important;
    height: 65vh !important;
    right: 2.5vw !important;
    /* bottom: 5vh !important; */
    border-radius: 16px !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
    overflow: hidden !important;
    position: fixed;
    bottom: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }

  .chat-header {
    font-size: 14px;
    padding: 10px 38px 20px 10px;
  }

  .chat-messages {
    padding: 6px;
    max-height: 55vh;
    font-size: 13px;
    gap: 6px;
    overflow-y: auto;
  }

  .chat-message {
    font-size: 13px;
    padding: 8px 12px;
    margin: 4px 0;
  }

  .chat-input {
    /* DEĞİŞTİRİLEN KISIM */
    display: flex;         /* flex yapalım */
    flex-direction: row;   /* alt alta değil, yan yana */
    align-items: start;   /* dikey hizalama */
    gap: 6px;
    padding: 6px 8px !important;
    max-height: 60px; /* örnek değer */
    overflow: hidden;
  }

  .chat-input input {
    font-size: 13px;
    padding: 8px;
    border-radius: 6px !important;
    flex: 1; /* input alanı genişlesin */
  }

  .chat-input button {
    /* DEĞİŞTİRİLEN KISIM */
    width: auto; /* tüm satırı kaplamasın */
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 8px !important;
    white-space: nowrap; /* taşmasın */
    margin-bottom: 0 !important;
  }

  .input-warning {
    font-size: 10px;
    margin-top: 2px;
    margin-bottom: 0px;
    margin-left: 2px;
    margin: 0 !important;
    padding: 0 !important;
  }

  .chat-message.bot .feedback {
    right: 6px;
    gap: 4px;
  }

  .feedback-btn i {
    font-size: 14px;
  }

  .chatbot-toggle {
    width: 60px;
    height: 60px;
    bottom: 20px;
    right: 20px;
  }

  .chat-bubble {
    font-size: 10px;
    right: 0px;
    top: -40px;
  }
  @media screen and (max-width: 450px) {
  .chatbox {
    width: 95vw !important;
    height: 65vh !important;
    right: 2.5vw !important;
    bottom: 0 !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
    position: fixed;
  }

  .chat-input button {
    margin-bottom: 0 !important; /* ✅ düzeltildi */
  }

  .input-warning {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
}
/* Buton kilitliyken kırmızı engel */
#send-button.blocked {
  position: relative;
  cursor: not-allowed;
}

/* Emoji tooltip */
#send-button.blocked::after {
  content: "🚫 Cevap tamamlanmadan gönderilemez";
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: #ff4d4d;
  color: white;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 0.85rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1000;
}

/* Hover'da göster */
#send-button.blocked:hover::after {
  opacity: 1;
}

}