/* ══════════════════════════════════════════════════════
   Computer Care — Website Companion
   companion.css
   ══════════════════════════════════════════════════════ */

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

/* ── CSS Variables ───────────────────────────────────── */
#ccc-root {
  --cc-primary:    #3B1F6E;
  --cc-mid:        #5C35A0;
  --cc-light:      #8256C8;
  --cc-accent:     #00C9A7;
  --cc-accent2:    #FF6B6B;
  --cc-bg:         #F7F4FC;
  --cc-surface:    #FFFFFF;
  --cc-text:       #1C1335;
  --cc-muted:      #6B5E8A;
  --cc-border:     #E8E0F5;
  --cc-chip-bg:    #EDE6FA;
  --cc-chip-text:  #4A2E8A;
  --cc-shadow:     rgba(59, 31, 110, 0.18);
  --cc-radius:     20px;
  --cc-font:       'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Widget root ─────────────────────────────────────── */
#ccc-root {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999999;
  font-family: var(--cc-font);
  font-size: 14px;
  line-height: 1.55;
  color: var(--cc-text);
}

/* ══════════════════════════════════════════════════════
   TOGGLE BUTTON
   ══════════════════════════════════════════════════════ */
#ccc-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 20px 0 14px;
  height: 52px;
  border-radius: 100px;
  border: none;
  cursor: pointer;
  background: linear-gradient(135deg, var(--cc-primary), var(--cc-light));
  box-shadow: 0 8px 28px var(--cc-shadow), 0 2px 8px rgba(0,0,0,0.12);
  color: white;
  font-family: var(--cc-font);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1),
              box-shadow 0.2s ease,
              padding 0.3s ease;
  position: relative;
  white-space: nowrap;
}
#ccc-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px var(--cc-shadow), 0 4px 12px rgba(0,0,0,0.15);
}
#ccc-toggle:active { transform: translateY(0); }
#ccc-toggle:focus-visible { outline: 2px solid var(--cc-accent); outline-offset: 3px; }

.ccc-toggle-label {
  transition: opacity 0.2s;
}

#ccc-badge {
  position: absolute;
  top: -4px; right: -4px;
  width: 20px; height: 20px;
  background: var(--cc-accent2);
  border-radius: 50%;
  border: 2px solid white;
  font-size: 10px;
  font-weight: 800;
  color: white;
  display: none;
  align-items: center;
  justify-content: center;
}

/* ══════════════════════════════════════════════════════
   PANEL
   ══════════════════════════════════════════════════════ */
#ccc-panel {
  position: absolute;
  bottom: 66px;
  right: 0;
  width: 400px;
  max-height: 620px;
  background: var(--cc-surface);
  border-radius: var(--cc-radius);
  box-shadow: 0 28px 80px rgba(0,0,0,0.16), 0 8px 24px var(--cc-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(.34,1.15,.64,1);
  border: 1px solid var(--cc-border);
}
#ccc-panel.open {
  pointer-events: all;
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ── Header ──────────────────────────────────────────── */
.ccc-header {
  background: linear-gradient(135deg, var(--cc-primary) 0%, var(--cc-mid) 60%, var(--cc-light) 100%);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
/* Subtle decorative circles in header */
.ccc-header::before,
.ccc-header::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
}
.ccc-header::before { width: 100px; height: 100px; top: -40px; right: 30px; }
.ccc-header::after  { width: 60px;  height: 60px;  top: 10px;  right: -10px; }

.ccc-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.ccc-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 2px solid rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ccc-header-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}
.ccc-header-sub {
  font-size: 11.5px;
  color: rgba(255,255,255,0.72);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.ccc-dot {
  width: 6px; height: 6px;
  background: var(--cc-accent);
  border-radius: 50%;
  display: inline-block;
  animation: ccc-pulse 2.5s infinite;
}
@keyframes ccc-pulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%      { opacity:.5; transform:scale(.8); }
}
.ccc-close {
  background: rgba(255,255,255,0.1);
  border: none;
  color: white;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.ccc-close:hover { background: rgba(255,255,255,0.2); }

/* ── Progress bar ────────────────────────────────────── */
.ccc-progress-wrap {
  height: 3px;
  background: var(--cc-border);
  flex-shrink: 0;
}
.ccc-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--cc-accent), var(--cc-light));
  width: 0%;
  transition: width 0.8s ease;
}

/* ── Messages area ───────────────────────────────────── */
.ccc-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 18px 16px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--cc-bg);
  min-height: 0;
  max-height: 440px;
}
.ccc-body::-webkit-scrollbar { width: 4px; }
.ccc-body::-webkit-scrollbar-track { background: transparent; }
.ccc-body::-webkit-scrollbar-thumb { background: #ccc0e8; border-radius: 4px; }

/* ── Messages ────────────────────────────────────────── */
.ccc-msg {
  max-width: 86%;
  animation: ccc-up 0.2s ease;
}
@keyframes ccc-up {
  from { opacity:0; transform:translateY(8px); }
  to   { opacity:1; transform:translateY(0); }
}
.ccc-msg.bot  { align-self: flex-start; }
.ccc-msg.user { align-self: flex-end; }
.ccc-msg.full { max-width: 100%; width: 100%; }

.ccc-bubble {
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 13.5px;
  line-height: 1.6;
}
.bot .ccc-bubble {
  background: var(--cc-surface);
  color: var(--cc-text);
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  border: 1px solid var(--cc-border);
}
.user .ccc-bubble {
  background: linear-gradient(135deg, var(--cc-primary), var(--cc-mid));
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 16px rgba(59,31,110,0.3);
}
.ccc-bubble a {
  color: var(--cc-mid);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.user .ccc-bubble a { color: rgba(255,255,255,0.85); }
.ccc-bubble strong { font-weight: 600; }

/* ── Typing indicator ────────────────────────────────── */
.ccc-typing {
  background: var(--cc-surface);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
  border: 1px solid var(--cc-border);
  padding: 13px 16px;
  width: fit-content;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  display: flex;
  gap: 5px;
  align-items: center;
}
.ccc-typing span {
  width: 7px; height: 7px;
  background: var(--cc-light);
  border-radius: 50%;
  animation: ccc-bounce 1.4s infinite;
  opacity: 0.5;
}
.ccc-typing span:nth-child(2) { animation-delay: 0.2s; }
.ccc-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ccc-bounce {
  0%,80%,100% { transform:translateY(0); opacity:.5; }
  40%          { transform:translateY(-6px); opacity:1; }
}

/* ── Section label ───────────────────────────────────── */
.ccc-label {
  align-self: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--cc-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 4px 12px;
  background: var(--cc-chip-bg);
  border-radius: 20px;
  opacity: 0.8;
}

/* ── Quick-reply chips ───────────────────────────────── */
.ccc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-self: flex-start;
  max-width: 100%;
  animation: ccc-up 0.25s ease;
}
.ccc-chip {
  background: var(--cc-surface);
  border: 1.5px solid var(--cc-mid);
  color: var(--cc-primary);
  border-radius: 100px;
  padding: 7px 15px;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  font-family: var(--cc-font);
  transition: background 0.15s, color 0.15s, transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.ccc-chip:hover {
  background: var(--cc-primary);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59,31,110,0.25);
}

/* ── Resource card ───────────────────────────────────── */
.ccc-resource-card {
  background: var(--cc-surface);
  border: 1.5px solid var(--cc-border);
  border-left: 4px solid var(--cc-accent);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--cc-text);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin-top: 4px;
}
.ccc-resource-card .ccc-rc-label {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--cc-accent);
  margin-bottom: 5px;
}
.ccc-resource-card a {
  color: var(--cc-primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 13.5px;
}
.ccc-resource-card a:hover { text-decoration: underline; }
.ccc-resource-card p {
  color: var(--cc-muted);
  font-size: 12px;
  margin-top: 3px;
}

/* ── Prospect / detail form ──────────────────────────── */
.ccc-form-card {
  background: var(--cc-surface);
  border: 1.5px solid var(--cc-border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.ccc-form-card .ccc-form-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--cc-primary);
  margin-bottom: 2px;
}
.ccc-form-card .ccc-form-sub {
  font-size: 12px;
  color: var(--cc-muted);
  margin-bottom: 4px;
}
.ccc-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.ccc-form-card input,
.ccc-form-card textarea {
  width: 100%;
  border: 1.5px solid var(--cc-border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--cc-font);
  outline: none;
  background: var(--cc-bg);
  transition: border-color 0.18s, background 0.18s;
  resize: none;
  color: var(--cc-text);
}
.ccc-form-card input:focus,
.ccc-form-card textarea:focus {
  border-color: var(--cc-mid);
  background: #fff;
}
.ccc-form-card input::placeholder,
.ccc-form-card textarea::placeholder { color: #aaa; font-size: 12.5px; }
.ccc-form-card textarea { min-height: 60px; }
.ccc-form-submit {
  background: linear-gradient(135deg, var(--cc-primary), var(--cc-mid));
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 13.5px;
  font-weight: 700;
  font-family: var(--cc-font);
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
  letter-spacing: 0.02em;
}
.ccc-form-submit:hover { opacity: 0.9; transform: translateY(-1px); }
.ccc-form-submit:disabled { opacity: 0.5; transform: none; cursor: not-allowed; }
.ccc-form-err {
  font-size: 12px;
  color: #c0392b;
  background: #fdf0ef;
  border: 1px solid #f5c6c3;
  border-radius: 8px;
  padding: 7px 10px;
  display: none;
}
.ccc-form-note {
  font-size: 11px;
  color: var(--cc-muted);
  text-align: center;
}

/* ── Success card ────────────────────────────────────── */
.ccc-success {
  background: #f0fdf6;
  border: 1.5px solid #86efac;
  border-radius: 14px;
  padding: 20px 16px;
  text-align: center;
  color: #15643a;
}
.ccc-success .ccc-s-icon { font-size: 30px; margin-bottom: 8px; }
.ccc-success strong { display: block; font-size: 15px; margin-bottom: 6px; }
.ccc-success span { font-size: 12.5px; color: #1e8047; }

/* ── Input bar ───────────────────────────────────────── */
.ccc-inputbar {
  padding: 12px 14px;
  background: var(--cc-surface);
  border-top: 1px solid var(--cc-border);
  display: flex;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}
.ccc-inputbar textarea {
  flex: 1;
  border: 1.5px solid var(--cc-border);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13.5px;
  font-family: var(--cc-font);
  resize: none;
  outline: none;
  background: var(--cc-bg);
  transition: border-color 0.18s, background 0.18s;
  line-height: 1.45;
  min-height: 42px;
  max-height: 110px;
  color: var(--cc-text);
}
.ccc-inputbar textarea:focus { border-color: var(--cc-mid); background: #fff; }
.ccc-inputbar textarea::placeholder { color: #b0a0c8; font-size: 13px; }
.ccc-send {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--cc-primary), var(--cc-mid));
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(59,31,110,0.3);
}
.ccc-send:hover { transform: scale(1.07); box-shadow: 0 6px 20px rgba(59,31,110,0.45); }
.ccc-send:active { transform: scale(0.95); }
.ccc-send:disabled { opacity: 0.4; transform: none; box-shadow: none; cursor: default; }

/* ── Footer ──────────────────────────────────────────── */
.ccc-footer {
  text-align: center;
  font-size: 10.5px;
  color: var(--cc-muted);
  opacity: 0.6;
  padding: 5px 0 8px;
  background: var(--cc-surface);
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 480px) {
  #ccc-panel { width: calc(100vw - 36px); right: 0; }
  #ccc-root  { bottom: 20px; right: 16px; }
  .ccc-toggle-label { display: none; }
  #ccc-toggle { padding: 0; width: 52px; height: 52px; justify-content: center; border-radius: 50%; }
  .ccc-form-row { grid-template-columns: 1fr; }
}
