/* ============================================================
   COATINGS COLLEGE — Assistant Widget Styles
   Matches the editorial dark + gold design system
   ============================================================ */

#cc-assistant-root {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9999;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Launcher button ─────────────────────────────────────── */
#cc-asst-launcher {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold, #c9932a) 0%, #e6b34a 100%);
  border: none;
  color: var(--ink, #0b0b0c);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 28px rgba(201, 147, 42, 0.35), 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.2s, visibility 0.2s;
  position: relative;
}
#cc-asst-launcher:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 38px rgba(201, 147, 42, 0.5), 0 4px 16px rgba(0,0,0,0.35);
}
#cc-asst-launcher.hidden {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.7);
}

.cc-asst-launcher-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--gold, #c9932a);
  opacity: 0.4;
  animation: cc-pulse 2.4s ease-out infinite;
  z-index: -1;
}
@keyframes cc-pulse {
  0%   { transform: scale(1);    opacity: 0.4; }
  100% { transform: scale(1.6);  opacity: 0; }
}

/* ── Panel ───────────────────────────────────────────────── */
#cc-asst-panel {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 560px;
  max-height: calc(100vh - 60px);
  background: #131315;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.96);
  transform-origin: bottom right;
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}
#cc-asst-panel.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* ── Header ──────────────────────────────────────────────── */
.cc-asst-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(201, 147, 42, 0.08) 0%, transparent 100%);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.cc-asst-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold, #c9932a), #e6b34a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink, #0b0b0c);
  flex-shrink: 0;
}
.cc-asst-title { flex: 1; line-height: 1.2; }
.cc-asst-title strong {
  display: block;
  color: #f4f1ea;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.cc-asst-title small {
  color: #888581;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cc-asst-title small::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
  display: inline-block;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}
.cc-asst-close {
  background: none;
  border: none;
  color: #888581;
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  transition: background 0.15s, color 0.15s;
}
.cc-asst-close:hover {
  background: rgba(255,255,255,0.05);
  color: #f4f1ea;
}

/* ── Messages ────────────────────────────────────────────── */
.cc-asst-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  scroll-behavior: smooth;
}
.cc-asst-messages::-webkit-scrollbar { width: 4px; }
.cc-asst-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.08);
  border-radius: 4px;
}

.cc-asst-msg { display: flex; }
.cc-asst-msg-user { justify-content: flex-end; }
.cc-asst-msg-bot { justify-content: flex-start; }

.cc-asst-bubble {
  max-width: 85%;
  padding: 11px 15px;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #e5e1d8;
  word-wrap: break-word;
}
.cc-asst-msg-bot .cc-asst-bubble {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  border-bottom-left-radius: 4px;
}
.cc-asst-msg-user .cc-asst-bubble {
  background: linear-gradient(135deg, var(--gold, #c9932a), #b87f1f);
  color: #0b0b0c;
  font-weight: 500;
  border-bottom-right-radius: 4px;
}
.cc-asst-bubble p { margin: 0 0 8px; }
.cc-asst-bubble p:last-child { margin: 0; }
.cc-asst-bubble a {
  color: var(--gold, #c9932a);
  text-decoration: none;
  font-weight: 500;
  border-bottom: 1px solid rgba(201, 147, 42, 0.4);
  transition: border-color 0.15s;
}
.cc-asst-bubble a:hover { border-color: var(--gold, #c9932a); }
.cc-asst-msg-user .cc-asst-bubble a { color: #0b0b0c; border-color: rgba(0,0,0,0.4); }
.cc-asst-bubble strong { color: #f4f1ea; font-weight: 600; }
.cc-asst-msg-user .cc-asst-bubble strong { color: #0b0b0c; }

/* Typing indicator */
.cc-asst-typing {
  display: inline-flex;
  gap: 4px;
  padding: 14px 16px;
}
.cc-asst-typing span {
  width: 7px;
  height: 7px;
  background: rgba(244, 241, 234, 0.45);
  border-radius: 50%;
  animation: cc-typing 1.2s infinite;
}
.cc-asst-typing span:nth-child(2) { animation-delay: 0.15s; }
.cc-asst-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes cc-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

/* ── Suggestion chips ────────────────────────────────────── */
.cc-asst-suggestions {
  padding: 0 18px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}
.cc-asst-suggestions button {
  background: rgba(201, 147, 42, 0.08);
  border: 1px solid rgba(201, 147, 42, 0.2);
  color: #d4c8a8;
  padding: 7px 12px;
  border-radius: 18px;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.cc-asst-suggestions button:hover {
  background: rgba(201, 147, 42, 0.18);
  border-color: rgba(201, 147, 42, 0.45);
  color: #f4f1ea;
  transform: translateY(-1px);
}

/* ── Input ───────────────────────────────────────────────── */
.cc-asst-input {
  display: flex;
  gap: 8px;
  padding: 12px 14px 14px;
  background: rgba(0,0,0,0.25);
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.cc-asst-input input {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: #f4f1ea;
  padding: 11px 14px;
  border-radius: 10px;
  font-size: 0.875rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.cc-asst-input input:focus {
  border-color: rgba(201, 147, 42, 0.45);
  background: rgba(255,255,255,0.06);
}
.cc-asst-input input::placeholder { color: #6b6862; }
.cc-asst-input button[type="submit"] {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--gold, #c9932a), #b87f1f);
  color: #0b0b0c;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}
.cc-asst-input button[type="submit"]:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(201, 147, 42, 0.35);
}

/* ── Mobile adjustments ──────────────────────────────────── */
@media (max-width: 768px) {
  #cc-assistant-root { bottom: 18px; right: 18px; }
  #cc-asst-launcher { width: 56px; height: 56px; }
}

@media (max-width: 480px) {
  /* Keep launcher anchored to the bottom-right, but float
     the panel as a full-width drawer just above the launcher */
  #cc-assistant-root { bottom: 16px; right: 16px; }
  #cc-asst-launcher { width: 52px; height: 52px; }
  #cc-asst-panel {
    position: fixed;
    bottom: 84px;
    right: 16px;
    left: 16px;
    width: auto;
    height: calc(100vh - 120px);
    height: calc(100dvh - 120px);
    max-width: none;
    border-radius: 14px;
  }
  .cc-asst-bubble { font-size: 0.9rem; max-width: 88%; }
  .cc-asst-suggestions button { font-size: 0.74rem; padding: 7px 11px; }
  .cc-asst-input input { font-size: 16px; } /* prevent iOS zoom */
  .cc-asst-suggestions { padding: 0 14px 10px; }
  .cc-asst-input { padding: 10px 12px 12px; }
  .cc-asst-messages { padding: 16px 14px; }
}
