/* ====================================================
   NAZARWEB AI SALES ASSISTANT (AKILLI SATIŞ ASİSTANI)
   Aesthetic Pink / Magenta Glassmorphism Theme
==================================================== */

:root {
  --ai-primary: #b92763;
  --ai-primary-glow: rgba(185, 39, 99, 0.55);
  --ai-secondary: #de2c75;
  --ai-secondary-glow: rgba(222, 44, 117, 0.5);
  --ai-accent: #ff5e9c;
  --ai-dark-bg: rgba(15, 10, 24, 0.97);
  --ai-bubble-bot: rgba(255, 255, 255, 0.08);
  --ai-border: rgba(222, 44, 117, 0.38);
}

/* Widget Root */
.nazar-ai-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 99999;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: calc(100vw - 20px);
}

/* Teaser Greeting Bubble (Sitedeki İmza Pembemsi / Fuşya Degrade Zemin) */
.nazar-ai-teaser {
  position: absolute;
  bottom: 78px;
  right: 0;
  width: 325px;
  background: linear-gradient(135deg, #b92763 0%, #de2c75 50%, #ff5e9c 100%) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), 0 0 30px rgba(222, 44, 117, 0.65), 0 0 16px rgba(255, 94, 156, 0.45) !important;
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px) scale(0.95);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 10;
}

.nazar-ai-teaser.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.nazar-ai-teaser:hover {
  border-color: #ffffff;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.5), 0 0 35px rgba(222, 44, 117, 0.85), 0 0 20px rgba(255, 94, 156, 0.65) !important;
}

.teaser-avatar {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: visible;
}

.teaser-avatar .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.bot-status-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.85);
  animation: ringRotate 8s linear infinite;
  pointer-events: none;
}

@keyframes ringRotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.teaser-content {
  flex: 1;
}

.teaser-title {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff !important;
  margin-bottom: 3px;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.teaser-text {
  font-size: 12.5px !important;
  line-height: 1.42 !important;
  color: #ffffff !important;
  font-weight: 600 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.teaser-close {
  background: none;
  border: none;
  color: #ffffff !important;
  opacity: 0.85;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
  transition: all 0.2s;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.teaser-close:hover {
  color: #ffffff !important;
  opacity: 1;
  transform: scale(1.15);
}

/* Floating Trigger Button (Pembemsi / Fuşya Degrade) */
.nazar-ai-toggle {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b92763 0%, #de2c75 50%, #ff5e9c 100%);
  background-size: 200% 200%;
  animation: gradientShift 5s ease infinite;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  padding: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 25px rgba(222, 44, 117, 0.6);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.toggle-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

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

.nazar-ai-toggle:hover {
  transform: scale(1.08) translateY(-3px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 0 0 35px rgba(255, 94, 156, 0.75);
}

.toggle-pulse {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid #de2c75;
  opacity: 0;
  animation: pulseRadar 2.2s infinite;
  pointer-events: none;
}

@keyframes pulseRadar {
  0% { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.4); opacity: 0; }
}

.toggle-icon-open,
.toggle-icon-close {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

.toggle-icon-close {
  display: none;
}

.nazar-ai-toggle.active .toggle-icon-open {
  display: none;
}

.nazar-ai-toggle.active .toggle-icon-close {
  display: flex;
  font-size: 22px;
}

.online-indicator {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: #00ff88;
  border: 2.5px solid #08162b;
  border-radius: 50%;
}

.unread-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  background: linear-gradient(135deg, #b92763, #de2c75);
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
  animation: badgeBounce 1.5s infinite;
}

@keyframes badgeBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* Chat Modal Window (Derin Gece Zemin & Pembemsi Çerçeve) */
.nazar-ai-window {
  position: absolute;
  bottom: 84px;
  right: 0;
  width: 400px;
  height: 620px;
  max-height: calc(100vh - 110px);
  background: var(--ai-dark-bg);
  border: 1.5px solid var(--ai-border);
  border-radius: 24px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8), 0 0 35px rgba(222, 44, 117, 0.25);
  backdrop-filter: blur(30px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(25px) scale(0.94);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.nazar-ai-window.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Header */
.chat-header {
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(185, 39, 99, 0.35), rgba(222, 44, 117, 0.22));
  border-bottom: 1px solid rgba(222, 44, 117, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bot-avatar {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid #de2c75;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(222, 44, 117, 0.6);
  flex-shrink: 0;
}

.bot-avatar .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.status-dot {
  position: absolute;
  bottom: 0px;
  right: 0px;
  width: 12px;
  height: 12px;
  background: #00ff88;
  border: 2px solid #08162b;
  border-radius: 50%;
}

.header-text h4 {
  font-size: 15px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  letter-spacing: -0.2px;
}

.header-text p {
  font-size: 11.5px;
  color: #cbd5e1;
  margin: 2px 0 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
}

.pulse-green {
  width: 7px;
  height: 7px;
  background-color: #00ff88;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 6px #00ff88;
}

.chat-header-actions {
  display: flex;
  gap: 6px;
}

.header-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(222, 44, 117, 0.3);
  color: rgba(255, 255, 255, 0.85);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}

.header-btn:hover {
  background: #b92763;
  color: #ffffff;
  border-color: #de2c75;
  box-shadow: 0 0 10px rgba(222, 44, 117, 0.5);
}

/* Chat Body */
.chat-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-body::-webkit-scrollbar {
  width: 5px;
}

.chat-body::-webkit-scrollbar-thumb {
  background: rgba(222, 44, 117, 0.3);
  border-radius: 10px;
}

.chat-date-divider {
  text-align: center;
  margin-bottom: 6px;
}

.chat-date-divider span {
  font-size: 11px;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 14px;
  border-radius: 12px;
  letter-spacing: 0.3px;
  font-weight: 600;
}

.chat-messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Message Bubbles (Yüksek Kontrast & Kolay Okuma) */
.chat-msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: msgSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg-bot {
  align-self: flex-start;
}

.msg-bot .msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1.5px solid #de2c75;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
  overflow: hidden;
}

.msg-bot .msg-avatar .avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}

.msg-bot .msg-bubble {
  background: rgba(25, 20, 36, 0.94) !important;
  border: 1px solid rgba(222, 44, 117, 0.45) !important;
  color: #ffffff !important;
  padding: 13px 16px;
  border-radius: 18px 18px 18px 4px;
  font-size: 14px;
  line-height: 1.6;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  font-weight: 400;
}

.msg-bot .msg-bubble,
.msg-bot .msg-bubble p,
.msg-bot .msg-bubble span,
.msg-bot .msg-bubble div,
.msg-bot .msg-bubble li {
  color: #f3f4f6 !important;
}

.msg-bot .msg-bubble strong,
.msg-bot .msg-bubble b {
  color: #ffffff !important;
  font-weight: 700 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}

.msg-bot .msg-bubble i,
.msg-bot .msg-bubble em {
  color: #fbcfe8 !important;
}

.msg-bot .msg-bubble a {
  color: #38bdf8 !important;
  text-decoration: underline !important;
  font-weight: 700 !important;
}

.msg-bot .msg-bubble a:hover {
  color: #7dd3fc !important;
}

.msg-bot .msg-time {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 4px;
  padding-left: 2px;
}

.msg-user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.msg-user .msg-bubble {
  background: linear-gradient(135deg, #b92763 0%, #de2c75 100%) !important;
  color: #ffffff !important;
  padding: 12px 16px;
  border-radius: 18px 18px 4px 18px;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(185, 39, 99, 0.45);
}

.msg-user .msg-bubble,
.msg-user .msg-bubble * {
  color: #ffffff !important;
}

.msg-user .msg-bubble strong,
.msg-user .msg-bubble b {
  color: #ffffff !important;
  font-weight: 700 !important;
}

.msg-user .msg-time {
  font-size: 10.5px;
  color: #94a3b8;
  margin-top: 4px;
  text-align: right;
  padding-right: 2px;
}

.msg-user .msg-time i {
  color: #ff5e9c;
}

.chat-link {
  color: #ff5e9c !important;
  text-decoration: underline;
  font-weight: 700;
}

/* Typing Indicator */
.chat-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  margin-top: 4px;
}

.typing-bubble {
  background: var(--ai-bubble-bot);
  border: 1px solid rgba(222, 44, 117, 0.3);
  padding: 8px 14px;
  border-radius: 16px;
  display: flex;
  gap: 5px;
}

.typing-bubble .dot {
  width: 6px;
  height: 6px;
  background: #ff5e9c;
  border-radius: 50%;
  animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-bubble .dot:nth-child(2) { animation-delay: 0.2s; }
.typing-bubble .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1.1); opacity: 1; }
}

.typing-label {
  font-size: 11.5px;
  color: #cbd5e1;
  font-style: italic;
}

/* Quick Action Chips */
.chat-quick-chips {
  padding: 8px 16px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 145px;
  overflow-y: auto;
  border-top: 1px solid rgba(222, 44, 117, 0.15);
}

.chip-btn {
  background: rgba(185, 39, 99, 0.15);
  border: 1px solid rgba(222, 44, 117, 0.55);
  color: #ffffff !important;
  padding: 7px 13px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.chip-btn i {
  color: #ff5e9c;
  font-size: 12px;
}

.chip-btn:hover {
  background: linear-gradient(135deg, #b92763, #de2c75);
  border-color: #ff5e9c;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(222, 44, 117, 0.45);
}

.chip-btn:hover i {
  color: #ffffff;
}

/* WhatsApp CTA in Chat */
.chat-cta-box {
  margin-top: 12px;
}

.whatsapp-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  background: linear-gradient(135deg, #25d366, #128c7e);
  color: #ffffff !important;
  font-size: 13.5px;
  font-weight: 800;
  padding: 12px 18px;
  border-radius: 14px;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
  transition: all 0.3s ease;
}

.whatsapp-cta-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.6);
  color: #ffffff !important;
}

.whatsapp-cta-btn i {
  font-size: 18px;
}

/* Chat Footer & Input */
.chat-footer {
  padding: 12px 16px 14px;
  background: rgba(15, 10, 24, 0.95);
  border-top: 1px solid rgba(222, 44, 117, 0.2);
}

.chat-input-form {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(222, 44, 117, 0.4);
  border-radius: 25px;
  padding: 4px 6px 4px 16px;
  transition: all 0.3s ease;
}

.chat-input-form:focus-within {
  border-color: #ff5e9c;
  box-shadow: 0 0 15px rgba(222, 44, 117, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

.chat-input-form input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #ffffff !important;
  font-size: 13.5px;
  font-weight: 500;
}

.chat-input-form input::placeholder {
  color: #94a3b8;
}

.send-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #b92763, #de2c75);
  border: none;
  color: #ffffff;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 15px rgba(222, 44, 117, 0.6);
}

.chat-footer-note {
  font-size: 11px;
  color: #94a3b8;
  text-align: center;
  margin-top: 8px;
  letter-spacing: 0.2px;
}

.chat-footer-note strong {
  color: #ff5e9c;
}

/* Mobile Responsiveness */
@media (max-width: 575px) {
  .nazar-ai-widget {
    bottom: 18px;
    right: 18px;
  }
  .nazar-ai-window {
    width: calc(100vw - 32px);
    right: -2px;
    bottom: 74px;
    height: calc(100vh - 105px);
  }
  .nazar-ai-teaser {
    width: calc(100vw - 48px);
    right: 0;
  }
}
