/* ===================================================================
   Prism Sales Chat Widget — "Chat with Alex"
   Dark theme, floating bottom-right, smooth animations
   =================================================================== */

/* --- Floating trigger button --- */
.prism-chat-trigger {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
  box-shadow: 0 4px 24px rgba(99, 102, 241, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  z-index: 10000;
}

.prism-chat-trigger:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 32px rgba(99, 102, 241, 0.55);
}

.prism-chat-trigger svg {
  width: 26px;
  height: 26px;
  fill: #fff;
  transition: opacity 0.15s;
}

.prism-chat-trigger .chat-close-icon {
  display: none;
}

.prism-chat-trigger.open .chat-open-icon {
  display: none;
}

.prism-chat-trigger.open .chat-close-icon {
  display: block;
}

/* Unread badge */
.prism-chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  font-family: 'Inter', sans-serif;
}

.prism-chat-badge.visible {
  display: flex;
}

/* --- Chat window --- */
.prism-chat-window {
  position: fixed;
  bottom: 92px;
  right: 24px;
  width: 380px;
  height: 500px;
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  z-index: 10000;
  box-shadow: 0 16px 64px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translateY(16px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.prism-chat-window.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* --- Header --- */
.prism-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.prism-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1 0%, #22d3ee 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.prism-chat-header-text h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #f0f0f5;
}

.prism-chat-header-text span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}

/* --- Messages area --- */
.prism-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.prism-chat-messages::-webkit-scrollbar {
  width: 4px;
}

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

.prism-chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
}

/* --- Message bubbles --- */
.prism-msg {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #e8e8f0;
  word-wrap: break-word;
}

.prism-msg a {
  color: #818cf8;
  text-decoration: underline;
}

.prism-msg strong {
  font-weight: 600;
}

.prism-msg-agent {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.07);
  border-bottom-left-radius: 4px;
}

.prism-msg-user {
  align-self: flex-end;
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  border-bottom-right-radius: 4px;
  color: #fff;
}

/* --- Typing indicator --- */
.prism-typing {
  align-self: flex-start;
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  border-bottom-left-radius: 4px;
}

.prism-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  animation: prism-bounce 1.4s ease-in-out infinite;
}

.prism-typing span:nth-child(2) {
  animation-delay: 0.2s;
}

.prism-typing span:nth-child(3) {
  animation-delay: 0.4s;
}

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

/* --- Inline pricing card --- */
.prism-pricing-inline {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 8px;
  align-self: flex-start;
  max-width: 90%;
}

.prism-pricing-inline h5 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: #a5b4fc;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.prism-pricing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.7);
}

.prism-pricing-row .plan-name {
  font-weight: 600;
  color: #e8e8f0;
}

.prism-pricing-row .plan-price {
  color: #22d3ee;
  font-weight: 600;
}

.prism-pricing-row.featured {
  background: rgba(99, 102, 241, 0.12);
  margin: 2px -6px;
  padding: 5px 6px;
  border-radius: 6px;
}

/* --- Input area --- */
.prism-chat-input {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}

.prism-chat-input input {
  flex: 1;
  border: none;
  outline: none;
  background: rgba(255, 255, 255, 0.06);
  color: #e8e8f0;
  font-size: 13.5px;
  padding: 10px 14px;
  border-radius: 10px;
  font-family: inherit;
}

.prism-chat-input input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.prism-chat-input button {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.15s;
  flex-shrink: 0;
}

.prism-chat-input button:hover {
  opacity: 0.85;
}

.prism-chat-input button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.prism-chat-input button svg {
  width: 18px;
  height: 18px;
  fill: #fff;
}

/* --- Powered by footer --- */
.prism-chat-powered {
  text-align: center;
  padding: 6px;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

/* --- Mobile responsive --- */
@media (max-width: 480px) {
  .prism-chat-window {
    width: calc(100vw - 16px);
    height: calc(100vh - 120px);
    bottom: 80px;
    right: 8px;
    border-radius: 14px;
  }

  .prism-chat-trigger {
    bottom: 16px;
    right: 16px;
  }
}
