/* ==========================================================================
   Kurul #10K — AI Live Support (Yapay Zeka Canlı Destek)
   ========================================================================== */

/* Floating Toggle Button */
.ai-chat-toggle-wrap {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-chat-bubble-hint {
  background: rgba(18, 3, 7, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 45, 135, 0.35);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 45, 135, 0.2);
  cursor: pointer;
  white-space: nowrap;
  animation: pulseFloat 3s ease-in-out infinite;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.ai-chat-bubble-hint:hover {
  transform: translateY(-2px);
  border-color: #ff2d87;
}

.ai-chat-toggle-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a8232e 0%, #ff2d87 100%);
  border: 2px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(168, 35, 46, 0.5), 0 0 20px rgba(255, 45, 135, 0.4);
  position: relative;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  outline: none;
}

.ai-chat-toggle-btn:hover {
  transform: scale(1.08) rotate(4deg);
  box-shadow: 0 14px 38px rgba(168, 35, 46, 0.7), 0 0 28px rgba(255, 45, 135, 0.6);
}

.ai-chat-toggle-btn .btn-icon-open,
.ai-chat-toggle-btn .btn-icon-close {
  position: absolute;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.ai-chat-toggle-btn .btn-icon-open {
  font-size: 26px;
  opacity: 1;
  transform: scale(1);
}

.ai-chat-toggle-btn .btn-icon-close {
  font-size: 22px;
  opacity: 0;
  transform: scale(0.5);
}

.ai-chat-toggle-wrap.chat-open .btn-icon-open {
  opacity: 0;
  transform: scale(0.5);
}

.ai-chat-toggle-wrap.chat-open .btn-icon-close {
  opacity: 1;
  transform: scale(1);
}

.ai-chat-toggle-btn .online-ping {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: #22c55e;
  border: 2px solid #0d0204;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
}

/* Chat Window Modal */
.ai-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 120px);
  background: rgba(15, 3, 6, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 45, 135, 0.3);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(255, 45, 135, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chat-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.ai-chat-header {
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(168, 35, 46, 0.5) 0%, rgba(255, 45, 135, 0.25) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ai-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ai-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #a8232e, #ff2d87);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
}

.ai-chat-avatar .avatar-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: #22c55e;
  border: 2px solid #140205;
  border-radius: 50%;
}

.ai-chat-title h4 {
  font-family: var(--font-display, 'Outfit', sans-serif);
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

.ai-chat-title span {
  font-size: 11px;
  color: #22c55e;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-chat-header-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: rgba(255, 255, 255, 0.7);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.ai-chat-header-btn:hover {
  background: rgba(255, 45, 135, 0.3);
  color: #fff;
  transform: scale(1.1);
}

/* Message Area */
.ai-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}

.ai-chat-messages::-webkit-scrollbar {
  width: 5px;
}
.ai-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 45, 135, 0.3);
  border-radius: 4px;
}

/* Chat Bubbles */
.ai-msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: fadeInMsg 0.3s ease forwards;
}

.ai-msg.bot {
  align-self: flex-start;
}

.ai-msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.ai-msg-bubble {
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
}

.ai-msg.bot .ai-msg-bubble {
  background: rgba(35, 8, 15, 0.85);
  border: 1px solid rgba(255, 45, 135, 0.25);
  color: #f1f1f1;
  border-bottom-left-radius: 4px;
}

.ai-msg.user .ai-msg-bubble {
  background: linear-gradient(135deg, #a8232e 0%, #ff2d87 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(255, 45, 135, 0.3);
}

.ai-msg-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 4px;
  text-align: right;
}

/* Quick Topic Chips inside chat */
.ai-quick-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.ai-quick-btn {
  background: rgba(255, 45, 135, 0.1);
  border: 1px solid rgba(255, 45, 135, 0.35);
  color: #ff99c8;
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.ai-quick-btn:hover {
  background: rgba(255, 45, 135, 0.25);
  border-color: #ff2d87;
  color: #fff;
  transform: translateX(3px);
}

/* Direct Action Button in message */
.ai-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, #5865f2 0%, #4752c4 100%);
  color: #fff !important;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 10px;
  margin-top: 10px;
  width: 100%;
  box-shadow: 0 4px 14px rgba(88, 101, 242, 0.4);
  transition: all 0.2s ease;
}

.ai-action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(88, 101, 242, 0.6);
  filter: brightness(1.1);
}

/* Typing Indicator */
.ai-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(35, 8, 15, 0.85);
  border: 1px solid rgba(255, 45, 135, 0.2);
  border-radius: 14px;
  width: fit-content;
}

.ai-typing-dot {
  width: 6px;
  height: 6px;
  background: #ff2d87;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.ai-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-typing-dot:nth-child(2) { animation-delay: -0.16s; }

/* Input Bar */
.ai-chat-input-bar {
  padding: 12px 14px;
  background: rgba(10, 2, 4, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  gap: 8px;
}

.ai-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 45, 135, 0.25);
  border-radius: 12px;
  padding: 10px 14px;
  color: #fff;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ai-chat-input:focus {
  border-color: #ff2d87;
  box-shadow: 0 0 10px rgba(255, 45, 135, 0.3);
}

.ai-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.ai-chat-send-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #a8232e 0%, #ff2d87 100%);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.ai-chat-send-btn:hover {
  transform: scale(1.06);
  filter: brightness(1.15);
}

/* Keyframes */
@keyframes fadeInMsg {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

@keyframes pulseFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
  .ai-chat-window {
    right: 12px;
    bottom: 84px;
    width: calc(100vw - 24px);
    height: 480px;
  }
  .ai-chat-bubble-hint {
    display: none;
  }
  .ai-chat-toggle-wrap {
    right: 16px;
    bottom: 16px;
  }
}
