/* ============================================
   PHISHNET CHATBOT WIDGET STYLES - PREMIUM
   Professional Design with Advanced Features
============================================ */

#chatbot-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: 'Inter', sans-serif;
}

/* ========== Greeting Message Bubble ========== */
.chatbot-greeting-bubble {
  position: absolute;
  bottom: 80px;
  right: 0;
  background: #1a1a2e;
  color: #ffffff;
  padding: 14px 20px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.1);
  min-width: 200px;
  max-width: 280px;
  width: max-content;
  z-index: 999;
  opacity: 1;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: greetingBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: block;
  visibility: visible;
}

.chatbot-greeting-bubble::after {
  content: '';
  position: absolute;
  bottom: -9px;
  right: 24px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid #1a1a2e;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.1));
}

.chatbot-greeting-bubble p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  font-weight: 500;
  color: #ffffff;
  white-space: nowrap;
}

.chatbot-greeting-bubble.hidden {
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  visibility: hidden;
}

@keyframes greetingBounce {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(0.8);
  }
  60% {
    opacity: 1;
    transform: translateY(-5px) scale(1.05);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ========== Floating Chat Icon ========== */
.chatbot-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #0B63D9 0%, #00B7D9 100%);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 
    0 8px 32px rgba(11, 99, 217, 0.5),
    0 0 20px rgba(0, 255, 136, 0.3),
    0 0 40px rgba(11, 99, 217, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: floatPulse 2.5s ease-in-out infinite;
  position: relative;
  overflow: visible;
}

/* Gradient glow border wrapper */
.chatbot-icon::after {
  content: '';
  position: absolute;
  top: -5px;
  left: -5px;
  right: -5px;
  bottom: -5px;
  background: conic-gradient(
    from 0deg,
    #00FF88,
    #0B63D9,
    #00B7D9,
    #00FF88
  );
  border-radius: 50%;
  z-index: -1;
  opacity: 0.7;
  filter: blur(12px);
  animation: pulseGlow 2s ease-in-out infinite, rotateGlow 4s linear infinite;
}

@keyframes pulseGlow {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

@keyframes rotateGlow {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.chatbot-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #00B7D9 0%, #0B63D9 100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  border-radius: 50%;
}

.chatbot-icon:hover {
  transform: scale(1.15) translateY(-5px);
  box-shadow: 0 12px 40px rgba(11, 99, 217, 0.7);
}

.chatbot-icon:hover::before {
  opacity: 1;
}

.chatbot-icon svg {
  position: relative;
  z-index: 1;
  transition: transform 0.4s ease;
  width: 40px;
  height: 40px;
  display: block;
}

.chatbot-icon:hover svg {
  transform: rotate(10deg) scale(1.1);
}

@keyframes floatPulse {
  0%, 100% {
    box-shadow: 0 8px 32px rgba(11, 99, 217, 0.5);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 12px 40px rgba(11, 99, 217, 0.8);
    transform: translateY(-8px);
  }
}

/* ========== Chat Window ========== */
.chatbot-window {
  position: fixed;
  bottom: 90px;
  right: 60px; /* tighter spacing to launcher */
  width: 420px;
  max-width: calc(100vw - 40px);
  height: 580px;
  max-height: calc(100vh - 140px);
  background: linear-gradient(135deg, #0f0f10 0%, #0a0a0b 100%);
  border: 1px solid rgba(11, 99, 217, 0.25);
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7), 0 0 40px rgba(11, 99, 217, 0.2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: bottom right;
  backdrop-filter: blur(10px);
}

.chatbot-window.hidden {
  opacity: 0;
  transform: scale(0.85) translateY(30px);
  pointer-events: none;
}

/* Opening animation - expands out from launcher */
@keyframes chatbotOpen {
  0% {
    opacity: 0;
    transform: scale(0.1) translateY(60px) translateX(30px);
    filter: blur(8px);
  }
  50% {
    opacity: 0.7;
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0) translateX(0);
    filter: blur(0);
  }
}

/* Closing animation */
@keyframes chatbotClose {
  0% {
    opacity: 1;
    transform: scale(1) translateY(0) translateX(0);
  }
  100% {
    opacity: 0;
    transform: scale(0.1) translateY(60px) translateX(30px);
    filter: blur(8px);
  }
}

.chatbot-window.opening {
  animation: chatbotOpen 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.chatbot-window.closing {
  animation: chatbotClose 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

/* ========== Header ========== */
.chatbot-header {
  background: linear-gradient(90deg, #0a0d16 0%, #0c162b 45%, #0b3170 100%);
  padding: 18px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(11, 99, 217, 0.3);
  position: relative;
  overflow: hidden;
}

.chatbot-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  50% { left: 100%; }
  100% { left: 100%; }
}

.chatbot-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.chatbot-avatar {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #0B63D9, #00B7D9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  color: white;
  box-shadow: 0 4px 15px rgba(11, 99, 217, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.chatbot-title h3 {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  letter-spacing: 0.5px;
}

.chatbot-status {
  font-size: 12px;
  color: #00FF88;
  margin: 0;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chatbot-status::before {
  content: '';
  width: 6px;
  height: 6px;
  background: #00FF88;
  border-radius: 50%;
  animation: blink 2s infinite;
}

@keyframes blink {
  0%, 50%, 100% { opacity: 1; }
  25%, 75% { opacity: 0.5; }
}

.chatbot-actions {
  display: flex;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.chatbot-action-btn {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(0, 0, 0, 0.55);
  color: #e5e7eb;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chatbot-action-btn svg {
  stroke: #e2e8f0;
  opacity: 0.9;
  transition: stroke 0.2s ease, opacity 0.2s ease;
  stroke-width: 2.4;
}

.chatbot-action-btn:hover {
  background: rgba(11, 99, 217, 0.2);
  color: #f8fafc;
  border-color: rgba(0, 0, 0, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(11, 99, 217, 0.3);
}

.chatbot-action-btn:hover svg {
  stroke: #cbd5e1;
  opacity: 1;
}

/* ========== Messages Area ========== */
.chatbot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: linear-gradient(180deg, rgba(11, 11, 11, 0.8) 0%, rgba(15, 15, 16, 0.8) 100%);
  position: relative;
}

.chatbot-messages::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 0%, rgba(11, 99, 217, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

.chatbot-messages::-webkit-scrollbar {
  width: 6px;
}

.chatbot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chatbot-messages::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(11, 99, 217, 0.3) 0%, rgba(0, 183, 217, 0.2) 100%);
  border-radius: 3px;
  transition: all 0.3s ease;
}

.chatbot-messages::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(11, 99, 217, 0.6) 0%, rgba(0, 183, 217, 0.5) 100%);
}

.chatbot-message {
  display: flex;
  gap: 10px;
  animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  align-items: flex-end;
  position: relative;
  z-index: 1;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


.message-avatar {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #0B63D9, #00B7D9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
  overflow: hidden;
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 12px rgba(11, 99, 217, 0.4);
  border: 2px solid rgba(11, 99, 217, 0.3);
  transition: all 0.3s ease;
}

.message-avatar.bot {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
}

.message-avatar.bot svg {
  width: 32px;
  height: 32px;
  display: block;
}

.message-avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(11, 99, 217, 0.6);
  border-color: rgba(11, 99, 217, 0.6);
}

.user-message .message-avatar {
  background: linear-gradient(135deg, #1a1a2e, #16213e);
  border-color: rgba(11, 99, 217, 0.5);
}

.message-content {
  flex: 1;
  background: linear-gradient(135deg, rgba(11, 99, 217, 0.15) 0%, rgba(0, 183, 217, 0.08) 100%);
  padding: 12px 18px;
  border-radius: 18px;
  border: 1px solid rgba(11, 99, 217, 0.3);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(11, 99, 217, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  max-width: 85%;
}

.message-content:hover {
  background: linear-gradient(135deg, rgba(11, 99, 217, 0.22) 0%, rgba(0, 183, 217, 0.12) 100%);
  border-color: rgba(11, 99, 217, 0.5);
  box-shadow: 0 6px 20px rgba(11, 99, 217, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.user-message .message-content {
  background: linear-gradient(135deg, rgba(11, 99, 217, 0.3) 0%, rgba(0, 183, 217, 0.15) 100%);
  border-color: rgba(11, 99, 217, 0.5);
  border-bottom-right-radius: 6px;
  box-shadow: 0 4px 16px rgba(11, 99, 217, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.user-message .message-content:hover {
  background: linear-gradient(135deg, rgba(11, 99, 217, 0.4) 0%, rgba(0, 183, 217, 0.22) 100%);
  border-color: rgba(11, 99, 217, 0.6);
  box-shadow: 0 6px 20px rgba(11, 99, 217, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.bot-message .message-content {
  border-bottom-left-radius: 6px;
}

.message-content p {
  margin: 0;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  font-weight: 400;
  letter-spacing: 0.2px;
}

.message-content strong {
  font-weight: 700;
  color: #ffffff;
}

.message-content .bullet-dot {
  color: #38bdf8;
  margin-right: 6px;
}

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

.message-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 85%;
}

.user-message .message-wrapper {
  align-items: flex-end;
}

.bot-message .message-wrapper {
  align-items: flex-start;
}

/* Attachments positioned at top, above message text */
.message-attachments-top {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.user-message .message-attachments-top {
  justify-content: flex-end;
}

.bot-message .message-attachments-top {
  justify-content: flex-start;
}

.bot-message .message-content {
  background: linear-gradient(135deg, rgba(11, 99, 217, 0.1) 0%, rgba(0, 183, 217, 0.05) 100%);
  border-color: rgba(11, 99, 217, 0.2);
}

.bot-message .message-content:hover {
  background: linear-gradient(135deg, rgba(11, 99, 217, 0.15) 0%, rgba(0, 183, 217, 0.08) 100%);
}

/* ========== Typing Indicator ========== */
.chatbot-typing {
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #9ca3af;
  font-size: 12px;
  letter-spacing: 0.5px;
}

.chatbot-typing .typing-dot {
  width: 8px;
  height: 8px;
  background: linear-gradient(135deg, #0B63D9, #00B7D9);
  border-radius: 50%;
  display: inline-block;
  animation: typingBlink 1s infinite ease-in-out;
  box-shadow: 0 2px 8px rgba(11, 99, 217, 0.4);
}

.chatbot-typing .typing-dot:nth-child(2) { animation-delay: 0.15s; }
.chatbot-typing .typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes typingBlink {
  0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

/* ========== Input Area ========== */
.chatbot-input-area {
  padding: 16px;
  background: linear-gradient(180deg, #0f0f10 0%, #0a0a0b 100%);
  border-top: 1px solid rgba(11, 99, 217, 0.2);
  display: flex;
  gap: 10px;
  backdrop-filter: blur(10px);
}

.chatbot-attachment-preview {
  display: flex;
  margin: 0 0 8px 0;
}

.chatbot-attachment-preview.hidden {
  display: none;
}

.chatbot-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 6px 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.chatbot-attachment-chip .chip-thumb {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chatbot-attachment-chip .chip-text {
  font-size: 12px;
  color: #d9e2ff;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatbot-attachment-chip .chip-remove {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 18px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
  transition: color 0.2s ease;
}

.chatbot-attachment-chip .chip-remove:hover {
  color: #fff;
}

/* Bot eye wink animation */
.chatbot-icon .bot-eye {
  transform-origin: center center;
  animation: bot-wink 4s infinite ease-in-out;
}

.chatbot-icon .bot-eye.right {
  animation-delay: 1.2s;
}

@keyframes bot-wink {
  0%, 80%, 100% { transform: scaleY(1); }
  82%, 88% { transform: scaleY(0.1); }
  90% { transform: scaleY(1); }
}

#chatbot-input {
  flex: 1;
  background: rgba(30, 30, 35, 0.8);
  border: 1.5px solid rgba(11, 99, 217, 0.2);
  border-radius: 24px;
  padding: 12px 18px;
  color: #ffffff;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

#chatbot-input:focus {
  border-color: #0B63D9;
  background: rgba(30, 30, 35, 1);
  box-shadow: 0 0 0 3px rgba(11, 99, 217, 0.15), inset 0 1px 3px rgba(0, 0, 0, 0.5);
  transform: translateY(-2px);
}

#chatbot-input::placeholder {
  color: #555555;
}

.chatbot-send-btn,
.chatbot-attach-btn {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #0B63D9, #00B7D9);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  flex-shrink: 0;
  box-shadow: 0 4px 15px rgba(11, 99, 217, 0.4);
  position: relative;
  overflow: hidden;
}

.chatbot-send-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.chatbot-send-btn:hover {
  transform: scale(1.1) translateY(-3px);
  box-shadow: 0 6px 25px rgba(11, 99, 217, 0.6);
}

.chatbot-send-btn:active::before {
  width: 300px;
  height: 300px;
}

.chatbot-send-btn:active {
  transform: scale(0.95);
}

.chatbot-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: 0 2px 8px rgba(11, 99, 217, 0.2);
}

.chatbot-attach-btn {
  background: linear-gradient(135deg, #1f2937, #111827);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.45);
}

.chatbot-send-btn svg {
  position: relative;
  z-index: 1;
  transition: transform 0.3s ease;
}

.chatbot-send-btn:hover svg {
  transform: translateX(2px) scale(1.1);
}

.chatbot-attachments-container {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.chatbot-attachment-thumb {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  width: 60px;
  height: 60px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

.chatbot-attachment-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.chatbot-attachment-caption {
  padding: 6px 8px;
  font-size: 11px;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.25);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

/* ========== Mobile Responsive ========== */
@media (max-width: 480px) {
  .chatbot-window {
    width: calc(100vw - 20px);
    height: calc(100vh - 100px);
    max-height: calc(100vh - 100px);
    bottom: 10px;
    right: 10px;
    border-radius: 16px;
  }

  #chatbot-container {
    bottom: 10px;
    right: 10px;
  }

  .chatbot-icon {
    width: 56px;
    height: 56px;
  }

  .chatbot-greeting-bubble {
    bottom: 75px;
    max-width: 220px;
    padding: 12px 16px;
    font-size: 13px;
  }

  .chatbot-greeting-bubble::after {
    right: 18px;
  }

/* Chat Duration Notice */
.chat-duration-notice {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(147, 51, 234, 0.15));
  border: 1px solid rgba(59, 130, 246, 0.3);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 12px 12px 0 12px;
  font-size: 13px;
  color: #a0aec0;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.chat-notice-content {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.notice-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.notice-text {
  flex: 1;
  font-weight: 500;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

  .chatbot-header {
    padding: 14px 16px;
  }

  .chatbot-avatar {
    width: 40px;
    height: 40px;
  }

  .message-avatar {
    width: 28px;
    height: 28px;
  }
}

/* ========== Utility Classes ========== */
.hidden {
  display: none !important;
}

