/* ═══════════════════════════════════════════════════════════════
   FICER AI Chatbot - Widget Styles
   ═══════════════════════════════════════════════════════════════ */

:root {
  --ficer-primary: #0066CC;
  --ficer-primary-dark: #0052A3;
  --ficer-primary-light: #0077ED;
  --ficer-accent: #00acc1;
  --ficer-success: #28a745;
  --ficer-bg: #ffffff;
  --ficer-bg-light: #f8f9fa;
  --ficer-text: #2c3e50;
  --ficer-text-light: #6c757d;
  --ficer-border: #e9ecef;
  --ficer-shadow: 0 8px 32px rgba(0, 102, 204, 0.15);
  --ficer-shadow-lg: 0 16px 48px rgba(0, 102, 204, 0.25);
}

/* ══════════════════════════════════════════════════════════════
   FICER Chatbot Widget - Floating Button
   ══════════════════════════════════════════════════════════════ */

.ficer-chat-button {
  position: fixed;
  bottom: 95px;
  right: 0px;
  width: 120px;
  height: 120px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: visible;
}

.ficer-chat-button:hover {
  transform: scale(1.08) translateY(-5px);
}

.ficer-chat-button:active {
  transform: scale(0.95);
}

.button-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  background: #ff4757;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(255, 71, 87, 0.5);
  animation: bounce 2s infinite;
}

@keyframes bounce {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-4px);
  }
}

/* ══════════════════════════════════════════════════════════════
   3D Robot Avatar - Premium Animated
   ══════════════════════════════════════════════════════════════ */

.robot-container {
  position: relative;
  width: 100%;
  height: 100%;
  animation: smoothFloat 4s ease-in-out infinite;
}

@keyframes smoothFloat {

  0%,
  100% {
    transform: translateY(0px) rotate(-2deg);
  }

  25% {
    transform: translateY(-8px) rotate(1deg);
  }

  50% {
    transform: translateY(-12px) rotate(3deg);
  }

  75% {
    transform: translateY(-8px) rotate(1deg);
  }
}

.robot {
  position: relative;
  width: 100%;
  height: 100%;
  background-image: url('../Images/robot.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 6px 20px rgba(0, 230, 255, 0.5)) drop-shadow(0 2px 8px rgba(0, 180, 255, 0.3));
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: subtleGlow 3s ease-in-out infinite;
}

@keyframes subtleGlow {

  0%,
  100% {
    filter: drop-shadow(0 6px 20px rgba(0, 230, 255, 0.5)) drop-shadow(0 2px 8px rgba(0, 180, 255, 0.3));
  }

  50% {
    filter: drop-shadow(0 8px 28px rgba(0, 230, 255, 0.7)) drop-shadow(0 4px 12px rgba(0, 180, 255, 0.5));
  }
}

.ficer-chat-button:hover .robot {
  filter: drop-shadow(0 12px 35px rgba(0, 230, 255, 0.8)) drop-shadow(0 6px 16px rgba(0, 200, 255, 0.6));
  transform: scale(1.15) rotate(-5deg);
}

.robot-container::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 8px;
  background: radial-gradient(ellipse, rgba(0, 230, 255, 0.4) 0%, transparent 70%);
  border-radius: 50%;
  animation: glowPulse 3s ease-in-out infinite;
}

@keyframes glowPulse {

  0%,
  100% {
    opacity: 0.5;
    transform: translateX(-50%) scaleX(1);
  }

  50% {
    opacity: 0.8;
    transform: translateX(-50%) scaleX(1.2);
  }
}

.robot-head,
.robot-antenna,
.robot-eyes,
.robot-eye,
.robot-mouth,
.robot-body,
.robot-light {
  display: none;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

/* ══════════════════════════════════════════════════════════════
   FICER Chatbot Widget - Dialog Window
   ══════════════════════════════════════════════════════════════ */

.ficer-chat-dialog {
  position: fixed;
  bottom: 30px;
  right: 120px;
  width: 380px;
  height: 580px;
  max-height: calc(100vh - 60px);
  background: var(--ficer-bg);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 102, 204, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  z-index: 999998;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: scale(0.85) translateX(30px) rotateY(15deg);
  transform-style: preserve-3d;
  perspective: 1000px;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
  border: 2px solid rgba(0, 102, 204, 0.1);
}

.ficer-chat-dialog.open {
  opacity: 1;
  transform: scale(1) translateX(0) rotateY(0deg);
  pointer-events: all;
}

/* Chat Header */
.chat-header {
  background: linear-gradient(135deg, #0066CC 0%, #0052A3 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 4px 16px rgba(0, 102, 204, 0.3),
    inset 0 -1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-avatar {
  width: 42px;
  height: 42px;
  background: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.header-avatar img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.header-info h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
}

.status-text {
  font-size: 12px;
  opacity: 0.95;
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  background: var(--ficer-success);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.header-btn {
  width: 32px;
  height: 32px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.header-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.header-btn svg {
  width: 16px;
  height: 16px;
}

/* Chat Messages Area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--ficer-bg-light);
}

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

.chat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.chat-message {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: messageSlideIn 0.3s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.message-avatar.bot {
  background: linear-gradient(135deg, var(--ficer-primary), var(--ficer-primary-light));
  color: white;
}

.message-avatar.user {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: white;
  font-size: 13px;
  font-weight: 600;
}

.message-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.message-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.chat-message.bot .message-bubble {
  background: white;
  color: var(--ficer-text);
  border: 1px solid var(--ficer-border);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.08);
}

.chat-message.user .message-bubble {
  background: linear-gradient(135deg, #0066CC 0%, #0052A3 100%);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
}

.message-bubble a {
  color: #0066cc;
  text-decoration: underline;
  font-weight: 600;
}

.chat-message.user .message-bubble a {
  color: #ffffff;
}

.message-time {
  font-size: 10px;
  color: var(--ficer-text-light);
  padding: 0 4px;
}

.chat-message.user .message-time {
  text-align: right;
}

/* Typing Indicator */
.typing-indicator {
  display: flex;
  gap: 8px;
  align-items: center;
  max-width: 85%;
}

.typing-dots {
  background: white;
  border: 1px solid var(--ficer-border);
  padding: 10px 16px;
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 5px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  background: var(--ficer-primary);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) {
  animation-delay: 0s;
}

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

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

@keyframes typingBounce {

  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.7;
  }

  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* Quick Replies */
.quick-replies-container {
  padding: 10px 16px;
  background: var(--ficer-bg);
  border-top: 1px solid var(--ficer-border);
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.quick-reply {
  background: white;
  border: 1px solid var(--ficer-border);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ficer-text);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.quick-reply:hover {
  background: var(--ficer-primary);
  color: white;
  border-color: var(--ficer-primary);
}

/* Chat Input Area */
.chat-input-area {
  background: var(--ficer-bg);
  padding: 12px 16px;
  border-top: 1px solid var(--ficer-border);
}

.chat-input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  background: white;
  border: 2px solid var(--ficer-border);
  border-radius: 20px;
  padding: 8px 8px 8px 14px;
  transition: border-color 0.2s;
}

.chat-input-wrapper:focus-within {
  border-color: var(--ficer-primary);
}

#chatInput {
  flex: 1;
  border: none;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ficer-text);
  resize: none;
  max-height: 90px;
  background: transparent;
}

.send-button {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #0066CC 0%, #0052A3 100%);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.send-button:hover {
  transform: scale(1.06);
}

.send-button svg {
  width: 16px;
  height: 16px;
}

.powered-by {
  text-align: center;
  font-size: 10px;
  color: var(--ficer-text-light);
  margin-top: 6px;
}

/* ══════════════════════════════════════════════════════════════
   Mobile Responsiveness (Fully Touch Friendly)
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .ficer-chat-button {
    bottom: 75px;
    right: -2px;
    width: 95px;
    height: 95px;
  }

  .ficer-chat-dialog {
    position: fixed !important;
    bottom: 15px !important;
    left: 15px !important;
    right: 15px !important;
    top: auto !important;
    width: auto !important;
    height: 68vh !important;
    max-height: 700px !important;
    border-radius: 20px !important;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4) !important;
    z-index: 9999999 !important;
  }

  .ficer-chat-dialog.open {
    animation: none !important;
    transform: scale(1) !important;
  }

  .chat-header {
    border-radius: 18px 18px 0 0 !important;
    padding: 14px 16px !important;
  }

  .quick-replies-container {
    padding: 8px 12px !important;
  }

  .chat-input-area {
    padding: 10px 12px !important;
  }
}