* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  margin: 0;
  font-family: "Poppins", sans-serif;
  background-color: #f0f8ff;
}

.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.25);
  cursor: pointer;
  animation: bounce-mini 2.4s 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: 25px;
  width: 360px;
  height: 530px;
  background: url("./images/chatbox-bg.webp") center/cover no-repeat;
  border: 2px solid #005f99;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 45, 77, 0.35);
  z-index: 1000;
  font-family: "Poppins", sans-serif;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(24px) scale(0.92);
  transform-origin: bottom right;
  transition: width 0.3s ease, height 0.3s ease, right 0.3s ease,
    bottom 0.3s ease, opacity 0.28s cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbox.active {
  display: flex;
}

.chatbox.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.chatbox.maximized {
  width: 80vw;
  height: 80vh;
  right: 10vw;
  bottom: 10vh;
}

.chat-header {
  background: linear-gradient(120deg, #003f6b, #005f99 45%, #0089b3 100%);
  background-size: 200% 200%;
  animation: header-shimmer 8s ease infinite;
  color: white;
  padding: 10px 15px;
  border-radius: 13px 13px 0 0;
  font-weight: 700;
  letter-spacing: 0.3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@keyframes header-shimmer {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.chat-title {
  flex-grow: 1;
  display: flex;
  align-items: center;
  gap: 7px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3ddc84;
  box-shadow: 0 0 0 rgba(61, 220, 132, 0.6);
  animation: status-glow 2s infinite;
  flex-shrink: 0;
}

@keyframes status-glow {
  0% {
    box-shadow: 0 0 0 0 rgba(61, 220, 132, 0.6);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(61, 220, 132, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(61, 220, 132, 0);
  }
}

.chat-controls {
  display: flex;
  gap: 8px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: rgba(255, 255, 255, 0.6);
}

.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);
  animation: message-in 0.28s ease-out;
}

@keyframes message-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.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.8);
  align-self: flex-start;
  margin-right: auto;
  text-align: left;
  border-bottom-left-radius: 2px;
  position: relative;
  padding-bottom: 20px;
}

.chat-input {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px 15px;
  background-color: white;
  border-top: 1px solid rgba(0, 95, 153, 0.2);
}

.input-wrapper {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.input-wrapper input {
  padding: 12px;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 14px;
  width: 100%;
}

.input-warning {
  font-size: 10px;
  color: #004b7d;
  margin-top: 2px;
  margin-left: 4px;
}

.close-btn, .maximize-btn {
  background: transparent;
  color: white;
  border: none;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.close-btn:hover, .maximize-btn:hover {
  transform: scale(1.1);
}

.close-btn:hover {
  color: #f8d7da;
}

.maximize-btn:hover {
  color: rgb(202, 253, 202);
}

.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;
}

/* Scrollbar için özel tema rengi */
.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}
.chat-messages::-webkit-scrollbar-track:hover {
  background: rgba(255, 255, 255, 0.2);
}
.chat-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(#2a8dd8, #005f99);
  border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(#1f7fc3, #004b7d);
}

/* ─────────────── Feedback Butonları ─────────────── */
.chat-message.bot .feedback {
  position: absolute;
  bottom: 2px;
  right: 8px;
  display: flex;
  gap: 2px;
  margin-top: 6px;
  align-items: center;
  z-index: 2;
}

.feedback-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  transition: transform 0.1s ease;
  padding: 2px;
  display: block;
  line-height: 1;
  height: 24px;
  width: 24px;
}

.feedback-btn:hover {
  transform: scale(1.06);
}

.feedback-btn::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 120%;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 3px 7px;
  border-radius: 7px;
  white-space: nowrap;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 10;
}

.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-icon {
  cursor: pointer;
  font-size: 1.2rem;
  transition: color 0.2s ease;
}

.feedback-icon.like.selected,
.like-btn.active i,
.selected-like i.fa-solid {
  color: green;
  font-weight: bolder;
}
.feedback-icon.dislike.selected,
.dislike-btn.active i,
.selected-dislike i.fa-solid {
  color: red;
  font-weight: bolder;
}

.feedback-message {
  display: none;
  font-size: 0.9rem;
  color: #555;
}

.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;
}

/* Chat input GÖNDER ve DURDUR butonları */
#send-button, #stop-button {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 0;
  margin: 0;
  font-size: 20px;
  box-sizing: border-box;
}

#send-button {
  background: #005f99;
  color: white;
  border: none;
  font-weight: 600;
  transition: all 0.3s ease;
}

#send-button:hover {
  transform: scale(0.95);
  box-shadow: 0 0 12px rgba(0, 95, 153, 0.7);
}

#send-button.blocked {
  cursor: not-allowed;
  background: #bbb;
  color: #eee;
  position: relative;
}

#send-button.blocked::after {
  content: "🚫 Yanıt bekleyin";
  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;
}

#send-button.blocked:hover::after {
  opacity: 1;
}

#stop-button {
  background-color: #005f99;
  color: #fff;
  border: none;
  font-weight: bold;
  transition: background 0.2s;
}

#stop-button:hover {
  background: #c9302c;
}

#stop-button i {
  font-size: 16px;
}

.openai-powered {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 4px 10px;
  font-size: 12px;
  color: #888;
  background-color: white;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  gap: 4px;
  user-select: none;
}

.openai-powered .openai-logo {
  width: 16px;
  height: 16px;
  margin-right: 3px;
  vertical-align: middle;
  opacity: 0.7;
}

/* Responsive Tasarım */
@media screen and (max-width: 767px) {
  .maximize-btn {
    display: none;
  }
}

@media screen and (max-width: 450px) {
  .chatbox {
    width: 95vw;
    height: 75vh;
    right: 2.5vw;
    border-radius: 16px;
    bottom: 100px;
  }
  
  .chat-header {
    font-size: 14px;
    padding: 8px 10px;
  }
  
  .chat-messages {
    padding: 6px;
    max-height: calc(75vh - 130px);
    font-size: 13px;
    gap: 6px;
  }
  
  .chat-message {
    font-size: 13px;
    padding: 8px 12px;
    margin: 4px 0;
  }
  
  .chat-input {
    padding: 6px 8px;
    max-height: 60px;
  }
  
  .chat-input input {
    font-size: 13px;
    padding: 8px;
    border-radius: 6px;
  }
  
  #send-button, #stop-button {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    max-width: 38px;
    max-height: 38px;
    font-size: 18px;
    margin: 0 0 0 4px;
  }
  
  .input-warning {
    font-size: 10px;
    margin: 2px 0 0 4px;
  }
  
  .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;
  }
  
  .openai-powered {
    font-size: 11px;
    padding: 3px 8px;
  }
  
  .openai-powered .openai-logo {
    width: 16px;
    height: 16px;
    margin-right: 3px;
    vertical-align: middle;
    opacity: 0.7;
    content: url("https://openai.com/favicon.ico");
  }
  
  .chatbox.maximized {
    width: 100vw;
    height: 100vh;
    right: 0;
    bottom: 0;
    border-radius: 0;
  }
}

/* Yeni yazıyor animasyonu için stiller */
.yazıyor-balonu {
  display: flex;
  align-items: center;
  background-color: white;
  border-radius: 18px;
  padding: 8px 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  margin: 8px 0;
  max-width: max-content;
  position: relative;
}

.yazıyor-logo {
  width: 24px;
  height: 24px;
  min-width: 24px;
  border-radius: 50%;
  background-color: #005f99;
  margin-right: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.yazıyor-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.yazıyor-text {
  font-size: 14px;
  color: #333;
  display: flex;
  align-items: center;
}

.yazıyor-noktalar {
  display: inline-flex;
  margin-left: 4px;
}

.yazıyor-nokta {
  width: 5px;
  height: 5px;
  background-color: #005f99;
  border-radius: 50%;
  margin: 0 1px;
  animation: noktaZıpla 1.4s infinite ease-in-out;
}

.yazıyor-nokta:nth-child(1) {
  animation-delay: 0s;
}

.yazıyor-nokta:nth-child(2) {
  animation-delay: 0.2s;
}

.yazıyor-nokta:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes noktaZıpla {
  0%, 80%, 100% {
    transform: translateY(0);
    opacity: 0.6;
  }
  40% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

/* ─────────────── Hızlı Soru Chip'leri (aday öğrenciler için) ─────────────── */
.suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 10px 0;
  animation: message-in 0.35s ease-out;
}

.suggestion-chip {
  background: white;
  border: 1.5px solid #0089b3;
  color: #005f99;
  font-family: "Poppins", sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
  transition: all 0.18s ease;
}

.suggestion-chip:hover {
  background: linear-gradient(120deg, #005f99, #0089b3);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 95, 153, 0.35);
}

.suggestion-chip:active {
  transform: translateY(0) scale(0.97);
}