/* ========================================================
   Nexcore AI Live Chatbot Widget
   ======================================================== */

/* Floating Chatbot Toggle Button (Bottom Right) */
.nexcore-chat-toggle {
  position: fixed;
  bottom: 2.5rem;
  right: 2.5rem;
  width: 5.6rem;
  height: 5.6rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #090d18 0%, #101828 100%);
  border: 1.5px solid rgba(0, 240, 255, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 20px rgba(0, 240, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 9999;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.35s ease,
              border-color 0.3s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  outline: none;
}

@media (max-width: 767px) {
  .nexcore-chat-toggle {
    bottom: 1.8rem;
    right: 1.8rem;
    width: 5.0rem;
    height: 5.0rem;
  }
}

.nexcore-chat-toggle:hover {
  transform: scale(1.1);
  border-color: #00f0ff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 240, 255, 0.55);
}

.nexcore-chat-toggle:active {
  transform: scale(0.94);
}

/* Icons inside toggle button */
.nexcore-chat-toggle-icon,
.nexcore-chat-toggle .icon-close {
  width: 3.3rem;
  height: 3.3rem;
  color: #00f0ff;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nexcore-chat-toggle-icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 8px rgba(0, 240, 255, 0.6));
}

.nexcore-chat-toggle .icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.nexcore-chat-toggle.-open .nexcore-chat-toggle-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.nexcore-chat-toggle.-open .icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Online status pulse badge on toggle */
.nexcore-chat-badge {
  position: absolute;
  top: 0.2rem;
  right: 0.2rem;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: #10b981;
  border: 2px solid #090d18;
  box-shadow: 0 0 8px #10b981;
}

.nexcore-chat-badge::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.4);
  animation: badgePing 2s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes badgePing {
  0% { transform: scale(1); opacity: 0.8; }
  75%, 100% { transform: scale(2.2); opacity: 0; }
}

/* Floating Tooltip Pill */
.nexcore-chat-tooltip {
  position: fixed;
  bottom: 3.3rem;
  right: 8.8rem;
  background: rgba(10, 14, 24, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: #ffffff;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  font-size: 1.25rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  z-index: 9998;
  pointer-events: none;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
}

.nexcore-chat-toggle:hover ~ .nexcore-chat-tooltip,
.nexcore-chat-tooltip.-show {
  opacity: 1;
  transform: translateX(0);
}

/* Chatbot Window Container */
.nexcore-chat-window {
  position: fixed;
  bottom: 9.0rem;
  right: 2.5rem;
  width: 38rem;
  max-width: calc(100vw - 3rem);
  height: 56rem;
  max-height: calc(100vh - 11rem);
  background: rgba(10, 13, 22, 0.94);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 2.4rem;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.65), 0 0 1px rgba(0, 240, 255, 0.3);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
  font-family: inherit;
}

@media (max-width: 767px) {
  .nexcore-chat-window {
    bottom: 7.6rem;
    right: 1.5rem;
    width: calc(100vw - 3rem);
    height: calc(100vh - 9rem);
    max-height: 58rem;
    border-radius: 2rem;
  }
}

.nexcore-chat-window.-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

/* Window Header */
.nexcore-chat-header {
  padding: 1.6rem 2rem;
  background: linear-gradient(180deg, rgba(16, 22, 38, 0.9) 0%, rgba(10, 13, 22, 0.7) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  user-select: none;
}

.nexcore-chat-brand {
  display: flex;
  align-items: center;
  gap: 1.2rem;
}

.nexcore-chat-avatar {
  width: 3.8rem;
  height: 3.8rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2) 0%, rgba(0, 102, 255, 0.3) 100%);
  border: 1px solid rgba(0, 240, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 14px rgba(0, 240, 255, 0.25);
  position: relative;
  flex-shrink: 0;
}

.nexcore-chat-avatar svg {
  width: 2.6rem;
  height: 2.6rem;
}

.nexcore-chat-avatar-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: #10b981;
  border: 1.5px solid #0a0d16;
  box-shadow: 0 0 6px #10b981;
}

.nexcore-chat-title-group {
  display: flex;
  flex-direction: column;
}

.nexcore-chat-name {
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nexcore-chat-verified {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nexcore-chat-msg-avatar {
  width: 3.4rem;
  height: 3.4rem;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.18) 0%, rgba(0, 102, 255, 0.28) 100%);
  border: 1px solid rgba(0, 240, 255, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.2rem;
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.nexcore-chat-msg-avatar svg {
  width: 2.3rem;
  height: 2.3rem;
}

.nexcore-chat-status {
  font-size: 1.15rem;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
}

.nexcore-chat-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nexcore-chat-btn-icon {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  padding: 0.6rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s, color 0.2s;
}

.nexcore-chat-btn-icon:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.nexcore-chat-btn-icon svg {
  width: 1.6rem;
  height: 1.6rem;
}

/* Messages Body */
.nexcore-chat-body {
  flex: 1;
  padding: 1.8rem 1.6rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 240, 255, 0.3) transparent;
}

.nexcore-chat-body::-webkit-scrollbar {
  width: 5px;
}
.nexcore-chat-body::-webkit-scrollbar-thumb {
  background: rgba(0, 240, 255, 0.3);
  border-radius: 999px;
}

/* Timestamp Divider */
.nexcore-chat-time-divider {
  text-align: center;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.4);
  margin: 0.4rem 0;
  user-select: none;
}

/* Chat Messages */
.nexcore-chat-msg {
  display: flex;
  gap: 1rem;
  max-width: 86%;
  animation: msgFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

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

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

.nexcore-chat-bubble {
  padding: 1.2rem 1.5rem;
  border-radius: 1.8rem;
  font-size: 1.35rem;
  line-height: 1.45;
  word-break: break-word;
}

.nexcore-chat-msg.-bot .nexcore-chat-bubble {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-bottom-left-radius: 0.4rem;
}

.nexcore-chat-msg.-bot .nexcore-chat-bubble a {
  color: #00f0ff;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

.nexcore-chat-msg.-user .nexcore-chat-bubble {
  background: linear-gradient(135deg, #00f0ff 0%, #0088ff 100%);
  color: #040812;
  font-weight: 500;
  border-bottom-right-radius: 0.4rem;
  box-shadow: 0 4px 14px rgba(0, 240, 255, 0.3);
}

.nexcore-chat-meta {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 0.4rem;
  padding: 0 0.4rem;
}
.nexcore-chat-msg.-user .nexcore-chat-meta {
  text-align: right;
}

/* Suggestion Chips */
.nexcore-chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-top: 0.6rem;
}

.nexcore-chat-chip {
  background: rgba(0, 240, 255, 0.08);
  border: 1px solid rgba(0, 240, 255, 0.25);
  color: #00f0ff;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  font-size: 1.2rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
  user-select: none;
}

.nexcore-chat-chip:hover {
  background: #00f0ff;
  color: #050810;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.45);
  transform: translateY(-1px);
}

/* Typing Indicator */
.nexcore-chat-typing {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 1.1rem 1.4rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.8rem;
  border-bottom-left-radius: 0.4rem;
  width: fit-content;
}

.nexcore-chat-typing span {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: #00f0ff;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.nexcore-chat-typing span:nth-child(1) { animation-delay: -0.32s; }
.nexcore-chat-typing span:nth-child(2) { animation-delay: -0.16s; }

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

/* Quick WhatsApp Pill */
.nexcore-chat-wa-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.8rem;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  background: #25d366;
  color: #ffffff !important;
  text-decoration: none !important;
  font-size: 1.2rem;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
  transition: transform 0.2s, box-shadow 0.2s;
}

.nexcore-chat-wa-pill:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.5);
}

/* Input Form Area */
.nexcore-chat-footer {
  padding: 1.4rem 1.6rem;
  background: rgba(8, 10, 18, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nexcore-chat-form {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 0.4rem 0.6rem 0.4rem 1.6rem;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.nexcore-chat-form:focus-within {
  border-color: #00f0ff;
  box-shadow: 0 0 16px rgba(0, 240, 255, 0.25);
}

.nexcore-chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 1.35rem;
  font-family: inherit;
}

.nexcore-chat-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.nexcore-chat-send {
  width: 3.6rem;
  height: 3.6rem;
  border-radius: 50%;
  background: #00f0ff;
  color: #050812;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
  flex-shrink: 0;
}

.nexcore-chat-send:hover {
  transform: scale(1.08);
  background: #ffffff;
}

.nexcore-chat-send:active {
  transform: scale(0.92);
}

.nexcore-chat-send svg {
  width: 1.6rem;
  height: 1.6rem;
  transform: translateX(1px);
}

.nexcore-chat-tagline {
  text-align: center;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 0.7rem;
  user-select: none;
}
