/* ==========================================================================
   DigiBot - Interactive Flying AI Bot Mascot & Assistant
   PT. DIGILAB SOLUSINDO INDONESIA (digilab-indo.com)
   ========================================================================== */

:root {
  --digibot-cyan: #06b6d4;
  --digibot-cyan-glow: rgba(6, 182, 212, 0.45);
  --digibot-violet: #8b5cf6;
  --digibot-violet-glow: rgba(139, 92, 246, 0.4);
  --digibot-emerald: #10b981;
}

/* Container */
#digibot-root {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 999999;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* Flying Bot Entity */
.digibot-entity {
  position: fixed;
  width: 96px;
  height: 96px;
  pointer-events: auto;
  cursor: grab;
  transform-origin: center center;
  transition: transform 0.15s ease-out;
  touch-action: none;
  filter: drop-shadow(0 12px 25px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 15px var(--digibot-cyan-glow));
}

.digibot-entity:active {
  cursor: grabbing;
}

.digibot-entity.is-dragging {
  transition: none !important;
}

/* Floating bobbing motion */
.digibot-float-wrapper {
  width: 100%;
  height: 100%;
  animation: digibot-hover 3s ease-in-out infinite;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

@keyframes digibot-hover {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
  }
  50% {
    transform: translateY(-10px) rotate(1.5deg);
  }
}

/* Thruster flames & ion exhaust */
.digibot-thruster-flame {
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 26px;
  background: radial-gradient(ellipse at top, #38bdf8 0%, #06b6d4 40%, rgba(139, 92, 246, 0.8) 75%, transparent 100%);
  border-radius: 50% 50% 80% 80%;
  filter: blur(1px);
  animation: digibot-exhaust 0.6s ease-in-out infinite alternate;
  pointer-events: none;
  opacity: 0.9;
}

.digibot-thruster-flame::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 14px;
  background: #ffffff;
  border-radius: 50%;
  filter: blur(1px);
}

@keyframes digibot-exhaust {
  0% {
    height: 18px;
    opacity: 0.75;
    transform: translateX(-50%) scaleX(0.9);
  }
  100% {
    height: 26px;
    opacity: 1;
    transform: translateX(-50%) scaleX(1.15);
  }
}

/* Thruster ring particles */
.digibot-ion-ring {
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 8px;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(6, 182, 212, 0.8) 0%, transparent 70%);
  filter: blur(2px);
  animation: digibot-pulse-ring 1.2s ease-out infinite;
}

@keyframes digibot-pulse-ring {
  0% {
    transform: translateX(-50%) scale(0.6);
    opacity: 1;
  }
  100% {
    transform: translateX(-50%) scale(1.6);
    opacity: 0;
  }
}

/* Speech Bubble Tooltip */
.digibot-speech-bubble {
  position: absolute;
  bottom: 110%;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(6, 182, 212, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(6, 182, 212, 0.25);
  padding: 10px 14px;
  border-radius: 14px;
  color: #f1f5f9;
  font-size: 13px;
  line-height: 1.45;
  white-space: normal;
  width: max-content;
  max-width: 260px;
  pointer-events: auto;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(8px) scale(0.92);
  z-index: 20;
}

.digibot-speech-bubble.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0) scale(1);
}

.digibot-speech-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 7px;
  border-style: solid;
  border-color: rgba(15, 23, 42, 0.94) transparent transparent transparent;
}

.digibot-speech-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(6, 182, 212, 0.5);
  color: #38bdf8;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 6px;
  margin-bottom: 4px;
}

.digibot-speech-close {
  position: absolute;
  top: 4px;
  right: 6px;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1;
  padding: 2px;
  cursor: pointer;
  transition: color 0.2s;
}

.digibot-speech-close:hover {
  color: #ffffff;
}

/* Quick Action Badges beneath Bot */
.digibot-quick-pills {
  position: absolute;
  top: 105%;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 290px;
  gap: 5px;
  pointer-events: auto;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.digibot-entity:hover .digibot-quick-pills,
.digibot-quick-pills.force-show {
  opacity: 1;
  visibility: visible;
}

.digibot-pill-btn {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(6, 182, 212, 0.35);
  color: #e2e8f0;
  font-size: 10.5px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s;
}

.digibot-pill-btn:hover {
  background: rgba(6, 182, 212, 0.25);
  border-color: #06b6d4;
  color: #38bdf8;
  transform: translateY(-2px);
}
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.2s;
}

.digibot-pill-btn:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: #06b6d4;
  color: #38bdf8;
  transform: translateY(-2px);
}

/* Interactive Cyber Chat Drawer / Modal */
.digibot-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
}

.digibot-modal-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.digibot-chat-card {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 600px;
  max-height: calc(100vh - 48px);
  background: linear-gradient(165deg, rgba(15, 23, 42, 0.96) 0%, rgba(10, 15, 30, 0.98) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(6, 182, 212, 0.2);
  border-radius: 20px;
  z-index: 100000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.9) translateY(40px);
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
}

.digibot-chat-card.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  visibility: visible;
}

/* Card Header */
.digibot-chat-header {
  padding: 16px 20px;
  background: linear-gradient(90deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.8));
  border-bottom: 1px solid rgba(6, 182, 212, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.digibot-avatar-small {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(6, 182, 212, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

.digibot-online-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 10px;
  height: 10px;
  background: #10b981;
  border: 2px solid #0f172a;
  border-radius: 50%;
  box-shadow: 0 0 8px #10b981;
}

.digibot-header-title {
  font-size: 15px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.digibot-header-sub {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}

.digibot-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.digibot-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.digibot-icon-btn:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: #06b6d4;
  color: #ffffff;
}

.digibot-icon-btn.active {
  color: #06b6d4;
  border-color: #06b6d4;
  background: rgba(6, 182, 212, 0.15);
}

/* Chat Messages Area */
.digibot-chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

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

.digibot-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(6, 182, 212, 0.3);
  border-radius: 4px;
}

.digibot-msg {
  display: flex;
  gap: 10px;
  max-width: 88%;
  font-size: 13px;
  line-height: 1.5;
  animation: digibot-fade-in 0.25s ease-out;
}

@keyframes digibot-fade-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.digibot-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  position: relative;
}

.digibot-msg.bot .digibot-msg-bubble {
  background: rgba(30, 41, 59, 0.85);
  border: 1px solid rgba(6, 182, 212, 0.25);
  color: #e2e8f0;
  border-top-left-radius: 2px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.digibot-msg.user .digibot-msg-bubble {
  background: linear-gradient(135deg, #0284c7, #06b6d4);
  color: #ffffff;
  border-top-right-radius: 2px;
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.digibot-msg-time {
  font-size: 10px;
  color: #64748b;
  margin-top: 4px;
  text-align: right;
}

/* Prompt Chips Container */
.digibot-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0 10px 0;
}

.digibot-chip {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(6, 182, 212, 0.3);
  color: #93c5fd;
  font-size: 11px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 5px;
}

.digibot-chip:hover {
  background: rgba(6, 182, 212, 0.2);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
}

/* Typing Indicator */
.digibot-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 12px;
  width: fit-content;
}

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

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

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

@keyframes digibot-blink {
  0%, 80%, 100% {
    opacity: 0.2;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1.1);
  }
}

/* Input Bar */
.digibot-chat-footer {
  padding: 12px 16px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(6, 182, 212, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.digibot-input-box {
  flex: 1;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
}

.digibot-input-box:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.25);
  background: rgba(30, 41, 59, 1);
}

.digibot-input-box::placeholder {
  color: #64748b;
}

.digibot-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #06b6d4, #0284c7);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

.digibot-send-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(6, 182, 212, 0.45);
}

/* WhatsApp Direct CTA inside Chat */
.digibot-wa-banner {
  background: linear-gradient(135deg, rgba(37, 211, 102, 0.15), rgba(6, 182, 212, 0.1));
  border: 1px solid rgba(37, 211, 102, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.digibot-wa-link {
  background: #25D366;
  color: #ffffff !important;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s;
}

.digibot-wa-link:hover {
  background: #20ba59;
  transform: scale(1.03);
}

/* Patrol Flight Mode Beacon Banner */
.digibot-patrol-banner {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #06b6d4;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(6, 182, 212, 0.4);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 30px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 100001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: auto;
}

.digibot-patrol-banner.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

.digibot-patrol-stop {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #fca5a5;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 640px) {
  .digibot-entity {
    width: 76px;
    height: 76px;
  }
  .digibot-chat-card {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    height: 520px;
  }
  .digibot-speech-bubble {
    max-width: 220px;
    font-size: 12px;
  }
}
