/* =========================
   CHAT TOGGLE BUTTON
   ========================= */
#clc-toggle {
  position: fixed;
  right: 30px;
  bottom: 30px;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  color: #fff;
  border: none;
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: all 0.3s ease;
  z-index: 99999;
  position: fixed;
}

#clc-toggle:hover {
  transform: scale(1.08) rotate(6deg);
  box-shadow: 0 14px 35px rgba(79, 70, 229, 0.4);
}

#clc-toggle svg {
  width: 30px;
  height: 30px;
  fill: white;
}

/* Glow ring effect */
#clc-toggle::after {
  content: "";
  position: absolute;
  width: 85px;
  height: 85px;
  border-radius: 50%;
  background: rgba(79, 70, 229, 0.15);
  animation: pulse-ring 2.5s infinite;
  z-index: -1;
}

@keyframes pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.5;
  }
  70% {
    transform: scale(1.6);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 0;
  }
}

/* =========================
   CHAT WIDGET
   ========================= */
#clc-widget {
  position: fixed;
  right: 30px;
  bottom: 110px;
  width: 420px;
  max-width: calc(100% - 40px);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
  display: none;
  background: #fff;
  font-family: 'Inter', sans-serif;
  z-index: 99999;
  animation: slideUp 0.3s ease forwards;
}

#clc-widget.open { display: block; }

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

/* =========================
   HEADER
   ========================= */
.clc-header {
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  color: #fff;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 10px rgba(79,70,229,0.3);
}

.clc-title {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: .3px;
}

#clc-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  transition: transform 0.2s ease, color 0.2s;
}

#clc-close:hover {
  transform: rotate(90deg) scale(1.2);
  color: #e0e7ff;
}

/* =========================
   MESSAGES
   ========================= */
.clc-messages {
  max-height: 400px;
  overflow-y: auto;
  padding: 18px;
  background: #f3f4f6;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
}

.clc-row {
  display: flex;
  margin-bottom: 8px;
  animation: fadeIn 0.25s ease;
}

.clc-row.user { justify-content: flex-end; }

.clc-bubble {
  padding: 12px 18px;
  border-radius: 24px;
  max-width: 75%;
  line-height: 1.45;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background 0.2s;
}

.clc-user .clc-bubble {
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  color: #fff;
  border-bottom-right-radius: 6px;
}

.clc-bot .clc-bubble {
  background: #fff;
  color: #111827;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 6px;
}

/* Subtle bubble animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================
   TYPING INDICATOR
   ========================= */
.clc-typing {
  display: flex;
  gap: 4px;
  align-items: center;
}

.clc-typing .dot {
  width: 8px;
  height: 8px;
  background: #a5b4fc;
  border-radius: 50%;
  animation: blink 1s infinite alternate;
}

.clc-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.clc-typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes blink {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

/* =========================
   INPUT BOX
   ========================= */
.clc-input {
  display: flex;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.clc-input input {
  flex: 1;
  padding: 15px 16px;
  border: none;
  outline: none;
  font-size: 14px;
  border-radius: 0 0 0 22px;
}

.clc-input button {
  background: linear-gradient(135deg, #4f46e5, #3b82f6);
  color: #fff;
  border: none;
  padding: 0 22px;
  cursor: pointer;
  font-weight: 500;
  border-radius: 0 0 22px 0;
  transition: background 0.2s, transform 0.2s;
}

.clc-input button:hover {
  background: linear-gradient(135deg, #4338ca, #3730a3);
  transform: scale(1.05);
}


.clc-agent {
  display: flex;
  align-items: center;
  gap: 10px;
}

.clc-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
