/* ═══════════════════════════════════════════════════════════
   Boğaziçi Chatbot Widget — Floating Chat Bubble + Window
   ═══════════════════════════════════════════════════════════ */

/* ─── CHAT BUBBLE (FAB) ─── */
.chatbot-bubble {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0052CC, #00B8D9);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 30px rgba(0, 82, 204, 0.45), 0 0 0 0 rgba(0, 82, 204, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  animation: chatbot-pulse 3s ease-in-out infinite;
}

.chatbot-bubble:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 40px rgba(0, 82, 204, 0.55);
}

.chatbot-bubble svg {
  width: 28px;
  height: 28px;
  transition: transform 0.3s ease;
}

.chatbot-bubble.open svg {
  transform: rotate(90deg);
}

@keyframes chatbot-pulse {
  0%, 100% { box-shadow: 0 6px 30px rgba(0, 82, 204, 0.45), 0 0 0 0 rgba(0, 82, 204, 0.3); }
  50% { box-shadow: 0 6px 30px rgba(0, 82, 204, 0.45), 0 0 0 12px rgba(0, 82, 204, 0); }
}

/* ─── CHAT WINDOW ─── */
.chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 380px;
  height: 520px;
  background: rgba(10, 22, 40, 0.97);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 60px rgba(0, 82, 204, 0.1);
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chatbot-window.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ─── HEADER ─── */
.chatbot-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: linear-gradient(135deg, rgba(0, 82, 204, 0.15), rgba(0, 184, 217, 0.08));
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.chatbot-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0052CC, #00B8D9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}

.chatbot-header-info {
  flex: 1;
}

.chatbot-header-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  font-family: 'Inter', sans-serif;
}

.chatbot-header-status {
  font-size: 0.75rem;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 5px;
}

.chatbot-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}

.chatbot-close {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: #8899AA;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

/* ─── MESSAGES ─── */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chatbot-messages::-webkit-scrollbar {
  width: 4px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.chatbot-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 0.9rem;
  line-height: 1.6;
  font-family: 'Inter', sans-serif;
  animation: chatbot-msgIn 0.3s ease;
  word-wrap: break-word;
}

.chatbot-msg.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.06);
  color: #E8ECF1;
  border-bottom-left-radius: 4px;
}

.chatbot-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #0052CC, #0066FF);
  color: #fff;
  border-bottom-right-radius: 4px;
}

@keyframes chatbot-msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── TYPING INDICATOR ─── */
.chatbot-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
}

.chatbot-typing span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4C9AFF;
  animation: chatbot-bounce 1.4s ease-in-out infinite;
}

.chatbot-typing span:nth-child(2) { animation-delay: 0.15s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chatbot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ─── INPUT ─── */
.chatbot-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.chatbot-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 16px;
  color: #E8ECF1;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
  max-height: 80px;
  line-height: 1.4;
}

.chatbot-input::placeholder {
  color: #556677;
}

.chatbot-input:focus {
  border-color: rgba(0, 82, 204, 0.5);
}

.chatbot-send {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0052CC, #00B8D9);
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.chatbot-send:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(0, 82, 204, 0.4);
}

.chatbot-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.chatbot-send svg {
  width: 18px;
  height: 18px;
}

/* ─── POWERED BY ─── */
.chatbot-powered {
  text-align: center;
  padding: 6px;
  font-size: 0.65rem;
  color: #445566;
  font-family: 'Inter', sans-serif;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

/* ─── NOTIFICATION BADGE ─── */
.chatbot-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Inter', sans-serif;
  animation: chatbot-badgePop 0.3s ease;
}

@keyframes chatbot-badgePop {
  from { transform: scale(0); }
  to { transform: scale(1); }
}

/* ─── RESPONSIVE ─── */
@media (max-width: 480px) {
  .chatbot-window {
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
    max-height: 100dvh;
  }

  .chatbot-bubble {
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
  }
}
