/* LESAI Chat Widget Styles */
#lesai-chat-btn {
  position: fixed;
  bottom: 72px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border: none;
  cursor: pointer;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
#lesai-chat-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(124, 58, 237, 0.6);
}

#lesai-chat-window {
  position: fixed;
  bottom: 140px;
  right: 24px;
  width: 400px;
  height: 520px;
  background: #0d1117;
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 16px;
  z-index: 10001;
  display: none;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
  font-family: 'Inter', system-ui, sans-serif;
}
#lesai-chat-window.open { display: flex; }

#lesai-chat-header {
  background: linear-gradient(135deg, #1a1030, #0d1117);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(124, 58, 237, 0.2);
}
#lesai-chat-header .title {
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 600;
}
#lesai-chat-header .close-btn {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
}
#lesai-chat-header .close-btn:hover { color: #e2e8f0; }

#lesai-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#lesai-chat-messages::-webkit-scrollbar { width: 6px; }
#lesai-chat-messages::-webkit-scrollbar-track { background: transparent; }
#lesai-chat-messages::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

.lesai-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.5;
  color: #e2e8f0;
  word-wrap: break-word;
}
.lesai-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-bottom-right-radius: 4px;
}
.lesai-msg.bot {
  align-self: flex-start;
  background: rgba(124, 58, 237, 0.15);
  border: 1px solid rgba(124, 58, 237, 0.2);
  border-bottom-left-radius: 4px;
}
.lesai-msg.bot strong { color: #a855f7; }
.lesai-msg.bot a { color: #818cf8; text-decoration: underline; }
.lesai-msg.bot code { background: rgba(0,0,0,0.3); padding: 1px 4px; border-radius: 3px; font-size: 12px; }

.lesai-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 16px;
}
.lesai-typing span {
  width: 8px;
  height: 8px;
  background: #7c3aed;
  border-radius: 50%;
  animation: lesai-bounce 1.4s infinite;
}
.lesai-typing span:nth-child(2) { animation-delay: 0.2s; }
.lesai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes lesai-bounce {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

#lesai-chat-privacy {
  text-align: center;
  font-size: 11px;
  color: #64748b;
  padding: 4px 16px;
  background: rgba(0,0,0,0.3);
}

#lesai-chat-input-bar {
  display: flex;
  padding: 12px;
  gap: 8px;
  border-top: 1px solid rgba(124, 58, 237, 0.2);
  background: #0a0e14;
}
#lesai-chat-input {
  flex: 1;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 10px 12px;
  color: #e2e8f0;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
}
#lesai-chat-input:focus { border-color: #7c3aed; }
#lesai-chat-input::placeholder { color: #4a5568; }
#lesai-chat-send {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  border: none;
  border-radius: 8px;
  padding: 0 16px;
  color: white;
  font-size: 16px;
  cursor: pointer;
  transition: opacity 0.2s;
}
#lesai-chat-send:hover { opacity: 0.85; }
#lesai-chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

@media (max-width: 480px) {
  #lesai-chat-window {
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
    border-radius: 0;
  }
  #lesai-chat-btn { bottom: 120px; right: 16px; }
}
