/* ==========================================================================
   MASCOT × AI CHATBOT & TECHNO-CAPSULE FLOATING ACTION SYSTEM (KOMPONEN #5)
   ========================================================================== */

/* --------------------------------------------------------------------------
   Floating Techno-Capsule (Cyber-Orb) Trigger
   -------------------------------------------------------------------------- */
.floating-capsule-wrapper {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 8000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  pointer-events: none;
}

.floating-techno-capsule {
  pointer-events: auto;
  width: 68px;
  height: 68px;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  visibility: hidden;
}

.floating-techno-capsule.docked-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  visibility: visible;
}

.floating-techno-capsule:hover {
  transform: scale(1.1) rotate(5deg);
}

.floating-techno-capsule.capsule-active {
  transform: scale(0.95);
}

.capsule-svg-icon {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 0 15px rgba(56, 189, 248, 0.6));
  animation: capsuleFloat 2.5s ease-in-out infinite;
}

@keyframes capsuleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.capsule-notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent-gold);
  color: #020617;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border: 1px solid #000;
  box-shadow: 2px 2px 0px #000;
  border-radius: 4px;
  animation: badgeBounce 2s infinite;
}

@keyframes badgeBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}

.capsule-tooltip-tag {
  position: absolute;
  right: 76px;
  top: 50%;
  transform: translateY(-50%);
  background: #0f172a;
  border: 2px solid var(--accent-sky);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  padding: 0.4rem 0.75rem;
  white-space: nowrap;
  box-shadow: 3px 3px 0px #000;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.floating-techno-capsule:hover .capsule-tooltip-tag {
  opacity: 1;
}

/* --------------------------------------------------------------------------
   AI Chatbot Window Widget
   -------------------------------------------------------------------------- */
.ai-chatbot-widget {
  position: fixed;
  bottom: 104px;
  right: 24px;
  width: 380px;
  height: 540px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 120px);
  background: var(--bg-secondary);
  border: 3px solid var(--accent-sky);
  box-shadow: 8px 8px 0px #020617, 0 0 35px rgba(56, 189, 248, 0.35);
  z-index: 8500;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  pointer-events: none;
  visibility: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-chatbot-widget.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  visibility: visible;
}

/* Chatbot Header */
.chatbot-header {
  background: #020617;
  border-bottom: 2px solid #1e293b;
  padding: 0.85rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chatbot-brand-col {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chatbot-avatar-frame {
  width: 36px;
  height: 36px;
  background: #0f172a;
  border: 2px solid var(--accent-sky);
  padding: 0.2rem;
  flex-shrink: 0;
}

.chatbot-avatar-frame img {
  width: 100%;
  height: 100%;
}

.chatbot-title-box h4 {
  font-family: var(--font-pixel-heading);
  font-size: 0.85rem;
  color: var(--accent-sky);
  line-height: 1.2;
}

.chatbot-title-box .status-online {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--accent-green);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.chatbot-close-btn {
  background: transparent;
  border: 1px solid #475569;
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
}
.chatbot-close-btn:hover {
  background: var(--accent-red);
  border-color: var(--accent-red);
}

/* Chatbot Messages Scroll Area */
.chatbot-messages-container {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: radial-gradient(circle at 50% 50%, #0f172a 0%, #090d16 100%);
}

/* Chat Bubbles */
.chat-bubble {
  display: flex;
  gap: 0.65rem;
  max-width: 88%;
  animation: bubblePop 0.25s ease;
}

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

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

.chat-bubble.user-bubble {
  align-self: flex-end;
  flex-direction: column;
  align-items: flex-end;
}

.bot-avatar-mini {
  width: 28px;
  height: 28px;
  background: #020617;
  border: 1px solid var(--accent-sky);
  padding: 0.15rem;
  flex-shrink: 0;
}

.bot-avatar-mini img {
  width: 100%;
  height: 100%;
}

.bubble-content-col {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.bot-name-label {
  font-family: var(--font-pixel);
  font-size: 0.55rem;
  color: var(--accent-sky);
}

.bot-bubble .bubble-text {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 0.75rem 0.95rem;
  font-size: 0.85rem;
  line-height: 1.5;
  border-radius: 0 8px 8px 8px;
  box-shadow: 2px 2px 0px #000;
}

.user-bubble .bubble-text {
  background: var(--accent-blue);
  border: 1px solid var(--accent-sky);
  color: #fff;
  padding: 0.65rem 0.95rem;
  font-size: 0.85rem;
  line-height: 1.4;
  border-radius: 8px 8px 0 8px;
  box-shadow: 2px 2px 0px #000;
}

.bubble-time {
  font-size: 0.65rem;
  color: var(--text-dim);
  margin-top: 0.15rem;
}

.chat-inline-link {
  display: inline-block;
  background: #020617;
  border: 1px solid var(--accent-gold);
  color: var(--accent-gold);
  font-family: var(--font-pixel);
  font-size: 0.6rem;
  padding: 0.2rem 0.5rem;
  margin-top: 0.4rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.chat-inline-link:hover {
  background: var(--accent-gold);
  color: #020617;
}

/* Typing Indicator */
.chat-bubble.typing .typing-dots {
  background: #1e293b;
  border: 1px solid #334155;
  padding: 0.6rem 0.9rem;
  border-radius: 0 8px 8px 8px;
  display: flex;
  gap: 0.35rem;
  align-items: center;
}

.typing-dots span {
  width: 6px;
  height: 6px;
  background: var(--accent-sky);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

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

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

/* Quick Prompt Chips */
.chatbot-quick-chips {
  padding: 0.65rem 1rem;
  background: #090d16;
  border-top: 1px solid #1e293b;
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  white-space: nowrap;
}

.chatbot-quick-chips::-webkit-scrollbar {
  height: 4px;
}

.chat-chip-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: var(--accent-sky);
  font-size: 0.72rem;
  padding: 0.3rem 0.65rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.chat-chip-btn:hover {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-sky);
}

/* Chat Input Bar */
.chatbot-input-bar {
  padding: 0.75rem 1rem;
  background: #020617;
  border-top: 2px solid #1e293b;
  display: flex;
  gap: 0.6rem;
}

.chatbot-input-field {
  flex: 1;
  background: #0f172a;
  border: 1px solid #334155;
  color: #fff;
  padding: 0.6rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
}

.chatbot-input-field:focus {
  border-color: var(--accent-sky);
}

.chatbot-send-btn {
  background: var(--accent-blue);
  border: 1px solid var(--accent-sky);
  color: #fff;
  font-family: var(--font-pixel);
  font-size: 0.65rem;
  padding: 0 0.85rem;
  cursor: pointer;
  box-shadow: 2px 2px 0px #000;
}

.chatbot-send-btn:hover {
  background: var(--accent-sky);
  color: #020617;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .ai-chatbot-widget {
    bottom: 84px;
    right: 16px;
    width: calc(100vw - 32px);
    height: 480px;
  }
}
