/* Praxis MedServices AI Chat Widget Styles */

.praxis-chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 10020;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Chat Toggle Button */
.praxis-chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #0d9488;
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  position: relative;
}

.praxis-chat-toggle:hover {
  background: #0f766e;
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.4);
}

.praxis-chat-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #ef4444;
  color: white;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

/* Chat Window */
.praxis-chat-window {
  position: absolute;
  bottom: 80px;
  right: 0;
  width: 380px;
  height: min(600px, calc(100vh - 120px));
  background: white;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Chat Header */
.praxis-chat-header {
  background: #0d9488;
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.praxis-chat-header-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.praxis-chat-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.praxis-chat-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.praxis-chat-status {
  margin: 4px 0 0 0;
  font-size: 12px;
  opacity: 0.9;
}

.praxis-chat-close {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}

.praxis-chat-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Chat Messages */
.praxis-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
}

.praxis-chat-message {
  display: flex;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.praxis-chat-message-user {
  justify-content: flex-end;
}

.praxis-chat-message-bot {
  justify-content: flex-start;
}

.praxis-chat-message-content {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}

.praxis-chat-message-user .praxis-chat-message-content {
  background: #0d9488;
  color: white;
  border-bottom-right-radius: 4px;
}

.praxis-chat-message-bot .praxis-chat-message-content {
  background: white;
  color: #1e293b;
  border: 1px solid #e2e8f0;
  border-bottom-left-radius: 4px;
}

.praxis-chat-message-content ul {
  margin: 8px 0;
  padding-left: 20px;
}

.praxis-chat-message-content li {
  margin: 4px 0;
}

.praxis-chat-message-content a {
  color: #0d9488;
  text-decoration: underline;
}

.praxis-chat-message-user .praxis-chat-message-content a {
  color: white;
}

/* Quick Replies */
.praxis-chat-quick-replies {
  padding: 12px 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  background: white;
  border-top: 1px solid #e2e8f0;
}

.praxis-quick-reply {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  color: #1e293b;
}

.praxis-quick-reply:hover {
  background: #0d9488;
  color: white;
  border-color: #0d9488;
}

/* Chat Input */
.praxis-chat-input-container {
  padding: 16px 20px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.praxis-chat-input {
  flex: 1;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color 0.2s;
  max-height: 100px;
}

.praxis-chat-input:focus {
  border-color: #0d9488;
}

.praxis-chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #0d9488;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.praxis-chat-send:hover {
  background: #0f766e;
  transform: scale(1.05);
}

.praxis-chat-send:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
  transform: none;
}

/* Disclaimer */
.praxis-chat-disclaimer {
  padding: 8px 20px 12px;
  background: #fef3c7;
  border-top: 1px solid #fbbf24;
  font-size: 11px;
  color: #92400e;
  text-align: center;
}

.praxis-chat-disclaimer a {
  color: #92400e;
  text-decoration: underline;
}

/* Typing Indicator */
.praxis-typing-dots {
  display: flex;
  gap: 4px;
  padding: 8px 0;
}

.praxis-typing-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
  animation: typing 1.4s infinite;
}

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

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

@keyframes typing {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.7;
  }
  30% {
    transform: translateY(-10px);
    opacity: 1;
  }
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .praxis-chat-window {
    width: calc(100vw - 40px);
    height: calc(100vh - 100px);
    bottom: 80px;
    right: 20px;
  }

  .praxis-chat-toggle {
    width: 56px;
    height: 56px;
  }
}

/* Scrollbar Styling */
.praxis-chat-messages::-webkit-scrollbar {
  width: 6px;
}

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

.praxis-chat-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.praxis-chat-messages::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Site-wide promo + CureMD-style right contact rail */
html.has-praxis-promo {
  --praxis-promo-h: 42px;
}

html.has-praxis-promo .topbar,
html.has-praxis-promo header.header {
  top: var(--praxis-promo-h);
}

html.has-praxis-promo .praxis-chat-window {
  height: min(600px, calc(100vh - var(--praxis-promo-h) - 100px));
}

.praxis-promo-banner {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: var(--praxis-promo-h, 42px);
  padding: 8px 48px 8px 16px;
  background: #0b1f33;
  color: #fffcf7;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
  text-align: center;
}

.praxis-promo-banner p {
  margin: 0;
}

.praxis-promo-banner s {
  color: #9bb0b8;
  margin: 0 4px;
}

.praxis-promo-now {
  color: #63d7c0;
  font-weight: 800;
  margin-right: 10px;
}

.praxis-promo-sep {
  margin: 0 8px;
  color: #5c7a86;
}

.praxis-promo-banner a {
  color: #e59b66;
  font-weight: 800;
  white-space: nowrap;
}

.praxis-promo-dismiss {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: #fffcf7;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.praxis-contact-rail {
  position: fixed;
  right: 0;
  top: 42%;
  z-index: 9990;
  display: flex;
  flex-direction: column;
  width: 42px;
}

.praxis-rail-btn {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 108px;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 252, 247, 0.18);
  background: #0b1f33;
  color: #fffcf7;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
}

.praxis-rail-btn:last-of-type {
  border-bottom: 0;
}

.praxis-rail-btn:hover,
.praxis-rail-btn:focus-visible {
  background: #1aa58f;
  color: #0b1f33;
  outline: none;
}

.praxis-call-panel {
  position: absolute;
  right: 50px;
  bottom: 0;
  width: 240px;
  padding: 16px;
  background: #0b1f33;
  color: #fffcf7;
  font-size: 13px;
  line-height: 1.45;
  border-radius: 10px 0 0 10px;
}

.praxis-call-panel p {
  margin: 0 0 10px;
}

.praxis-call-panel a,
.praxis-call-panel button {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: #1aa58f;
  color: #0b1f33;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.praxis-chat-toggle {
  display: none !important;
}

.praxis-chat-widget {
  right: 56px;
}

@media (max-width: 720px) {
  .praxis-promo-banner {
    font-size: 12px;
    padding-right: 40px;
  }

  .praxis-promo-sep {
    display: none;
  }

  .praxis-contact-rail {
    top: auto;
    bottom: 28%;
    width: 40px;
  }

  .praxis-rail-btn {
    min-height: 88px;
    font-size: 11px;
  }

  .praxis-call-panel {
    right: 46px;
    width: min(220px, calc(100vw - 64px));
  }

  .praxis-chat-window {
    right: 0;
  }
}
