/* c:/Users/stick/Desktop/dentesteticadent/chat-widget.css */

#dent-estetica-chat-widget {
  position: fixed;
  z-index: 9999;
  font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#dent-estetica-chat-widget .cw-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0D9B8A, #0BBF99);
  box-shadow: 0 8px 24px rgba(13, 155, 138, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border: none;
  padding: 0;
  margin: 0;
}

#dent-estetica-chat-widget .cw-launcher:hover {
  transform: scale(1.08) translateY(-4px);
  box-shadow: 0 12px 28px rgba(13, 155, 138, 0.5);
}

#dent-estetica-chat-widget .cw-launcher svg {
  width: 32px;
  height: 32px;
  fill: #FFFFFF;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: absolute;
}

#dent-estetica-chat-widget .cw-launcher.cw-open {
  transform: scale(1);
  background: #FFFFFF; /* Fundal alb pentru 'X' */
  border: 1px solid #E2E8F0;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

#dent-estetica-chat-widget .cw-launcher.cw-open .cw-icon-chat {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

#dent-estetica-chat-widget .cw-launcher.cw-open .cw-icon-close {
  opacity: 1;
  transform: rotate(0) scale(1);
  fill: #0F172A;
}

#dent-estetica-chat-widget .cw-launcher:not(.cw-open) .cw-icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

#dent-estetica-chat-widget .cw-launcher:not(.cw-open) .cw-icon-chat {
  opacity: 1;
  transform: rotate(0) scale(1);
}

#dent-estetica-chat-widget .cw-notification-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 14px;
  height: 14px;
  background-color: #EF4444;
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  animation: cw-pulse 2s infinite cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tooltip */
#dent-estetica-chat-widget .cw-tooltip {
  position: fixed;
  bottom: 104px;
  right: 24px;
  background: #FFFFFF;
  padding: 16px 20px !important;
  border-radius: 16px;
  border-bottom-right-radius: 4px;
  box-shadow: 0 10px 40px -10px rgba(15, 23, 42, 0.15);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  color: #0F172A;
  max-width: 280px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.95);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
  margin: 0 !important;
}

#dent-estetica-chat-widget .cw-tooltip.cw-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

#dent-estetica-chat-widget .cw-tooltip::after {
  content: '';
  position: absolute;
  bottom: -6px;
  right: 26px;
  width: 12px;
  height: 12px;
  background: #FFFFFF;
  transform: rotate(45deg);
  border-bottom-right-radius: 3px;
}

#dent-estetica-chat-widget .cw-tooltip-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  background: #FFFFFF;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  transition: all 0.2s;
  padding: 0;
  margin: 0;
}

#dent-estetica-chat-widget .cw-tooltip-close:hover {
  background: #F1F5F9;
  color: #0F172A;
}

/* Window */
#dent-estetica-chat-widget .cw-window {
  position: fixed;
  bottom: 104px;
  right: 24px;
  width: 350px; /* Mai îngust */
  height: 520px; /* Mai scurt */
  max-height: calc(100vh - 240px); /* Păstrează spațiu MULT mai mare (aprox 130px) pentru navbar-ul de sus */
  background: #FFFFFF;
  border-radius: 24px;
  box-shadow: 0 12px 48px -12px rgba(15, 23, 42, 0.2), 0 0 24px -6px rgba(13, 155, 138, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transform-origin: bottom right;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-sizing: border-box;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

#dent-estetica-chat-widget .cw-window.cw-show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

#dent-estetica-chat-widget .cw-window.cw-hide {
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all 0.2s ease-in;
}

/* Header */
#dent-estetica-chat-widget .cw-header {
  background: #0B1121;
  background-image: radial-gradient(circle at top right, rgba(34, 181, 165, 0.15), transparent);
  color: #FFFFFF;
  padding: 14px 20px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  box-sizing: border-box;
  border-top-left-radius: 24px;
  border-top-right-radius: 24px;
  margin: 0 !important;
  width: 100%;
}

#dent-estetica-chat-widget .cw-header-info {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
}

#dent-estetica-chat-widget .cw-header-title {
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 0;
  padding: 0;
}

#dent-estetica-chat-widget .cw-header-icon svg {
  width: 22px;
  height: 22px;
  stroke: #22B5A5;
}

#dent-estetica-chat-widget .cw-header-subtitle {
  font-size: 13px;
  color: #94A3B8;
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  margin: 0;
  padding: 0;
}

#dent-estetica-chat-widget .cw-status-dot {
  width: 8px;
  height: 8px;
  background-color: #22C55E;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
  margin: 0;
  padding: 0;
}

#dent-estetica-chat-widget .cw-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  padding: 0;
}

#dent-estetica-chat-widget .cw-header-btn {
  background: transparent;
  border: none;
  color: #FFFFFF;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  margin: 0;
  border-radius: 8px;
}

#dent-estetica-chat-widget .cw-header-btn:hover {
  opacity: 1;
  background: rgba(255,255,255,0.1);
}

#dent-estetica-chat-widget .cw-header-btn svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Messages Area */
#dent-estetica-chat-widget .cw-messages {
  flex: 1;
  background: #FFFFFF;
  padding: 24px !important;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
  box-sizing: border-box;
  margin: 0 !important;
  width: 100%;
}

#dent-estetica-chat-widget .cw-messages::-webkit-scrollbar {
  width: 6px;
}
#dent-estetica-chat-widget .cw-messages::-webkit-scrollbar-track {
  background: transparent;
}
#dent-estetica-chat-widget .cw-messages::-webkit-scrollbar-thumb {
  background: #E2E8F0;
  border-radius: 10px;
}

#dent-estetica-chat-widget .cw-message-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 88%;
  animation: cw-messageFadeIn 0.3s ease-out forwards;
  margin: 0;
  padding: 0;
}

#dent-estetica-chat-widget .cw-message-wrapper.cw-bot {
  align-self: flex-start;
}

#dent-estetica-chat-widget .cw-message-wrapper.cw-user {
  align-self: flex-end;
  align-items: flex-end;
}

#dent-estetica-chat-widget .cw-message {
  padding: 14px 18px;
  font-size: 15px;
  line-height: 1.5;
  word-wrap: break-word;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  box-sizing: border-box;
  margin: 0;
}

#dent-estetica-chat-widget .cw-bot .cw-message {
  background: #F1F5F9;
  color: #1E293B;
  border-radius: 20px 20px 20px 4px;
}

#dent-estetica-chat-widget .cw-user .cw-message {
  background: linear-gradient(135deg, #0D9B8A, #0BBF99);
  color: #FFFFFF;
  border-radius: 20px 20px 4px 20px;
  font-weight: 500;
}

#dent-estetica-chat-widget .cw-timestamp {
  font-size: 11px;
  color: #94A3B8;
  margin-top: 6px;
  margin-bottom: 4px;
  font-weight: 600;
  opacity: 0.8;
  padding: 0;
}

#dent-estetica-chat-widget .cw-user .cw-timestamp {
  text-align: right;
}

/* Quick Replies */
#dent-estetica-chat-widget .cw-quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  width: 100%;
  padding: 0;
}

#dent-estetica-chat-widget .cw-quick-reply-btn {
  background: #FFFFFF;
  border: 1.5px solid #0D9B8A;
  color: #0D9B8A;
  padding: 8px 14px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-sizing: border-box;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  line-height: 1;
}

#dent-estetica-chat-widget .cw-quick-reply-btn:hover {
  background: #0D9B8A;
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 155, 138, 0.25);
}

#dent-estetica-chat-widget .cw-qr-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

#dent-estetica-chat-widget .cw-qr-icon svg {
  width: 16px !important;
  height: 16px !important;
  stroke: currentColor;
  flex-shrink: 0;
}

/* Typing Indicator */
#dent-estetica-chat-widget .cw-typing-indicator {
  display: flex;
  gap: 6px;
  padding: 16px 20px;
  background: #F1F5F9;
  border-radius: 20px 20px 20px 4px;
  width: fit-content;
  align-self: flex-start;
  margin-bottom: 8px;
  box-sizing: border-box;
}

#dent-estetica-chat-widget .cw-typing-dot {
  width: 8px;
  height: 8px;
  background: #0D9B8A;
  border-radius: 50%;
  opacity: 0.6;
  animation: cw-typingBounce 1.4s infinite ease-in-out both;
  margin: 0;
  padding: 0;
}

#dent-estetica-chat-widget .cw-typing-dot:nth-child(1) { animation-delay: -0.32s; }
#dent-estetica-chat-widget .cw-typing-dot:nth-child(2) { animation-delay: -0.16s; }

/* Input Bar */
#dent-estetica-chat-widget .cw-input-area {
  padding: 20px 24px;
  background: #FFFFFF;
  border-top: 1px solid #F1F5F9;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  margin: 0;
}

#dent-estetica-chat-widget .cw-input-wrapper {
  display: flex;
  align-items: center;
  background: #F8FAFC;
  border-radius: 100px;
  padding: 8px 8px 8px 24px;
  transition: all 0.2s;
  border: 1px solid #E2E8F0;
  box-sizing: border-box;
  margin: 0;
}

#dent-estetica-chat-widget .cw-input-wrapper:focus-within {
  background: #FFFFFF;
  border-color: rgba(13, 155, 138, 0.4);
  box-shadow: 0 0 0 4px rgba(13, 155, 138, 0.1);
}

#dent-estetica-chat-widget .cw-input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 12px;
  font-size: 15px;
  color: #334155;
  outline: none;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  min-height: 44px;
  font-family: inherit;
}

#dent-estetica-chat-widget .cw-input::placeholder {
  color: #94A3B8;
  font-weight: 500;
}

#dent-estetica-chat-widget .cw-send-btn {
  background: linear-gradient(135deg, #0D9B8A, #0BBF99);
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 12px;
  transition: all 0.2s;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(13, 155, 138, 0.3);
  padding: 0;
}

#dent-estetica-chat-widget .cw-send-btn:hover:not(:disabled) {
  transform: scale(1.05) translateY(-1px);
  box-shadow: 0 6px 16px rgba(13, 155, 138, 0.45);
}

#dent-estetica-chat-widget .cw-send-btn:disabled {
  background: #CBD5E1;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

#dent-estetica-chat-widget .cw-send-btn svg {
  width: 20px;
  height: 20px;
  fill: #FFFFFF;
  margin-left: -2px; /* slight visual offset for the send arrow */
}

#dent-estetica-chat-widget .cw-input-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
  padding: 0 4px;
  box-sizing: border-box;
}

#dent-estetica-chat-widget .cw-char-counter {
  font-size: 12px;
  color: #94A3B8;
  font-weight: 600;
  margin: 0;
  padding: 0;
}

#dent-estetica-chat-widget .cw-char-counter.cw-limit-near {
  color: #F59E0B;
}

#dent-estetica-chat-widget .cw-char-counter.cw-limit-reached {
  color: #EF4444;
}

#dent-estetica-chat-widget .cw-privacy-link {
  font-size: 12px;
  color: #94A3B8;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  margin: 0;
  padding: 0;
}

#dent-estetica-chat-widget .cw-privacy-link:hover {
  color: #0D9B8A;
  text-decoration: underline;
}

/* System Message */
#dent-estetica-chat-widget .cw-system-msg {
  text-align: center;
  font-size: 13px;
  color: #B91C1C;
  font-weight: 500;
  margin: 12px 0;
  padding: 8px 12px;
  background: #FEF2F2;
  border-radius: 8px;
  align-self: center;
  border: 1px solid #FECACA;
  box-sizing: border-box;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  #dent-estetica-chat-widget .cw-window {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }
  
  #dent-estetica-chat-widget .cw-launcher {
    bottom: 16px;
    right: 16px;
  }
  
  #dent-estetica-chat-widget .cw-tooltip {
    bottom: 90px;
    right: 16px;
  }
  
  #dent-estetica-chat-widget .cw-header {
    border-radius: 0;
    padding: 20px;
  }
  
  #dent-estetica-chat-widget .cw-input-area {
    border-radius: 0;
  }
}

/* Animations */
@keyframes cw-pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

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

@keyframes cw-messageFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Teeth Simulator Widget */
.cw-teeth-widget {
  background: white;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border: 1px solid #E2E8F0;
  margin-top: 10px;
}
.cw-arch-title {
  text-align: center;
  font-size: 11px;
  color: #64748B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.cw-arch {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin-bottom: 20px;
}
.cw-arch:last-child {
  margin-bottom: 0;
}
.cw-tooth {
  width: 14px;
  height: 22px;
  background: white;
  border: 1px solid #CBD5E1;
  cursor: pointer;
  transition: all 0.2s;
}
.cw-arch-upper .cw-tooth {
  border-radius: 2px 2px 8px 8px;
}
.cw-arch-lower .cw-tooth {
  border-radius: 8px 8px 2px 2px;
}
.cw-tooth:hover {
  background: #F1F5F9;
  border-color: #94A3B8;
}
.cw-tooth.cw-selected {
  background: #22B5A5;
  border-color: #0D9B8A;
}
.cw-teeth-confirm {
  width: 100%;
  background: #22B5A5;
  color: white;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  margin-top: 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.cw-teeth-confirm:hover {
  background: #0D9B8A;
}
.cw-teeth-confirm:disabled {
  background: #94A3B8;
  cursor: not-allowed;
}
