/* mascot.css - Premium AI Mascot Framework */

/* Global Blur when panel is open */
body.mascot-blur-active > *:not(#mascot-container):not(#mascot-panel) {
  filter: blur(5px) brightness(0.8);
  transition: filter 0.4s ease;
}

#mascot-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9998;
  pointer-events: none; /* Let clicks pass through empty space */
  display: flex;
  align-items: center;
  gap: 16px;
  transition: opacity 0.3s ease;
}

#mascot-container.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* The hover tooltip */
.mascot-tooltip {
  background: rgba(9, 14, 23, 0.9) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  padding: 16px 20px;
  border-radius: 20px;
  border-bottom-right-radius: 4px;
  color: #FFFFFF !important;
  opacity: 0;
  visibility: hidden;
  transform: translateX(20px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  cursor: pointer;
  max-width: 260px;
}

.mascot-tooltip.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.mascot-tooltip:hover {
  background: rgba(9, 14, 23, 1) !important;
  border-color: rgba(6, 182, 212, 0.3) !important;
}

.mascot-tooltip-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.mascot-tooltip-text {
  color: #94A3B8 !important;
  font-size: 12px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.mascot-tooltip-btn {
  width: 100%;
  padding: 8px;
  background: #151A23 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 8px;
  color: #FFFFFF !important;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.mascot-tooltip:hover .mascot-tooltip-btn {
  background: #06B6D4 !important;
  color: #050507 !important;
  border-color: #06B6D4 !important;
}

/* Permanent Tagline Bubble */
.mascot-callout-tag {
  position: absolute;
  top: -20px;
  right: 50%;
  transform: translateX(50%);
  background: #090E17 !important;
  color: #06B6D4 !important;
  border: 1px solid rgba(6, 182, 212, 0.3) !important;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5) !important;
  animation: ghostFloat 3s ease-in-out infinite;
  z-index: 20;
}

/* Tiny triangle tail for the tagline bubble */
.mascot-callout-tag::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: #090E17 !important;
  border-right: 1px solid rgba(6, 182, 212, 0.3) !important;
  border-bottom: 1px solid rgba(6, 182, 212, 0.3) !important;
}

/* The Floating Orb Wrapper */
#mascot-core-wrapper {
  position: relative;
  width: 110px;
  height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
  cursor: pointer;
  will-change: transform;
}

/* The organic float animation applied via JS physics, but we can add a base float */
.mascot-idle-float {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* The wrapper with a clean, thin circular outline border and transparent background */
.mascot-sphere {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  will-change: transform;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
}

/* Volumetric Glowing Aura - Disabled for clean minimalist look */
.mascot-sphere::before {
  display: none;
}

/* Glass Glare Overlay - Disabled to remove background fills */
.mascot-sphere::after {
  display: none;
}

#mascot-core-wrapper:hover .mascot-sphere::after {
  transform: translate(4px, 4px) scale(1.05);
}

#mascot-core-wrapper:hover .mascot-sphere {
  transform: scale(1.1);
}

/* 3D Orbiting Gyroscope Ring Styles */
.mascot-ring {
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2;
}
.mascot-ring.ring-1 {
  border: 1.5px solid rgba(0, 240, 255, 0.4);
  transform: rotateX(75deg) rotateY(15deg);
  animation: rotateRing1 12s linear infinite;
}
.mascot-ring.ring-2 {
  border: 1.5px solid rgba(139, 92, 246, 0.3);
  transform: rotateX(-35deg) rotateY(45deg);
  animation: rotateRing2 16s linear infinite;
}

@keyframes rotateRing1 {
  0% { transform: rotateX(75deg) rotateY(15deg) rotateZ(0deg); }
  100% { transform: rotateX(75deg) rotateY(15deg) rotateZ(360deg); }
}
@keyframes rotateRing2 {
  0% { transform: rotateX(-35deg) rotateY(45deg) rotateZ(360deg); }
  100% { transform: rotateX(-35deg) rotateY(45deg) rotateZ(0deg); }
}

/* Animated SVG Ghost */
.mascot-svg-ghost {
  position: relative;
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
  will-change: transform;
  animation: ghostFloat 6s ease-in-out infinite;
}

/* Internal SVG Animations */
.ghost-body {
  transform-origin: center bottom;
}

.ghost-eye {
  animation: ghostBlink 4s infinite;
  transform-origin: center;
}

@keyframes auraPulse {
  0% { transform: scale(0.9) rotate(0deg); opacity: 0.5; }
  100% { transform: scale(1.15) rotate(180deg); opacity: 0.9; }
}

@keyframes ghostFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg) scale(1);
  }
  25% {
    transform: translateY(-6px) rotate(2deg) scale(1.02);
  }
  50% {
    transform: translateY(-10px) rotate(-1deg) scale(0.98);
  }
  75% {
    transform: translateY(-4px) rotate(-2deg) scale(1.01);
  }
}

@keyframes ghostBlink {
  0%, 96%, 98% { transform: scaleY(1); }
  97%, 100% { transform: scaleY(0.1); }
}

/* ----------------------------------
   CONSULTATION PANEL (Expanded State)
   ---------------------------------- */
#mascot-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 3rem);
  height: 600px;
  max-height: 80vh;
  background: rgba(9, 14, 23, 0.95) !important;
  backdrop-filter: blur(30px) !important;
  -webkit-backdrop-filter: blur(30px) !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5), 0 0 40px rgba(6, 182, 212, 0.05);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.9) translateY(20px);
  transform-origin: bottom right;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#mascot-panel.open {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

/* Panel Header */
.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.01), transparent);
}

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

.mini-orb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #06B6D4, #7C3AED);
  padding: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-orb-inner {
  width: 100%;
  height: 100%;
  background: #090E17;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-orb-core {
  width: 8px;
  height: 8px;
  background: #06B6D4;
  border-radius: 50%;
  box-shadow: 0 0 8px #06B6D4;
  animation: energyPulse 2s infinite;
}

.panel-title-text h3 {
  color: #FFFFFF !important;
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 2px 0;
}

.panel-title-text span {
  color: #06B6D4 !important;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 600;
}

.panel-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #151A23 !important;
  border: none;
  color: #FFFFFF !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.panel-close:hover {
  background: #222730 !important;
  color: #FFFFFF !important;
}

/* Panel Chat Area */
.panel-chat {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 85%;
  animation: slideUp 0.3s ease-out forwards;
}

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

.chat-msg.user {
  align-self: flex-end;
}

/* Flipkart-style inline vertical options */
.fk-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.fk-option-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #131821 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #FFFFFF !important;
  font-size: 13px;
  font-weight: 500;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  text-align: left;
}

.fk-option-btn:hover {
  background: #091E2B !important;
  border-color: rgba(6, 182, 212, 0.4) !important;
  color: #06B6D4 !important;
}

.fk-icon {
  margin-right: 8px;
  font-size: 14px;
}

.fk-arrow {
  width: 16px;
  height: 16px;
  color: rgba(255, 255, 255, 0.3) !important;
  margin-left: auto;
  transition: transform 0.2s ease;
}

.fk-option-btn:hover .fk-arrow {
  color: #06B6D4 !important;
  transform: translateX(3px);
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
}

.bot .msg-bubble {
  background: #151A23 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #FFFFFF !important;
  border-top-left-radius: 4px;
}

.user .msg-bubble {
  background: linear-gradient(135deg, #00768C, #6B21A8) !important;
  color: #FFFFFF !important;
  border-top-right-radius: 4px;
}

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

/* Panel Input Area */
.panel-input-area {
  padding: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
  background: rgba(255, 255, 255, 0.02) !important;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.chat-input {
  width: 100%;
  background: #131821 !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 30px;
  padding: 12px 48px 12px 48px;
  color: #FFFFFF !important;
  font-size: 13px;
  outline: none;
  transition: border-color 0.3s ease;
}

.chat-input:focus {
  border-color: rgba(6, 182, 212, 0.4) !important;
}

.mic-btn, .send-btn {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mic-btn {
  left: 8px;
  background: transparent;
  color: #94A3B8 !important;
}

.mic-btn:hover {
  background: #151A23 !important;
  color: #FFFFFF !important;
}

.send-btn {
  right: 8px;
  background: #06B6D4 !important;
  color: #050507 !important;
}

.send-btn:hover {
  background: #0891B2 !important;
}

.typing-indicator {
  display: flex;
  gap: 4px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 16px;
  border-top-left-radius: 4px;
  align-self: flex-start;
  margin-top: 8px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #06B6D4 !important;
  animation: typingBounce 1s infinite;
}

.typing-dot:nth-child(2) { background: #7C3AED !important; animation-delay: 0.2s; }
.typing-dot:nth-child(3) { background: #F59E0B !important; animation-delay: 0.4s; }

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

@keyframes shakeAttention {
  0%, 80%, 100% { transform: scale(1) rotate(0deg); }
  82%, 90%, 98% { transform: scale(1.08) rotate(-5deg); }
  86%, 94% { transform: scale(1.08) rotate(5deg); }
}
