/* ============================================================
   CRED AGENT WIDGET — cred-widget.css
   Credit Revolution Education Directors LLC
   Version 1.0 | Drop into your Hostinger file manager
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --cred-black:       #0a0a0a;
  --cred-gold:        #C9A84C;
  --cred-gold-light:  #E8C96A;
  --cred-gold-dim:    rgba(201,168,76,0.13);
  --cred-gold-border: rgba(201,168,76,0.28);
  --cred-surface:     #111111;
  --cred-surface2:    #181818;
  --cred-surface3:    #222222;
  --cred-text:        #f0ede6;
  --cred-text-muted:  #888888;
  --cred-agent-bg:    #161616;
  --cred-user-bg:     #1c1a12;
}

/* ── NOTIFICATION BUBBLE ─────────────────────────────────── */
#cred-notif-bubble {
  position: fixed;
  bottom: 104px;
  right: 28px;
  background: var(--cred-surface2);
  border: 1px solid var(--cred-gold-border);
  border-radius: 16px 16px 4px 16px;
  padding: 14px 32px 14px 14px;
  max-width: 260px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  cursor: pointer;
  z-index: 9998;
  animation: cred-slideUp 0.35s cubic-bezier(.22,1,.36,1);
  transition: opacity 0.2s, transform 0.2s;
  font-family: 'Inter', sans-serif;
}
#cred-notif-bubble:hover { transform: translateY(-2px); }

@keyframes cred-slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cred-notif-avatar {
  width: 34px;
  height: 34px;
  background: var(--cred-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  font-weight: 900;
  color: var(--cred-black);
  flex-shrink: 0;
}
.cred-notif-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--cred-gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 3px;
}
.cred-notif-text {
  font-size: 13px;
  color: var(--cred-text);
  line-height: 1.45;
}
.cred-notif-ai-tag {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cred-text-muted);
  margin-top: 5px;
}
#cred-notif-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  color: var(--cred-text-muted);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
}
#cred-notif-close:hover { color: var(--cred-text); }

/* ── LAUNCHER BUTTON ─────────────────────────────────────── */
#cred-launcher {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 62px;
  height: 62px;
  background: var(--cred-gold);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  box-shadow: 0 4px 20px rgba(201,168,76,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
#cred-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(201,168,76,0.55);
}

#cred-launcher .cred-icon-chat,
#cred-launcher .cred-icon-close {
  transition: opacity 0.2s, transform 0.2s;
  position: absolute;
}
#cred-launcher .cred-icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.7);
}
#cred-launcher.open .cred-icon-chat {
  opacity: 0;
  transform: rotate(90deg) scale(0.7);
}
#cred-launcher.open .cred-icon-close {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

/* Pulse rings */
#cred-launcher::before {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(201,168,76,0.45);
  animation: cred-ring 2.2s ease-out infinite;
}
#cred-launcher::after {
  content: '';
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 2px solid rgba(201,168,76,0.2);
  animation: cred-ring 2.2s ease-out 0.5s infinite;
}
@keyframes cred-ring {
  0%   { transform: scale(0.9); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}
#cred-launcher.open::before,
#cred-launcher.open::after { animation: none; opacity: 0; }

/* Unread dot */
#cred-unread-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background: #ef4444;
  border-radius: 50%;
  border: 2px solid #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: white;
  font-family: 'Inter', sans-serif;
}

/* ── CHAT PANEL ──────────────────────────────────────────── */
#cred-panel {
  position: fixed;
  bottom: 104px;
  right: 28px;
  width: 370px;
  max-width: calc(100vw - 40px);
  height: 560px;
  max-height: calc(100vh - 130px);
  background: var(--cred-surface);
  border: 1px solid var(--cred-gold-border);
  border-radius: 20px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 9997;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 1px rgba(201,168,76,0.1);
  transform: scale(0.9) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(.22,1,.36,1), opacity 0.22s ease;
  transform-origin: bottom right;
  font-family: 'Inter', sans-serif;
}
#cred-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Panel header */
.cred-panel-header {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--cred-gold-border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--cred-surface2);
  flex-shrink: 0;
}
.cred-panel-avatar {
  width: 38px;
  height: 38px;
  background: var(--cred-gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 17px;
  color: var(--cred-black);
  flex-shrink: 0;
  position: relative;
}
.cred-panel-avatar::after {
  content: '';
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 9px;
  height: 9px;
  background: #4ade80;
  border-radius: 50%;
  border: 2px solid var(--cred-surface2);
}
.cred-panel-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--cred-text);
  line-height: 1.2;
}
.cred-panel-sub {
  font-size: 10px;
  color: var(--cred-text-muted);
  letter-spacing: 0.05em;
  margin-top: 2px;
}

/* AI Disclosure banner */
.cred-ai-disclosure {
  background: var(--cred-gold-dim);
  border-bottom: 1px solid var(--cred-gold-border);
  padding: 8px 14px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  flex-shrink: 0;
}
.cred-ai-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--cred-gold);
  margin-top: 1px;
}
.cred-ai-disclosure-text {
  font-size: 11px;
  color: var(--cred-text-muted);
  line-height: 1.45;
}
.cred-ai-disclosure-text strong {
  color: var(--cred-gold-light);
  font-weight: 600;
}

/* Chat log */
#cred-chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}
#cred-chat-log::-webkit-scrollbar { width: 3px; }
#cred-chat-log::-webkit-scrollbar-track { background: transparent; }
#cred-chat-log::-webkit-scrollbar-thumb { background: var(--cred-gold-border); border-radius: 2px; }

/* Messages */
.cred-msg { display: flex; gap: 8px; animation: cred-fadeUp 0.22s ease; }
.cred-msg.user { flex-direction: row-reverse; }

@keyframes cred-fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cred-av {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  margin-top: 2px;
}
.cred-av.agent {
  background: var(--cred-gold);
  color: var(--cred-black);
  font-family: 'Playfair Display', serif;
  font-size: 13px;
}
.cred-av.user {
  background: var(--cred-surface3);
  color: var(--cred-text-muted);
  border: 1px solid var(--cred-gold-border);
  font-size: 9px;
}

.cred-bubble {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--cred-text);
}
.cred-msg.agent .cred-bubble {
  background: var(--cred-agent-bg);
  border: 1px solid var(--cred-gold-border);
  border-top-left-radius: 4px;
}
.cred-msg.user .cred-bubble {
  background: var(--cred-user-bg);
  border: 1px solid rgba(201,168,76,0.18);
  border-top-right-radius: 4px;
}

/* Intent badges */
.cred-intent-badge {
  display: inline-block;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 3px;
  margin-bottom: 5px;
  font-weight: 600;
}
.cred-intent-lead    { background: rgba(74,222,128,0.12); color: #4ade80; border: 1px solid rgba(74,222,128,0.28); }
.cred-intent-order   { background: rgba(201,168,76,0.12); color: var(--cred-gold); border: 1px solid var(--cred-gold-border); }
.cred-intent-booking { background: rgba(96,165,250,0.12); color: #60a5fa; border: 1px solid rgba(96,165,250,0.28); }

/* Quick reply chips */
.cred-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cred-chip {
  background: transparent;
  border: 1px solid var(--cred-gold-border);
  color: var(--cred-gold-light);
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  padding: 5px 11px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.16s;
}
.cred-chip:hover {
  background: var(--cred-gold-dim);
  border-color: var(--cred-gold);
  color: var(--cred-gold);
}

/* Typing indicator */
.cred-typing-row { display: flex; gap: 8px; align-items: flex-end; }
.cred-typing-dots {
  background: var(--cred-agent-bg);
  border: 1px solid var(--cred-gold-border);
  border-radius: 14px;
  border-top-left-radius: 4px;
  padding: 11px 15px;
  display: flex;
  gap: 4px;
  align-items: center;
}
.cred-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--cred-gold);
  animation: cred-bounce 1.2s infinite;
}
.cred-dot:nth-child(2) { animation-delay: 0.18s; }
.cred-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes cred-bounce {
  0%,60%,100% { transform: translateY(0); opacity: 0.45; }
  30%          { transform: translateY(-5px); opacity: 1; }
}

/* Input area */
.cred-input-area {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--cred-gold-border);
  background: var(--cred-surface2);
  flex-shrink: 0;
}
.cred-input-row { display: flex; gap: 8px; align-items: flex-end; }

#cred-user-input {
  flex: 1;
  background: var(--cred-surface3);
  border: 1px solid var(--cred-gold-border);
  border-radius: 10px;
  padding: 10px 13px;
  color: var(--cred-text);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  resize: none;
  outline: none;
  line-height: 1.45;
  min-height: 42px;
  max-height: 100px;
  transition: border-color 0.18s;
}
#cred-user-input:focus { border-color: var(--cred-gold); }
#cred-user-input::placeholder { color: var(--cred-text-muted); }

#cred-send-btn {
  background: var(--cred-gold);
  border: none;
  border-radius: 10px;
  width: 42px;
  height: 42px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.16s;
  flex-shrink: 0;
  color: var(--cred-black);
}
#cred-send-btn:hover  { background: var(--cred-gold-light); transform: scale(1.06); }
#cred-send-btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; }

.cred-panel-footer {
  text-align: center;
  font-size: 9.5px;
  color: #555;
  padding: 6px 0 2px;
  letter-spacing: 0.05em;
  font-family: 'Inter', sans-serif;
}
.cred-panel-footer span { color: var(--cred-gold); }
css/* ── MOBILE RESPONSIVE FIX ──────────────────────── */
@media (max-width: 480px) {
  #cred-panel {
    width: calc(100vw - 20px);
    height: 70vh;
    bottom: 90px;
    right: 10px;
    left: 10px;
    border-radius: 16px;
  }

  #cred-launcher {
    bottom: 16px;
    right: 16px;
    width: 54px;
    height: 54px;
  }

  #cred-notif-bubble {
    right: 10px;
    max-width: calc(100vw - 20px);
    bottom: 90px;
  }
}