/* ==========================================================================
   PROCOMM PERFORMANCE LAB — AI RECEPTIONIST / CONCIERGE CHATBOT
   Frosted Performance & Glassmorphic Design System
   ========================================================================== */

/* 1. Floating Launcher Button & Prompt Pill */
.procomm-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-sans, 'Outfit', sans-serif);
}

.procomm-chat-prompt-pill {
  background: linear-gradient(135deg, rgba(14, 30, 64, 0.95) 0%, rgba(5, 12, 28, 0.98) 100%);
  border: 1px solid rgba(0, 210, 255, 0.4);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 210, 255, 0.25);
  border-radius: 9999px;
  padding: 8px 16px 8px 14px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  backdrop-filter: blur(16px);
  animation: promptFloat 3s ease-in-out infinite alternate;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.procomm-chat-prompt-pill:hover {
  border-color: #00d2ff;
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(0, 210, 255, 0.4);
}

.procomm-chat-prompt-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
  margin-left: 4px;
  transition: color 0.2s;
}

.procomm-chat-prompt-close:hover {
  color: #ffffff;
}

.procomm-chat-trigger-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e4ea8 0%, #0a1f4d 100%);
  border: 1.5px solid rgba(0, 210, 255, 0.6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7), 0 0 25px rgba(0, 210, 255, 0.45), inset 0 1px 2px rgba(255, 255, 255, 0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
}

.procomm-chat-trigger-btn:hover {
  transform: scale(1.08) translateY(-2px);
  border-color: #00d2ff;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.8), 0 0 35px rgba(0, 210, 255, 0.7);
}

.procomm-chat-trigger-icon {
  width: 28px;
  height: 28px;
  fill: #00d2ff;
  transition: transform 0.3s ease;
}

.procomm-chat-trigger-badge {
  position: absolute;
  top: 0;
  right: 0;
  width: 14px;
  height: 14px;
  background: #10b981;
  border: 2px solid #040814;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
}

.procomm-chat-trigger-badge::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 50%;
  border: 2px solid #10b981;
  animation: pulseGreen 2s infinite;
}

/* 2. Chat Window Container */
.procomm-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 420px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 120px);
  background: rgba(4, 10, 24, 0.96);
  border: 1px solid rgba(0, 210, 255, 0.35);
  border-radius: 20px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85), 0 0 40px rgba(0, 210, 255, 0.2);
  backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  z-index: 10000;
  overflow: hidden;
  font-family: var(--font-sans, 'Outfit', sans-serif);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: bottom right;
}

.procomm-chat-window.hidden {
  opacity: 0;
  transform: scale(0.92) translateY(20px);
  pointer-events: none;
  visibility: hidden;
}

/* Interactive Action Buttons & Group Inside Messages */
.procomm-chat-action-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  margin-bottom: 4px;
}

.procomm-chat-action-btn {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.12) 0%, rgba(14, 30, 64, 0.4) 100%);
  border: 1px solid rgba(0, 210, 255, 0.45);
  border-radius: 10px;
  padding: 8px 14px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.2s ease;
  font-family: var(--font-sans, 'Outfit', sans-serif);
}

.procomm-chat-action-btn:hover {
  background: linear-gradient(135deg, rgba(0, 210, 255, 0.25) 0%, rgba(0, 163, 255, 0.4) 100%);
  border-color: #00d2ff;
  transform: translateX(3px);
  box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

.procomm-chat-action-btn svg {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  fill: #00d2ff;
  transition: transform 0.2s ease;
}

.procomm-chat-action-btn:hover svg {
  transform: translateX(2px);
}

.procomm-profile-card {
  background: rgba(0, 210, 255, 0.06);
  border: 1px solid rgba(0, 210, 255, 0.35);
  border-left: 4px solid #00d2ff;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 10px;
  margin-bottom: 6px;
  font-size: 13px;
  line-height: 1.55;
  color: #cbd5e1;
}

.procomm-profile-card-title {
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
}

/* 3. Chat Header */
.procomm-chat-header {
  padding: 14px 18px;
  background: linear-gradient(180deg, rgba(20, 42, 88, 0.9) 0%, rgba(10, 22, 48, 0.95) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}

.procomm-chat-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.procomm-chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d2ff 0%, #1558ce 100%);
  padding: 1.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
}

.procomm-chat-avatar-inner {
  width: 100%;
  height: 100%;
  background: #06142e;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00d2ff;
  font-weight: 800;
  font-size: 13px;
}

.procomm-chat-title-group {
  display: flex;
  flex-direction: column;
}

.procomm-chat-header-title {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.procomm-chat-status-dot {
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 6px #10b981;
}

.procomm-chat-header-desc {
  font-size: 11px;
  color: #94a3b8;
}

/* Header Flags Switcher & Utility Actions */
.procomm-chat-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.procomm-chat-header-flags {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 2px;
  gap: 2px;
}

.procomm-chat-flag-btn {
  background: transparent;
  border: none;
  padding: 3px 5px;
  border-radius: 9999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  opacity: 0.6;
}

.procomm-chat-flag-btn:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
}

.procomm-chat-flag-btn.active {
  opacity: 1;
  background: rgba(0, 210, 255, 0.25);
  border: 1px solid rgba(0, 210, 255, 0.5);
}

.procomm-chat-icon-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.procomm-chat-icon-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

/* 4. Chat Messages Body */
.procomm-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.procomm-chat-body::-webkit-scrollbar {
  width: 5px;
}

.procomm-chat-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

/* Message Rows & Bubbles */
.procomm-msg-row {
  display: flex;
  gap: 8px;
  max-width: 88%;
  animation: msgSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.procomm-msg-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.procomm-msg-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.procomm-msg-row.bot .procomm-msg-bubble {
  background: linear-gradient(180deg, rgba(20, 38, 76, 0.85) 0%, rgba(10, 20, 44, 0.9) 100%);
  border: 1px solid rgba(77, 137, 240, 0.25);
  color: #e2e8f0;
  border-bottom-left-radius: 3px;
}

.procomm-msg-row.user .procomm-msg-bubble {
  background: linear-gradient(135deg, #1a62d6 0%, #12449c 100%);
  border: 1px solid rgba(0, 210, 255, 0.4);
  color: #ffffff;
  border-bottom-right-radius: 3px;
}

.procomm-msg-time {
  font-size: 10px;
  color: #64748b;
  margin-top: 4px;
  text-align: right;
  font-family: var(--font-mono, monospace);
}

/* Markdown formatting inside bubbles */
.procomm-msg-bubble p {
  margin-bottom: 6px;
}
.procomm-msg-bubble p:last-child {
  margin-bottom: 0;
}
.procomm-msg-bubble strong {
  color: #ffffff;
  font-weight: 700;
}
.procomm-msg-bubble ul {
  padding-left: 16px;
  margin: 6px 0;
}
.procomm-msg-bubble li {
  margin-bottom: 3px;
}

/* Action Cards & Buttons inside Chat */
.procomm-chat-card {
  margin-top: 8px;
  padding: 10px 12px;
  background: rgba(4, 10, 24, 0.65);
  border: 1px solid rgba(0, 210, 255, 0.3);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.procomm-chat-card-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #00d2ff;
}

.procomm-chat-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 8px;
  background: linear-gradient(180deg, #2b7af6 0%, #1558ce 100%);
  color: #ffffff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.2s;
  cursor: pointer;
}

.procomm-chat-card-btn:hover {
  background: linear-gradient(180deg, #3d88f8 0%, #1c64df 100%);
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
}

/* Quick-Reply Triage Chips */
.procomm-chat-quick-chips {
  padding: 8px 16px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex-shrink: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(5, 12, 28, 0.6);
}

.procomm-chat-quick-chips::-webkit-scrollbar {
  height: 3px;
}

.procomm-chat-quick-chips::-webkit-scrollbar-thumb {
  background: rgba(0, 210, 255, 0.2);
  border-radius: 3px;
}

.procomm-quick-chip {
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 9999px;
  background: rgba(20, 42, 88, 0.7);
  border: 1px solid rgba(0, 210, 255, 0.3);
  color: #cbd5e1;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.procomm-quick-chip:hover {
  background: rgba(0, 210, 255, 0.2);
  border-color: #00d2ff;
  color: #ffffff;
  transform: translateY(-1px);
}

/* 5. Typing Indicator */
.procomm-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 14px;
  background: rgba(20, 38, 76, 0.65);
  border: 1px solid rgba(77, 137, 240, 0.2);
  border-radius: 14px;
  width: fit-content;
}

.procomm-typing-dot {
  width: 6px;
  height: 6px;
  background: #00d2ff;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.procomm-typing-dot:nth-child(1) { animation-delay: -0.32s; }
.procomm-typing-dot:nth-child(2) { animation-delay: -0.16s; }

/* 6. Chat Input Footer */
.procomm-chat-footer {
  padding: 12px 16px;
  background: linear-gradient(180deg, rgba(8, 16, 36, 0.95) 0%, rgba(4, 8, 20, 0.98) 100%);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.procomm-chat-input {
  flex: 1;
  background: rgba(14, 28, 60, 0.8);
  border: 1px solid rgba(77, 137, 240, 0.3);
  border-radius: 9999px;
  padding: 9px 16px;
  color: #ffffff;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s ease;
}

.procomm-chat-input:focus {
  border-color: #00d2ff;
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.35);
  background: rgba(18, 36, 76, 0.95);
}

.procomm-chat-input::placeholder {
  color: #64748b;
}

.procomm-chat-mic-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(14, 30, 64, 0.8);
  border: 1px solid rgba(0, 210, 255, 0.4);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  position: relative;
}

.procomm-chat-mic-btn:hover {
  background: rgba(0, 210, 255, 0.15);
  border-color: #00d2ff;
  color: #00d2ff;
  transform: scale(1.05);
}

.procomm-chat-mic-btn.listening {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  border-color: #f87171;
  color: #ffffff;
  animation: micPulse 1.2s infinite alternate;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
}

.procomm-chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(180deg, #2b7af6 0%, #1558ce 100%);
  border: 1px solid rgba(0, 210, 255, 0.4);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.procomm-chat-send-btn:hover:not(:disabled) {
  background: linear-gradient(180deg, #3d88f8 0%, #1c64df 100%);
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
}

.procomm-chat-send-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@keyframes micPulse {
  0% { transform: scale(1); box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }
  100% { transform: scale(1.12); box-shadow: 0 0 22px rgba(239, 68, 68, 0.9); }
}

/* Animations */
@keyframes promptFloat {
  0% { transform: translateY(0px); }
  100% { transform: translateY(-4px); }
}

@keyframes pulseGreen {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(2.2); opacity: 0; }
}

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); opacity: 0.3; }
  40% { transform: scale(1); opacity: 1; }
}

@keyframes msgSlideIn {
  0% { opacity: 0; transform: translateY(8px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Mobile Responsiveness */
@media (max-width: 600px) {
  .procomm-chat-launcher {
    bottom: 16px;
    right: 16px;
  }

  .procomm-chat-prompt-pill {
    display: none; /* Hide floating pill on small mobile screens to prevent overlap */
  }

  .procomm-chat-window {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
}
