.toggle {
  position: fixed;
  bottom: 90px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00D1FF, #0050FF);
  border: none;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 998;
  box-shadow: 0 0 20px rgba(0, 209, 255, 0.4);
  transition: all 0.3s ease;
  position: fixed;
}

[dir="rtl"] .toggle { right: auto; left: 24px; }

.toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 0 30px rgba(0, 209, 255, 0.6);
}

.togglePulse {
  position: absolute;
  top: 0; right: 0;
  width: 14px; height: 14px;
  background: var(--neon-orange);
  border-radius: 50%;
  border: 2px solid #0A0A0A;
  animation: glow-pulse 2s infinite;
}

/* Chat Window */
.window {
  position: fixed;
  bottom: 155px;
  right: 24px;
  width: 340px;
  height: 460px;
  background: rgba(13, 13, 20, 0.97);
  border: 1px solid rgba(0, 209, 255, 0.25);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 997;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 209, 255, 0.1);
  animation: fadeInUp 0.3s ease;
  backdrop-filter: blur(20px);
}

[dir="rtl"] .window { right: auto; left: 24px; }

.header {
  padding: 16px;
  background: linear-gradient(135deg, rgba(0, 80, 255, 0.15), rgba(0, 209, 255, 0.1));
  border-bottom: 1px solid rgba(0, 209, 255, 0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.headerInfo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 209, 255, 0.15);
  border: 1px solid rgba(0, 209, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.botName {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.online {
  font-size: 0.72rem;
  color: var(--success);
}

.close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition-fast);
}

.close:hover { color: var(--error); }

/* Messages */
.messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  display: flex;
  align-items: flex-end;
  gap: 8px;
}

.bot { justify-content: flex-start; }
.user { justify-content: flex-end; flex-direction: row-reverse; }

.msgAvatar {
  font-size: 0.9rem;
  flex-shrink: 0;
}

.bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.83rem;
  line-height: 1.5;
}

.bot .bubble {
  background: rgba(0, 209, 255, 0.1);
  border: 1px solid rgba(0, 209, 255, 0.15);
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
}

.user .bubble {
  background: linear-gradient(135deg, #00D1FF, #0050FF);
  color: #000;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.typing {
  display: flex;
  gap: 4px;
  padding: 10px 14px;
  background: rgba(0, 209, 255, 0.1);
  border: 1px solid rgba(0, 209, 255, 0.15);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
}

.typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--electric-blue);
  animation: typing-bounce 1.2s ease infinite;
}

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

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
}

/* Quick Actions */
.quickActions {
  padding: 8px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.quickBtn {
  padding: 5px 10px;
  border: 1px solid rgba(0, 209, 255, 0.25);
  border-radius: 20px;
  background: transparent;
  color: var(--electric-blue);
  font-size: 0.72rem;
  cursor: pointer;
  transition: var(--transition-fast);
}

.quickBtn:hover {
  background: rgba(0, 209, 255, 0.1);
}

/* Input */
.inputRow {
  padding: 12px;
  display: flex;
  gap: 8px;
  border-top: 1px solid rgba(255,255,255,0.06);
}

.input {
  flex: 1;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(0,209,255,0.2);
  border-radius: 12px;
  padding: 9px 14px;
  color: var(--text-primary);
  font-size: 0.83rem;
  outline: none;
  transition: var(--transition-fast);
}

.input:focus { border-color: var(--electric-blue); }
.input::placeholder { color: var(--text-muted); }

.sendBtn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--gradient-blue);
  color: #000;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
}

.sendBtn:hover { filter: brightness(1.15); }

@media (max-width: 480px) {
  .window { width: calc(100vw - 32px); right: 16px; bottom: 140px; }
  [dir="rtl"] .window { right: auto; left: 16px; }
}
