/* ============================================================
   SatyaBot — Chatbot Styles
   Premium glassmorphism design with smooth animations
   ============================================================ */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --sb-primary: #8b5cf6;
  --sb-primary-dark: #7c3aed;
  --sb-gradient: linear-gradient(135deg, #0f0f15, #151525);
  --sb-toggle-btn: linear-gradient(135deg, #8b5cf6, #06b6d4);
  --sb-glass-bg: rgba(15, 15, 25, 0.85);
  --sb-glass-border: rgba(255, 255, 255, 0.08);
  --sb-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(139, 92, 246, 0.1);
  --sb-radius: 16px;
  --sb-msg-bot-bg: rgba(255, 255, 255, 0.05);
  --sb-msg-bot-border: rgba(255, 255, 255, 0.06);
  --sb-msg-user-bg: linear-gradient(135deg, #8b5cf6, #6366f1);
  --sb-msg-user-color: #fff;
  --sb-text: #f3f4f6;
  --sb-text-light: #9ca3af;
  --sb-toggle-size: 56px;
}

/* ── Container ─────────────────────────────────────────────── */
#satyabot-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Toggle Button ─────────────────────────────────────────── */
.satyabot-toggle {
  width: var(--sb-toggle-size);
  height: var(--sb-toggle-size);
  border-radius: 50%;
  border: none;
  background: var(--sb-toggle-btn);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.45);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  z-index: 3;
}

.satyabot-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.65);
}

.satyabot-toggle:active {
  transform: scale(0.95);
}

.satyabot-toggle svg {
  width: 28px;
  height: 28px;
  transition: all 0.3s ease;
}

.satyabot-toggle .satyabot-icon-close {
  display: none;
}

.satyabot-toggle.active .satyabot-icon-open {
  display: none;
}

.satyabot-toggle.active .satyabot-icon-close {
  display: block;
}

/* Pulse animation */
.satyabot-toggle::before {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--sb-toggle-btn);
  z-index: -1;
  animation: satyabot-pulse 2s ease-in-out infinite;
}

.satyabot-toggle.active::before {
  animation: none;
}

@keyframes satyabot-pulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.25); opacity: 0; }
}

/* ── Tooltip ───────────────────────────────────────────────── */
.satyabot-tooltip {
  position: absolute;
  bottom: calc(var(--sb-toggle-size) + 12px);
  right: 0;
  background: rgba(15, 15, 25, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  padding: 10px 18px;
  border-radius: 12px 12px 4px 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 2;
}

.satyabot-tooltip.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── Chat Panel ────────────────────────────────────────────── */
.satyabot-panel {
  position: absolute;
  bottom: calc(var(--sb-toggle-size) + 16px);
  right: 0;
  width: 400px;
  max-height: 560px;
  background: var(--sb-glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--sb-glass-border);
  border-radius: var(--sb-radius);
  box-shadow: var(--sb-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom right;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  z-index: 2;
}

.satyabot-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header ────────────────────────────────────────────────── */
.satyabot-header {
  background: var(--sb-gradient);
  color: var(--sb-text);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  border-bottom: 1px solid var(--sb-glass-border);
}

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

.satyabot-avatar {
  width: 48px;
  height: 48px;
  background: transparent;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  border: 2px solid rgba(139, 92, 246, 0.4);
}

.satyabot-avatar svg {
  width: 24px;
  height: 24px;
  color: var(--sb-text);
}

.satyabot-header-name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.satyabot-header-tagline {
  font-size: 13px;
  color: var(--sb-text-light);
  margin-top: 2px;
}

.satyabot-home-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--sb-text-light);
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.satyabot-home-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.satyabot-home-btn svg {
  width: 18px;
  height: 18px;
}

/* ── Messages ──────────────────────────────────────────────── */
.satyabot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 250px;
  max-height: 340px;
  scroll-behavior: smooth;
}

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

.satyabot-messages::-webkit-scrollbar-track {
  background: transparent;
}

.satyabot-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
}

/* ── Message Bubbles ───────────────────────────────────────── */
.satyabot-msg {
  max-width: 88%;
  padding: 12px 16px;
  border-radius: 16px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--sb-text);
  animation: satyabot-fadeIn 0.3s ease;
  word-wrap: break-word;
}

.satyabot-msg b {
  font-weight: 600;
  color: #fff;
}

.satyabot-msg a {
  color: #06b6d4;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.satyabot-msg-bot {
  background: var(--sb-msg-bot-bg);
  border: 1px solid var(--sb-msg-bot-border);
  border-bottom-left-radius: 4px;
  align-self: flex-start;
}

.satyabot-msg-user {
  background: var(--sb-msg-user-bg);
  color: var(--sb-msg-user-color);
  border-bottom-right-radius: 4px;
  align-self: flex-end;
}

.satyabot-msg-user a {
  color: #fff;
}

@keyframes satyabot-fadeIn {
  from { opacity: 0; transform: translateY(10px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)    scale(1);    }
}

/* ── Holographic Panel Border ──────────────────────────────── */
.satyabot-panel {
  animation: satyabot-holo-border 5s ease-in-out infinite !important;
}

@keyframes satyabot-holo-border {
  0%,  100% { border-color: rgba(139,92,246,0.25); box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 30px rgba(139,92,246,0.07); }
  33%        { border-color: rgba(6,182,212,0.3);   box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 30px rgba(6,182,212,0.08); }
  66%        { border-color: rgba(236,72,153,0.2);  box-shadow: 0 20px 60px rgba(0,0,0,0.6), 0 0 30px rgba(236,72,153,0.06); }
}

/* Override panel open state */
.satyabot-panel.open {
  opacity: 1 !important;
  transform: translateY(0) scale(1) !important;
}

/* ── Typing Indicator ──────────────────────────────────────── */
.satyabot-typing {
  display: flex;
  gap: 6px;
  padding: 12px 16px;
  background: rgba(139,92,246,0.06);
  border: 1px solid rgba(139,92,246,0.12);
  border-radius: 16px;
  border-bottom-left-radius: 4px;
  width: fit-content;
  align-self: flex-start;
}

.satyabot-typing .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  animation: satyabot-wave 1.4s ease-in-out infinite;
}

.satyabot-typing .dot:nth-child(1) {
  background: #8b5cf6;
  box-shadow: 0 0 6px rgba(139,92,246,0.7);
  animation-delay: 0s;
}

.satyabot-typing .dot:nth-child(2) {
  background: #06b6d4;
  box-shadow: 0 0 6px rgba(6,182,212,0.7);
  animation-delay: 0.18s;
}

.satyabot-typing .dot:nth-child(3) {
  background: #ec4899;
  box-shadow: 0 0 6px rgba(236,72,153,0.7);
  animation-delay: 0.36s;
}

@keyframes satyabot-wave {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30%            { transform: translateY(-9px); opacity: 1; }
}

@keyframes satyabot-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-8px); }
}

/* ── Quick Replies ─────────────────────────────────────────── */
.satyabot-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 0;
  animation: satyabot-fadeIn 0.3s ease;
}

.satyabot-qr-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  color: #06b6d4;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.satyabot-qr-btn:hover {
  background: linear-gradient(135deg, #8b5cf6, #06b6d4);
  color: #fff;
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

/* ── Navigation Link ───────────────────────────────────────── */
.satyabot-nav-link {
  padding: 2px 0 4px;
  animation: satyabot-fadeIn 0.3s ease;
}

.satyabot-nav-link a {
  font-size: 12.5px;
  color: #06b6d4;
  text-decoration: none;
  font-weight: 550;
  transition: color 0.2s;
}

.satyabot-nav-link a:hover {
  color: #38bdf8;
  text-decoration: underline;
}

/* ── Input Area ────────────────────────────────────────────── */
.satyabot-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(10, 10, 15, 0.6);
  flex-shrink: 0;
}

#satyabot-input {
  flex: 1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  color: #fff;
  background: rgba(0, 0, 0, 0.2);
  outline: none;
  transition: border-color 0.2s;
}

#satyabot-input::placeholder {
  color: #6b7280;
}

#satyabot-input:focus {
  border-color: #06b6d4;
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.15);
}

#satyabot-send {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--sb-text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

#satyabot-send:hover {
  transform: scale(1.05);
  color: #06b6d4;
}

#satyabot-send svg {
  width: 20px;
  height: 20px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 480px) {
  #satyabot-container {
    bottom: 16px;
    right: 16px;
  }

  .satyabot-panel {
    width: calc(100vw - 32px);
    max-height: 70vh;
    right: 0;
    bottom: calc(var(--sb-toggle-size) + 12px);
  }

  .satyabot-messages {
    max-height: 45vh;
  }

  .satyabot-toggle {
    width: 54px;
    height: 54px;
  }

  .satyabot-toggle svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 360px) {
  .satyabot-panel {
    width: calc(100vw - 16px);
    right: -8px;
  }
}
