/* Premium Floating Chatbot Widget Styling */

:root {
  --chatbot-saffron: #EA580C;
  --chatbot-saffron-hover: #C2410C;
  --chatbot-gold: #F59E0B;
  --chatbot-gold-hover: #D97706;
  --chatbot-cosmic: #0A0E1A;
  --chatbot-bg: rgba(10, 14, 26, 0.85);
  --chatbot-border: rgba(245, 158, 11, 0.3); /* Fine gold border line */
  --chatbot-border-glow: rgba(245, 158, 11, 0.6);
  --chatbot-text-light: #F3F4F6;
  --chatbot-text-gray: #94A3B8;
  --chatbot-transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Floating Bubble */
.astro-chatbot-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--chatbot-saffron);
  box-shadow: 0 0 20px rgba(234, 88, 12, 0.65), 0 6px 16px rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 99999;
  transition: var(--chatbot-transition);
}

.astro-chatbot-bubble:hover {
  transform: scale(1.08) rotate(5deg);
  box-shadow: 0 0 30px rgba(234, 88, 12, 0.85), 0 8px 20px rgba(0, 0, 0, 0.6);
}

.astro-chatbot-pulse {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 50%;
  border: 2px solid var(--chatbot-saffron);
  animation: chatbot-ping 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
  opacity: 0.85;
  pointer-events: none;
}

@keyframes chatbot-ping {
  75%, 100% {
    transform: scale(1.45);
    opacity: 0;
  }
}

.astro-chatbot-icon {
  font-size: 1.65rem;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Chatbot Panel Container */
.astro-chatbot-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 380px;
  height: 520px;
  border-radius: 16px;
  background: var(--chatbot-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--chatbot-border);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.75), 0 0 25px rgba(245, 158, 11, 0.12);
  display: flex;
  flex-direction: column;
  z-index: 99999;
  overflow: hidden;
  font-family: 'Plus Jakarta Sans', 'Outfit', sans-serif;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.astro-chatbot-panel.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Header */
.astro-chatbot-header {
  background: rgba(6, 9, 19, 0.92);
  padding: 14px 18px;
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

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

.astro-chatbot-avatar {
  font-size: 1.55rem;
  color: var(--chatbot-gold);
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
  animation: spin-slow 24s linear infinite;
  display: inline-block;
  user-select: none;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.astro-chatbot-header-info h3 {
  font-size: 0.95rem;
  color: #ffffff;
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.02em;
}

.astro-chatbot-header-info p {
  font-size: 0.72rem;
  color: var(--chatbot-text-gray);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 4px;
}

.astro-chatbot-header-info p::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.astro-chatbot-close-btn {
  background: none;
  border: none;
  color: var(--chatbot-text-gray);
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.astro-chatbot-close-btn:hover {
  color: var(--chatbot-gold);
}

/* Body */
.astro-chatbot-body {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(245, 158, 11, 0.2) rgba(0, 0, 0, 0.1);
  background: radial-gradient(circle at bottom right, rgba(234, 88, 12, 0.03) 0%, transparent 60%);
}

.astro-chatbot-body::-webkit-scrollbar {
  width: 5px;
}

.astro-chatbot-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.astro-chatbot-body::-webkit-scrollbar-thumb {
  background: rgba(245, 158, 11, 0.2);
  border-radius: 4px;
}

.astro-chatbot-body::-webkit-scrollbar-thumb:hover {
  background: rgba(245, 158, 11, 0.4);
}

/* Chat Messages */
.chat-message {
  max-width: 85%;
  padding: 11px 15px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.45;
  animation: chatbot-fade-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  word-wrap: break-word;
}

@keyframes chatbot-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-message.bot {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--chatbot-text-light);
  border-bottom-left-radius: 2px;
}

.chat-message.user {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--chatbot-saffron) 0%, #b45309 100%);
  color: #ffffff;
  border-bottom-right-radius: 2px;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.2);
}

/* Quick Actions and Buttons */
.chat-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
  width: 100%;
}

.chat-btn {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid var(--chatbot-border);
  border-radius: 8px;
  color: var(--chatbot-gold);
  padding: 11px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: var(--chatbot-transition);
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.chat-btn:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--chatbot-border-glow);
  transform: translateY(-1.5px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.15);
}

.chat-btn:active {
  transform: translateY(0);
}

/* Input Card Form inside chat stream */
.chat-input-card {
  background: rgba(15, 22, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: chatbot-fade-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.chat-input-card label {
  font-size: 0.72rem;
  color: var(--chatbot-text-gray);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chat-input-card input, 
.chat-input-card textarea {
  width: 100%;
  background: rgba(5, 7, 11, 0.85);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  color: #ffffff;
  padding: 9px 12px;
  font-size: 0.85rem;
  font-family: inherit;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input-card input:focus, 
.chat-input-card textarea:focus {
  border-color: var(--chatbot-border-glow);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.15);
}

.chat-input-card textarea {
  resize: none;
  height: 72px;
}

.chat-input-card button {
  width: 100%;
  background: linear-gradient(135deg, var(--chatbot-saffron) 0%, #d97706 100%);
  border: none;
  border-radius: 8px;
  color: white;
  padding: 10px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--chatbot-transition);
}

.chat-input-card button:hover {
  filter: brightness(1.15);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
  transform: translateY(-1px);
}

/* Confirm Card Panel */
.chat-confirm-card {
  background: rgba(245, 158, 11, 0.05);
  border: 1px solid var(--chatbot-border);
  border-radius: 12px;
  padding: 14px;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: chatbot-fade-up 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.chat-confirm-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--chatbot-gold);
  border-bottom: 1px solid rgba(245, 158, 11, 0.18);
  padding-bottom: 6px;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.chat-confirm-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chat-confirm-label {
  font-size: 0.68rem;
  color: var(--chatbot-text-gray);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.chat-confirm-value {
  font-size: 0.82rem;
  color: var(--chatbot-text-light);
  font-weight: 550;
}

/* Token Highlight Badge Container */
.chat-token-badge-container {
  background: radial-gradient(circle at top left, rgba(245, 158, 11, 0.12) 0%, rgba(10, 14, 26, 0.4) 100%);
  border: 1px dashed var(--chatbot-border-glow);
  border-radius: 12px;
  padding: 16px;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  animation: pulse-border 2.5s infinite alternate;
}

@keyframes pulse-border {
  from { border-color: rgba(245, 158, 11, 0.35); }
  to { border-color: rgba(245, 158, 11, 0.75); }
}

.chat-token-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--chatbot-gold) 0%, #D97706 100%);
  color: #05070B;
  font-family: 'Space Grotesk', monospace;
  font-size: 1.2rem;
  font-weight: 750;
  padding: 7px 18px;
  border-radius: 8px;
  margin: 12px 0;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.45);
  letter-spacing: 0.08em;
  user-select: all;
}
