/* ===== Syberra Chatbot Widget ===== */

#syberra-chat-toggle {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #E63946;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(230, 57, 70, 0.4);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#syberra-chat-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 32px rgba(230, 57, 70, 0.55);
}

#syberra-chat-toggle svg {
  width: 24px;
  height: 24px;
  fill: #fff;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

#syberra-chat-toggle .icon-close {
  display: none;
}

#syberra-chat-toggle.open .icon-chat {
  display: none;
}

#syberra-chat-toggle.open .icon-close {
  display: block;
}

/* ===== Chat Window ===== */

#syberra-chat-window {
  position: fixed;
  bottom: 96px;
  right: 28px;
  z-index: 9998;
  width: 360px;
  max-height: 540px;
  display: flex;
  flex-direction: column;
  background: #0f0f0f;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#syberra-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ===== Header ===== */

.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.chat-header-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #E63946, #c72d39);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.chat-header-avatar svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

.chat-header-info {
  flex: 1;
}

.chat-header-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #f0f0f0;
  line-height: 1.2;
}

.chat-header-status {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: #4caf50;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}

.chat-header-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4caf50;
  display: inline-block;
}

/* ===== Messages ===== */

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.08) transparent;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
}

.chat-message {
  display: flex;
  gap: 8px;
  animation: msgIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.chat-message.user {
  flex-direction: row-reverse;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  line-height: 1.55;
  color: #f0f0f0;
}

.chat-message.bot .chat-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom-left-radius: 4px;
}

.chat-message.user .chat-bubble {
  background: #E63946;
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* ===== Shimmer Typing Indicator ===== */

.chat-typing {
  display: flex;
  align-items: center;
  gap: 8px;
  animation: msgIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.chat-typing-bubble {
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

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

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

@keyframes typingPulse {
  0%, 60%, 100% { opacity: 0.3; transform: scale(0.8); }
  30%            { opacity: 1;   transform: scale(1.1); }
}

/* ===== Shimmer text (for bot name) ===== */

.shimmer-text {
  background: linear-gradient(
    90deg,
    #999999 0%,
    #f0f0f0 40%,
    #E63946 60%,
    #999999 100%
  );
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 2.5s linear infinite;
}

@keyframes shimmer {
  0%   { background-position: 100% center; }
  100% { background-position: 0% center; }
}

/* ===== Input ===== */

.chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

#syberra-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 9px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 13.5px;
  color: #f0f0f0;
  outline: none;
  resize: none;
  line-height: 1.4;
  max-height: 100px;
  transition: border-color 0.2s ease;
}

#syberra-chat-input::placeholder {
  color: #555;
}

#syberra-chat-input:focus {
  border-color: rgba(230, 57, 70, 0.4);
}

#syberra-chat-send {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #E63946;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s ease, transform 0.15s ease;
}

#syberra-chat-send:hover {
  background: #ff4d5a;
  transform: scale(1.05);
}

#syberra-chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

#syberra-chat-send svg {
  width: 16px;
  height: 16px;
  fill: #fff;
}

/* ===== Mobile ===== */

@media (max-width: 480px) {
  #syberra-chat-window {
    width: calc(100vw - 24px);
    right: 12px;
    bottom: 84px;
  }

  #syberra-chat-toggle {
    right: 16px;
    bottom: 20px;
  }
}
