/* =========================================================================
   CARE CHATBOT - CLEAN STANDARD CHAT WIDGET
   ========================================================================= */

:root {
  --care-teal: #0d9488;
  --care-teal-hover: #0f766e;
  --care-bg: #ffffff;
  --care-gray-50: #f8fafc;
  --care-gray-100: #f1f5f9;
  --care-gray-200: #e2e8f0;
  --care-gray-600: #475569;
  --care-gray-800: #1e293b;
  --care-radius: 16px;
  --care-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Floating Round Chat Launcher */
#care-agent-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--care-teal);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(26, 159, 178, 0.45);
  cursor: pointer;
  z-index: 99999;
  transition: transform 0.2s ease, background-color 0.2s ease;
  border: none;
  outline: none;
}

#care-agent-launcher:hover {
  transform: scale(1.06);
  background: var(--care-teal-hover);
}

#care-agent-launcher svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
}

/* Online Badge Dot on Launcher */
.care-launcher-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 13px;
  height: 13px;
  background-color: #22c55e;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

/* Chat Window */
#care-chat-window {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 375px;
  max-width: calc(100vw - 32px);
  height: 540px;
  max-height: calc(100vh - 48px);
  background: #ffffff;
  border-radius: var(--care-radius);
  box-shadow: var(--care-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  border: 1px solid var(--care-gray-200);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  transform-origin: bottom right;
}

#care-chat-window.minimized {
  transform: scale(0.7) translateY(40px);
  opacity: 0;
  pointer-events: none;
}

/* Header */
.care-header {
  background: var(--care-teal);
  color: #ffffff;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.care-header-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.care-header-avatar {
  position: relative;
  width: 36px;
  height: 36px;
  background: #ffffff;
  color: var(--care-teal);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}

.care-header-avatar svg {
  width: 20px;
  height: 20px;
}

.care-header-dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background-color: #22c55e;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.care-header-info h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.care-header-info p {
  margin: 2px 0 0 0;
  font-size: 11.5px;
  opacity: 0.9;
}

.care-header-close {
  background: transparent;
  border: none;
  color: #ffffff;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}

.care-header-close:hover {
  background: rgba(255, 255, 255, 0.2);
}

.care-header-close svg {
  width: 18px;
  height: 18px;
}

/* Messages Area */
.care-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background-color: var(--care-gray-50);
}

.care-messages::-webkit-scrollbar {
  width: 4px;
}
.care-messages::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 2px;
}

.care-msg {
  display: flex;
  flex-direction: column;
  max-width: 82%;
  animation: careFade 0.18s ease-out;
}

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

.care-msg.user {
  align-self: flex-end;
}

.care-msg.user .care-bubble {
  background: var(--care-teal);
  color: #ffffff;
  border-radius: 16px 16px 4px 16px;
  padding: 10px 14px;
  font-size: 13.5px;
  line-height: 1.45;
  word-break: break-word;
}

.care-msg.assistant {
  align-self: flex-start;
}

.care-msg.assistant .care-bubble {
  background: #ffffff;
  color: var(--care-gray-800);
  border-radius: 16px 16px 16px 4px;
  padding: 11px 15px;
  font-size: 13.5px;
  line-height: 1.5;
  border: 1px solid var(--care-gray-200);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  word-break: break-word;
}

.care-bubble h3 {
  margin: 0 0 6px 0;
  font-size: 14.5px;
  font-weight: 600;
  color: #0f766e;
}

.care-bubble p {
  margin: 0 0 6px 0;
}

.care-bubble p:last-child {
  margin-bottom: 0;
}

.care-bubble ul {
  margin: 4px 0 8px 0;
  padding-left: 18px;
}

.care-bubble li {
  margin-bottom: 3px;
}

.care-bubble code {
  background: var(--care-gray-100);
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 12px;
  color: #0f766e;
}

.care-bubble pre {
  background: #1e293b;
  color: #f8fafc;
  padding: 10px;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 11.5px;
  line-height: 1.4;
  margin: 6px 0;
}

.care-bubble pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* Quick Action Links */
.care-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.care-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #99f6e4;
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}

.care-action-btn:hover {
  background: var(--care-teal);
  color: #ffffff;
  border-color: var(--care-teal);
}

.care-action-btn.copy {
  background: var(--care-gray-100);
  color: var(--care-gray-800);
  border-color: var(--care-gray-200);
}

.care-action-btn.copy:hover {
  background: var(--care-gray-800);
  color: #ffffff;
  border-color: var(--care-gray-800);
}

/* Quick Suggestions */
.care-quick-bar {
  padding: 8px 12px;
  background: #ffffff;
  border-top: 1px solid var(--care-gray-200);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
}

.care-quick-bar::-webkit-scrollbar {
  display: none;
}

.care-quick-btn {
  background: var(--care-gray-100);
  color: var(--care-gray-600);
  border: 1px solid var(--care-gray-200);
  padding: 5px 10px;
  border-radius: 12px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}

.care-quick-btn:hover {
  background: #e6f7f9;
  color: #0b535e;
  border-color: #bce3e8;
}

/* Input Bar */
.care-input-form {
  padding: 10px 14px;
  background: #ffffff;
  border-top: 1px solid var(--care-gray-200);
  display: flex;
  align-items: center;
  gap: 8px;
}

.care-input {
  flex: 1;
  border: 1px solid var(--care-gray-200);
  background: var(--care-gray-50);
  border-radius: 20px;
  padding: 9px 14px;
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
  color: var(--care-gray-800);
  transition: border-color 0.2s, background 0.2s;
}

.care-input:focus {
  border-color: var(--care-teal);
  background: #ffffff;
}

.care-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--care-teal);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.care-send-btn:hover {
  background: var(--care-teal-hover);
  transform: scale(1.05);
}

.care-send-btn svg {
  width: 16px;
  height: 16px;
}

/* Typing Dots */
.care-typing {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 6px;
}

.care-dot {
  width: 6px;
  height: 6px;
  background: var(--care-teal);
  border-radius: 50%;
  animation: careBounce 1.3s infinite ease-in-out both;
}

.care-dot:nth-child(1) { animation-delay: -0.3s; }
.care-dot:nth-child(2) { animation-delay: -0.15s; }

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

@media (max-width: 480px) {
  #care-chat-window {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
}
