/* ═══════════════════════════════════════════════════════════════
   AstroKamya™ · COSMIC ORACLE CHATBOT
   AI-Powered Customer Support + WhatsApp Escalation
   ═══════════════════════════════════════════════════════════════ */

/* ═══ CHAT FAB BUTTON — Standalone Floating Monk Icon ═══ */
.oracle-fab {
  position: fixed;
  bottom: 28px; right: 28px;
  z-index: 9999;
  width: 64px; height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
  overflow: visible;
  padding: 0;
}
/* Breathing gold glow behind the monk */
.oracle-fab::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242,204,120,.35) 0%, rgba(167,139,250,.12) 50%, transparent 72%);
  animation: oracleBreathGlow 3s ease-in-out infinite;
  z-index: -1;
  pointer-events: none;
}
/* Secondary subtle outer pulse */
.oracle-fab::after {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(242,204,120,.1) 0%, transparent 65%);
  animation: oracleBreathGlow 3s ease-in-out infinite 0.5s;
  z-index: -2;
  pointer-events: none;
}
@keyframes oracleBreathGlow {
  0%, 100% { opacity: .4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}
.oracle-fab:hover {
  transform: scale(1.1) translateY(-2px);
}
/* Monk image icon — standalone, no container chrome */
.oracle-fab .oracle-fab-icon {
  width: 56px; height: 56px;
  object-fit: cover;
  border-radius: 50%;
  transition: transform 0.4s cubic-bezier(0.16,1,0.3,1), filter 0.4s ease;
  filter: drop-shadow(0 0 10px rgba(242,204,120,.4));
}
.oracle-fab:hover .oracle-fab-icon {
  transform: scale(1.06);
  filter: drop-shadow(0 0 18px rgba(242,204,120,.6));
}
.oracle-fab .oracle-fab-close {
  display: none;
  width: 24px; height: 24px;
  color: #f2cc78;
  filter: drop-shadow(0 0 6px rgba(242,204,120,.5));
}
.oracle-fab.oracle-open .oracle-fab-icon { display: none; }
.oracle-fab.oracle-open .oracle-fab-close { display: block; }
.oracle-fab.oracle-open {
  width: 48px; height: 48px;
  background: rgba(10,6,28,.8);
  border: 1px solid rgba(242,204,120,.2);
  border-radius: 50%;
}
.oracle-fab.oracle-open::before,
.oracle-fab.oracle-open::after { display: none; }
.oracle-fab-badge {
  position: absolute;
  top: -3px; right: -3px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: #4ade80;
  border: 2px solid rgba(10,6,28,.9);
  box-shadow: 0 0 8px rgba(74,222,128,.5);
  animation: oracleBadgePulse 2s ease-in-out infinite;
}
@keyframes oracleBadgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}
.oracle-fab.oracle-open .oracle-fab-badge { display: none; }

/* ═══ CHAT WINDOW ═══ */
.oracle-chat {
  position: fixed;
  bottom: 100px; right: 28px;
  z-index: 9998;
  width: 400px;
  max-height: 600px;
  border-radius: 24px;
  background: rgba(10,8,18,0.98);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    0 25px 80px rgba(0,0,0,0.6),
    0 0 40px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.04);
  backdrop-filter: blur(40px);
  -webkit-backdrop-filter: blur(40px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.92);
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.oracle-chat.oracle-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ═══ CHAT HEADER ═══ */
.oracle-header {
  padding: 20px 24px 16px;
  background: linear-gradient(180deg, rgba(201,162,39,0.08) 0%, transparent 100%);
  border-bottom: 1px solid rgba(201,162,39,0.08);
  display: flex;
  align-items: center;
  gap: 14px;
}
.oracle-avatar {
  width: 42px; height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(201,162,39,0.15), rgba(124,58,237,0.1));
  border: 1px solid rgba(201,162,39,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  position: relative;
}
.oracle-avatar::after {
  content: '';
  position: absolute;
  bottom: -1px; right: -1px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #22C55E;
  border: 2px solid rgba(10,8,18,0.98);
}
.oracle-header-info {
  flex: 1;
}
.oracle-header-title {
  font-family: 'Clash Display', 'Space Grotesk', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #F0EDE4;
  letter-spacing: -0.01em;
}
.oracle-header-status {
  font-size: 11px;
  color: #22C55E;
  display: flex;
  align-items: center;
  gap: 5px;
}
.oracle-header-status::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #22C55E;
  animation: oracleStatusBlink 2s ease-in-out infinite;
}
@keyframes oracleStatusBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ═══ CHAT MESSAGES ═══ */
.oracle-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 300px;
  max-height: 380px;
  scrollbar-width: thin;
  scrollbar-color: rgba(201,162,39,0.15) transparent;
}
.oracle-messages::-webkit-scrollbar { width: 4px; }
.oracle-messages::-webkit-scrollbar-thumb { 
  background: rgba(201,162,39,0.15); 
  border-radius: 4px; 
}

.oracle-msg {
  max-width: 85%;
  animation: oracleMsgIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  opacity: 0;
}
@keyframes oracleMsgIn {
  0% { opacity: 0; transform: translateY(10px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.oracle-msg.oracle-bot {
  align-self: flex-start;
}
.oracle-msg.oracle-user {
  align-self: flex-end;
}
.oracle-msg-bubble {
  padding: 14px 18px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.65;
  color: #D1D5DB;
}
.oracle-bot .oracle-msg-bubble {
  background: linear-gradient(135deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: none;
  border-radius: 4px 18px 18px 18px;
  color: #D1D5DB;
}
.oracle-user .oracle-msg-bubble {
  background: linear-gradient(135deg, rgba(201,162,39,0.12), rgba(201,162,39,0.06));
  border: none;
  border-radius: 18px 4px 18px 18px;
  color: #F0EDE4;
}
.oracle-msg-bubble strong {
  color: #C9A227;
  font-weight: 600;
}
.oracle-msg-bubble em {
  color: #9B6DFF;
  font-style: normal;
}

/* Typing indicator */
.oracle-typing {
  align-self: flex-start;
  display: flex;
  gap: 5px;
  padding: 14px 22px;
  background: rgba(255,255,255,0.03);
  border: none;
  border-radius: 4px 18px 18px 18px;
}
.oracle-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #C9A227;
  animation: oracleTypingBounce 1.4s ease-in-out infinite;
}
.oracle-typing span:nth-child(2) { animation-delay: 0.2s; }
.oracle-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes oracleTypingBounce {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-5px); }
}

/* Quick suggestion chips */
.oracle-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.oracle-chip {
  padding: 7px 14px;
  border-radius: 20px;
  background: rgba(201,162,39,0.06);
  border: 1px solid rgba(201,162,39,0.15);
  font-size: 12px;
  font-weight: 600;
  color: #C9A227;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16,1,0.3,1);
  white-space: nowrap;
}
.oracle-chip:hover {
  background: rgba(201,162,39,0.15);
  border-color: rgba(201,162,39,0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(201,162,39,0.1);
}

/* WhatsApp escalation card */
.oracle-wa-card {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(37,211,102,0.08), rgba(37,211,102,0.03));
  border: 1px solid rgba(37,211,102,0.15);
  margin-top: 8px;
}
.oracle-wa-card-title {
  font-size: 12px;
  font-weight: 700;
  color: #25D366;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.oracle-wa-card-text {
  font-size: 12px;
  color: rgba(168,162,158,0.7);
  margin-bottom: 12px;
  line-height: 1.5;
}
.oracle-wa-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 12px;
  background: #25D366;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}
.oracle-wa-btn:hover {
  background: #20bd5a;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,211,102,0.3);
}
.oracle-wa-btn svg {
  width: 16px; height: 16px;
}

/* ═══ CHAT INPUT ═══ */
.oracle-input-wrap {
  padding: 16px 20px 20px;
  border-top: 1px solid rgba(255,255,255,0.04);
  background: rgba(10,8,18,0.6);
}
.oracle-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: 16px;
  padding: 6px 8px 6px 18px;
  transition: all 0.3s;
}
.oracle-input-row:focus-within {
  border-color: rgba(201,162,39,0.3);
  box-shadow: 0 0 20px rgba(201,162,39,0.05);
}
.oracle-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: #F0EDE4;
  font-size: 13.5px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  padding: 10px 0;
}
.oracle-input::placeholder {
  color: rgba(168,162,158,0.35);
}
.oracle-send-btn {
  width: 38px; height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, #C9A227, #FFD700);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #06030F;
  transition: all 0.3s;
  flex-shrink: 0;
}
.oracle-send-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 16px rgba(201,162,39,0.3);
}
.oracle-send-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
}
.oracle-send-btn svg { width: 18px; height: 18px; }
.oracle-powered {
  text-align: center;
  font-size: 10px;
  color: rgba(168,162,158,0.25);
  margin-top: 8px;
  letter-spacing: 0.03em;
}

/* ═══ MOBILE RESPONSIVE ═══ */
@media (max-width: 480px) {
  .oracle-chat {
    bottom: 0; right: 0; left: 0;
    width: 100%;
    max-height: 85vh;
    border-radius: 24px 24px 0 0;
    border-bottom: none;
  }
  .oracle-fab {
    bottom: 20px; right: 20px;
    width: 56px; height: 56px;
  }
  .oracle-fab .oracle-fab-icon {
    width: 48px; height: 48px;
  }
  .oracle-messages {
    min-height: 250px;
    max-height: 50vh;
  }
}
