/* ===================================================
   Navisha Edu — Chatbot Styles
   =================================================== */

/* ---------- Floating Chat Button ---------- */
.navisha-chat-btn {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b4cf5 0%, #7c3aed 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(91, 76, 245, 0.45);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: chatBtnPulse 2.5s infinite;
}

.navisha-chat-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(91, 76, 245, 0.6);
}

.navisha-chat-btn svg {
  width: 28px;
  height: 28px;
  fill: #fff;
  transition: transform 0.3s ease;
}

.navisha-chat-btn.active svg.chat-icon { display: none; }
.navisha-chat-btn.active svg.close-icon { display: block; }
.navisha-chat-btn:not(.active) svg.chat-icon { display: block; }
.navisha-chat-btn:not(.active) svg.close-icon { display: none; }

@keyframes chatBtnPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(91, 76, 245, 0.45); }
  50% { box-shadow: 0 4px 35px rgba(91, 76, 245, 0.75), 0 0 0 12px rgba(91, 76, 245, 0.1); }
}

/* ---------- Chat Window ---------- */
.navisha-chat-window {
  position: fixed;
  bottom: 100px;
  right: 28px;
  width: 380px;
  height: 520px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 12px 50px rgba(0, 0, 0, 0.18);
  z-index: 99998;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.navisha-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ---------- Header ---------- */
.navisha-chat-header {
  background: linear-gradient(135deg, #5b4cf5 0%, #7c3aed 100%);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.navisha-chat-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navisha-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.navisha-chat-header-info h4 {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

.navisha-chat-header-info span {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.navisha-chat-header-info span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
}

.navisha-chat-close {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.2s;
}

.navisha-chat-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ---------- Messages Area ---------- */
.navisha-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8f9fb;
  scroll-behavior: smooth;
}

.navisha-chat-messages::-webkit-scrollbar {
  width: 5px;
}

.navisha-chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.navisha-chat-messages::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 10px;
}

/* ---------- Message Bubbles ---------- */
.navisha-msg {
  max-width: 85%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  animation: msgFadeIn 0.35s ease;
  word-wrap: break-word;
}

.navisha-msg.bot {
  align-self: flex-start;
  background: #fff;
  color: #333;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.navisha-msg.user {
  align-self: flex-end;
  background: linear-gradient(135deg, #5b4cf5 0%, #7c3aed 100%);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.navisha-msg.bot strong, .navisha-msg.bot b {
  color: #5b4cf5;
}

@keyframes msgFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Typing Indicator ---------- */
.navisha-typing {
  align-self: flex-start;
  background: #fff;
  border: 1px solid #e5e7eb;
  padding: 12px 20px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  animation: msgFadeIn 0.3s ease;
}

.navisha-typing span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  animation: typingBounce 1.2s infinite;
}

.navisha-typing span:nth-child(2) {
  animation-delay: 0.15s;
}

.navisha-typing span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-6px); opacity: 1; }
}

/* ---------- Quick Replies ---------- */
.navisha-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 4px;
  animation: msgFadeIn 0.4s ease;
}

.navisha-quick-reply {
  background: #f0edff;
  color: #5b4cf5;
  border: 1.5px solid #d4d0ff;
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.navisha-quick-reply:hover {
  background: #5b4cf5;
  color: #fff;
  border-color: #5b4cf5;
  transform: translateY(-1px);
}

/* ---------- Input Area ---------- */
.navisha-chat-input {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
  gap: 10px;
  flex-shrink: 0;
}

.navisha-chat-input input {
  flex: 1;
  border: 1.5px solid #e5e7eb;
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  background: #f8f9fb;
}

.navisha-chat-input input:focus {
  border-color: #5b4cf5;
  background: #fff;
}

.navisha-chat-input input::placeholder {
  color: #9ca3af;
}

.navisha-chat-send {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #5b4cf5 0%, #7c3aed 100%);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.navisha-chat-send:hover {
  transform: scale(1.08);
  box-shadow: 0 3px 12px rgba(91, 76, 245, 0.4);
}

.navisha-chat-send svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

/* ---------- Powered By ---------- */
.navisha-chat-powered {
  text-align: center;
  font-size: 11px;
  color: #9ca3af;
  padding: 6px 0;
  background: #fff;
  border-top: 1px solid #f3f4f6;
}

.navisha-chat-powered a {
  color: #5b4cf5;
  text-decoration: none;
  font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .navisha-chat-window {
    width: calc(100% - 16px);
    height: calc(100% - 120px);
    right: 8px;
    bottom: 96px;
    border-radius: 16px;
  }

  .navisha-chat-btn {
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
  }
}
