/*
 * Atılım AVM - AI Chatbot Global Styles
 * Modern, Premium Gradient & Animated Pulse Version
 */

:root {
  --bot-color: #212121;          /* Ana Koyu Tema */
  --bot-gradient: linear-gradient(135deg, #6a1b9a 0%, #212121 100%);
  --bot-light: #fcfcfc;
  --user-color: #6a1b9a;         /* Kullanıcı Mesaj Balonu (Sitenin mor tonu) */
  --accent-color: #8e24aa;       /* Hover ve Link Rengi */
}

/* --- ANA CHAT BUTONU --- */
#atilim-chat-btn {
  position: fixed;
  bottom: 10% !important;        /* Alttan %10 yukarıda */
  right: 25px;
  width: 65px;
  height: 65px;
  background: var(--bot-gradient);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(106, 27, 154, 0.4);
  z-index: 9999999999 !important;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Yapay Zeka Nabız (Pulse) Animasyonu */
#atilim-chat-btn::before, #atilim-chat-btn::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  background: inherit;
  z-index: -1;
  opacity: 0.6;
}

#atilim-chat-btn::before { animation: ai-pulse 2s infinite; }
#atilim-chat-btn::after { animation: ai-pulse 2s infinite 0.5s; }

#atilim-chat-btn:hover {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 12px 30px rgba(106, 27, 154, 0.6);
  background: linear-gradient(135deg, #8e24aa 0%, #212121 100%);
}

#atilim-chat-btn svg {
  width: 30px;
  height: 30px;
  fill: white;
  animation: float 3s ease-in-out infinite;
}

/* --- CHAT PENCERESİ --- */
#atilim-chat-window {
  position: fixed;
  bottom: calc(10% + 80px) !important;
  right: 25px;
  width: 380px;
  height: 550px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  z-index: 9999999999 !important;
  opacity: 0;
  visibility: hidden;
  transform: translateY(30px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.05);
}

#atilim-chat-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* --- HEADER --- */
.atilim-chat-header {
  background: var(--bot-color);
  color: white;
  padding: 18px 20px;
  font-weight: 600;
  font-size: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-actions { display: flex; gap: 15px; align-items: center; }

.atilim-chat-clear, .atilim-chat-close { 
  cursor: pointer; 
  opacity: 0.8; 
  transition: opacity 0.2s; 
}

.atilim-chat-clear:hover, .atilim-chat-close:hover { opacity: 1; }
.atilim-chat-clear svg { width: 18px; fill: white; }
.atilim-chat-close { font-size: 24px; line-height: 1; }

/* --- MESAJ ALANI --- */
#atilim-chat-messages {
  flex: 1;
  padding: 20px 15px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
  background-color: var(--bot-light);
}

/* Özel Scrollbar */
#atilim-chat-messages::-webkit-scrollbar { width: 5px; }
#atilim-chat-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 10px; }

/* Mesaj Balonları */
.chat-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.5;
  animation: fadeIn 0.4s ease forwards;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.chat-msg.bot {
  background: white;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  border: 1px solid #eee;
}

.chat-msg.user {
  background: var(--user-color);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

/* Link Tasarımı */
.chat-msg.bot a {
  color: var(--user-color);
  font-weight: 700;
  text-decoration: underline;
}

/* --- INPUT ALANI --- */
.atilim-chat-input-area {
  display: flex;
  padding: 15px;
  background: white;
  border-top: 1px solid #f0f0f0;
}

#atilim-chat-input {
  flex: 1;
  border: 1px solid #e0e0e0;
  background: #f9f9f9;
  border-radius: 25px;
  padding: 12px 18px;
  outline: none;
  font-size: 14px;
}

#atilim-chat-input:focus { border-color: var(--user-color); background: white; }

#atilim-chat-send {
  background: var(--bot-color);
  border: none;
  border-radius: 50%;
  width: 42px;
  height: 42px;
  margin-left: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

#atilim-chat-send:hover { background: var(--user-color); }
#atilim-chat-send svg { width: 18px; height: 18px; fill: white; }

/* --- ANIMASYONLAR --- */
@keyframes ai-pulse { 0% { transform: scale(1); opacity: 0.6; } 100% { transform: scale(1.8); opacity: 0; } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Yazıyor Noktaları */
.typing-indicator { display: flex; gap: 4px; padding: 5px 0;}
.typing-indicator span { width: 6px; height: 6px; background: #bbb; border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both;}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* --- MOBİL UYUMLULUK --- */
@media (max-width: 480px) {
  #atilim-chat-window {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    bottom: 0 !important;
    right: 0;
    border-radius: 0;
  }
  #atilim-chat-btn {
    bottom: 10% !important;
    right: 20px;
    width: 60px;
    height: 60px;
  }
}
