/* ══════════════════════════════════════════════════════
   Computer Care Chat Widget — chat-widget.css
   ══════════════════════════════════════════════════════ */

#cc-widget *,
#cc-widget *::before,
#cc-widget *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

#cc-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999999;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #1a1a2e;
}

/* ── Toggle button ───────────────────────────────────── */
#cc-toggle {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: linear-gradient(145deg, #6B2FA0, #9B4ECA);
  box-shadow: 0 8px 32px rgba(107,47,160,.45), 0 2px 8px rgba(0,0,0,.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .2s;
  position: relative;
  outline-offset: 3px;
}
#cc-toggle:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(107,47,160,.6), 0 4px 12px rgba(0,0,0,.25);
}
#cc-toggle:active { transform: scale(.97); }
#cc-toggle:focus-visible { outline: 2px solid #9B4ECA; }

/* Badge */
#cc-badge {
  position: absolute;
  top: 0; right: 2px;
  width: 18px; height: 18px;
  background: #FF4C6A;
  border-radius: 50%;
  border: 2px solid #fff;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
}

/* ── Chat window ─────────────────────────────────────── */
#cc-window {
  position: absolute;
  bottom: 78px;
  right: 0;
  width: 390px;
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(0,0,0,.18), 0 8px 24px rgba(107,47,160,.1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateY(16px) scale(.97);
  transition: opacity .28s ease, transform .28s cubic-bezier(.34,1.2,.64,1);
}
#cc-window.open {
  pointer-events: all;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── Header ──────────────────────────────────────────── */
.cc-header {
  background: linear-gradient(135deg, #5A2590, #8B3FBF);
  padding: 18px 20px 16px;
  display: flex;
  align-items: center;
  gap: 13px;
  flex-shrink: 0;
}
.cc-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.cc-header-text h3 {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .01em;
}
.cc-header-text p {
  font-size: 12px;
  color: rgba(255,255,255,.75);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.cc-dot {
  width: 7px; height: 7px;
  background: #5DFF9A;
  border-radius: 50%;
  display: inline-block;
  animation: cc-pulse 2.5s infinite;
}
@keyframes cc-pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.6; transform:scale(.85); }
}
.cc-close {
  margin-left: auto;
  background: rgba(255,255,255,.12);
  border: none;
  color: rgba(255,255,255,.9);
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  flex-shrink: 0;
}
.cc-close:hover { background: rgba(255,255,255,.22); }

/* ── Messages area ───────────────────────────────────── */
.cc-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #F4F1FA;
  min-height: 0;
  max-height: 420px;
}
.cc-body::-webkit-scrollbar { width: 4px; }
.cc-body::-webkit-scrollbar-track { background: transparent; }
.cc-body::-webkit-scrollbar-thumb { background: #d0beee; border-radius: 4px; }

/* ── Messages ────────────────────────────────────────── */
.cc-msg {
  max-width: 84%;
  animation: cc-fadeUp .22s ease;
}
@keyframes cc-fadeUp {
  from { opacity:0; transform:translateY(10px); }
  to   { opacity:1; transform:translateY(0); }
}
.cc-msg.bot  { align-self: flex-start; }
.cc-msg.user { align-self: flex-end; }
.cc-msg.full { max-width: 100%; width: 100%; }

.cc-bubble {
  padding: 11px 15px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.55;
}
.bot  .cc-bubble {
  background: #fff;
  color: #1a1a2e;
  border-bottom-left-radius: 5px;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
}
.user .cc-bubble {
  background: linear-gradient(135deg, #5A2590, #8B3FBF);
  color: #fff;
  border-bottom-right-radius: 5px;
  box-shadow: 0 4px 16px rgba(90,37,144,.35);
}
.cc-bubble a { color: #7B3FBF; text-decoration: underline; }
.user .cc-bubble a { color: #e0c8ff; }

/* ── Typing indicator ────────────────────────────────── */
.cc-typing {
  background: #fff;
  border-radius: 18px;
  border-bottom-left-radius: 5px;
  padding: 14px 18px;
  width: fit-content;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  display: flex;
  gap: 5px;
  align-items: center;
}
.cc-typing span {
  width: 7px; height: 7px;
  background: #9B4ECA;
  border-radius: 50%;
  animation: cc-bounce 1.3s infinite;
  opacity: .5;
}
.cc-typing span:nth-child(2) { animation-delay: .18s; }
.cc-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes cc-bounce {
  0%,80%,100% { transform:translateY(0); opacity:.5; }
  40%          { transform:translateY(-7px); opacity:1; }
}

/* ── Quick-reply chips ───────────────────────────────── */
.cc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-self: flex-start;
  max-width: 100%;
}
.cc-chip {
  background: #fff;
  border: 1.5px solid #9B4ECA;
  color: #6B2FA0;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .18s, color .18s, transform .15s;
  font-family: inherit;
  font-weight: 500;
  white-space: nowrap;
}
.cc-chip:hover {
  background: #6B2FA0;
  color: #fff;
  transform: translateY(-1px);
}

/* ── Detail / ticket form ────────────────────────────── */
.cc-form-card {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.07);
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.cc-form-card p {
  font-size: 12.5px;
  color: #666;
  margin-bottom: 2px;
}
.cc-form-card input,
.cc-form-card textarea {
  width: 100%;
  border: 1.5px solid #e6daf5;
  border-radius: 9px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: #faf8fe;
  transition: border-color .18s, background .18s;
  resize: none;
  color: #1a1a2e;
}
.cc-form-card input:focus,
.cc-form-card textarea:focus {
  border-color: #9B4ECA;
  background: #fff;
}
.cc-form-card textarea { min-height: 68px; }
.cc-submit {
  background: linear-gradient(135deg, #5A2590, #8B3FBF);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .2s, transform .15s;
  letter-spacing: .02em;
}
.cc-submit:hover { opacity: .9; transform: translateY(-1px); }
.cc-submit:disabled { opacity: .55; transform: none; cursor: not-allowed; }
.cc-err {
  font-size: 12px;
  color: #d63636;
  display: none;
  padding: 6px 10px;
  background: #fff0f0;
  border-radius: 7px;
  border: 1px solid #ffd0d0;
}

/* ── Success card ────────────────────────────────────── */
.cc-success-card {
  background: #f0fdf6;
  border: 1.5px solid #86efac;
  border-radius: 14px;
  padding: 16px;
  color: #15643a;
  text-align: center;
  font-size: 13.5px;
}
.cc-success-card .cc-tick { font-size: 28px; margin-bottom: 8px; }
.cc-success-card strong { display: block; font-size: 14.5px; margin-bottom: 5px; }
.cc-success-card span { font-size: 12.5px; color: #1e8047; }

/* ── Input bar ───────────────────────────────────────── */
.cc-inputbar {
  padding: 12px 14px;
  background: #fff;
  border-top: 1px solid #efe8fa;
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
.cc-inputbar textarea {
  flex: 1;
  border: 1.5px solid #e6daf5;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-family: inherit;
  resize: none;
  outline: none;
  background: #faf8fe;
  transition: border-color .18s;
  line-height: 1.45;
  min-height: 42px;
  max-height: 120px;
  color: #1a1a2e;
}
.cc-inputbar textarea:focus { border-color: #9B4ECA; background: #fff; }
.cc-inputbar textarea::placeholder { color: #aaa; }
.cc-send {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, #5A2590, #8B3FBF);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s, opacity .2s, box-shadow .2s;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(90,37,144,.3);
}
.cc-send:hover { transform: scale(1.07); box-shadow: 0 6px 20px rgba(90,37,144,.45); }
.cc-send:active { transform: scale(.96); }
.cc-send:disabled { opacity: .45; transform: none; box-shadow: none; cursor: default; }

/* ── Powered-by bar ──────────────────────────────────── */
.cc-powered {
  text-align: center;
  font-size: 10.5px;
  color: #b0a0c8;
  padding: 5px 0 8px;
  background: #fff;
  flex-shrink: 0;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 460px) {
  #cc-window { width: calc(100vw - 40px); right: 0; }
  #cc-widget { bottom: 18px; right: 16px; }
}
