/* Dentesse Chat Widget - chat.css */
#ccw-root * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

#ccw-bubble {
  position: fixed;
  bottom: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  transition: transform 0.2s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
#ccw-bubble:hover { transform: scale(1.08); }
#ccw-bubble.ccw-right { right: 24px; }
#ccw-bubble.ccw-left  { left: 24px; }

#ccw-unread {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 13px;
  height: 13px;
  background: #e24b4a;
  border-radius: 50%;
  border: 2px solid #fff;
  display: none;
}

#ccw-panel {
  position: fixed;
  bottom: 96px;
  width: 360px;
  height: 520px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 16px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999998;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  transform: translateY(12px) scale(0.97);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
#ccw-panel.ccw-right { right: 24px; }
#ccw-panel.ccw-left  { left: 24px; }
#ccw-panel.ccw-open {
  display: flex;
  opacity: 1;
  transform: translateY(0) scale(1);
}

#ccw-header {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.ccw-agent-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ccw-agent-name  { color: #fff; font-size: 14px; font-weight: 600; }
.ccw-agent-status { color: rgba(255,255,255,0.65); font-size: 12px; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.ccw-status-dot  { width: 7px; height: 7px; border-radius: 50%; background: #5dcaa5; display: inline-block; }
#ccw-close {
  margin-left: auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  opacity: 0.7;
  transition: opacity 0.15s;
}
#ccw-close:hover { opacity: 1; }

#ccw-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f8f9fa;
  scrollbar-width: thin;
}

.ccw-msg { display: flex; gap: 8px; max-width: 85%; }
.ccw-msg.ccw-user { align-self: flex-end; flex-direction: row-reverse; }
.ccw-msg.ccw-bot  { align-self: flex-start; }

.ccw-msg-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.ccw-bubble {
  padding: 9px 13px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  color: #1a1a1a;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  word-wrap: break-word;
}
.ccw-msg.ccw-user .ccw-bubble {
  color: #fff;
  border-color: transparent;
  border-radius: 12px 2px 12px 12px;
}
.ccw-msg.ccw-bot .ccw-bubble { border-radius: 2px 12px 12px 12px; }

.ccw-typing {
  display: flex;
  gap: 5px;
  padding: 11px 14px;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: 2px 12px 12px 12px;
  width: fit-content;
}
.ccw-dot {
  width: 7px; height: 7px;
  background: #aaa;
  border-radius: 50%;
  animation: ccwBounce 1.2s infinite;
}
.ccw-dot:nth-child(2) { animation-delay: 0.2s; }
.ccw-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes ccwBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30% { transform: translateY(-5px); opacity: 1; }
}

#ccw-input-area {
  border-top: 1px solid rgba(0,0,0,0.08);
  padding: 10px 12px;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
  background: #fff;
}
#ccw-input {
  flex: 1;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  min-height: 38px;
  max-height: 100px;
  line-height: 1.4;
  background: #f8f9fa;
  color: #1a1a1a;
  transition: border-color 0.15s;
}
#ccw-input:focus { border-color: rgba(0,0,0,0.25); }
#ccw-input::placeholder { color: #999; }

#ccw-send {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: opacity 0.15s, transform 0.1s;
}
#ccw-send:hover { opacity: 0.85; }
#ccw-send:active { transform: scale(0.95); }
#ccw-send:disabled { opacity: 0.35; cursor: not-allowed; }

.ccw-powered {
  text-align: center;
  font-size: 11px;
  color: #aaa;
  padding: 6px;
  border-top: 1px solid rgba(0,0,0,0.06);
  background: #fff;
}
.ccw-powered a { color: inherit; text-decoration: none; }
.ccw-powered a:hover { text-decoration: underline; }

@media (max-width: 420px) {
  #ccw-panel { width: calc(100vw - 32px); right: 16px !important; left: 16px !important; }
  #ccw-bubble.ccw-right { right: 16px; }
  #ccw-bubble.ccw-left  { left: 16px; }
}
