/* Core variables */
:root {
  --bb-spot-green: #0be29b;
  --bb-spot-blue-700: #0d1b2a;
  --bb-spot-blue-600: #14273b;
  --bb-spot-blue-500: #1b3552;
  --bb-spot-text: #dce7ff;
}

.bbspot-wrap{position:relative;display:inline-block;vertical-align:middle}
.bbspot-dot{display:inline-block;width:14px;height:14px;border-radius:50%;background:var(--bb-spot-green);cursor:pointer;box-shadow:0 0 0 0 rgba(11,226,155,.7);transition:transform .18s ease, box-shadow .18s ease;animation:bbspot-pulse 2.2s infinite}
.bbspot-dot:hover{transform:scale(1.15)}

/* Tooltip */
.bbspot-tooltip{position:absolute;left:50%;transform:translateX(-50%);bottom:150%;background:#0b1a2a;color:#cfe6ff;padding:6px 9px;border-radius:10px;font-size:12px;white-space:nowrap;opacity:0;pointer-events:none;transition:opacity .2s, transform .2s;box-shadow:0 6px 18px rgba(0,0,0,.35);z-index:10}
.bbspot-wrap:hover .bbspot-tooltip{opacity:1;transform:translateX(-50%) translateY(-4px)}
.bbspot-tooltip::after{content:"";position:absolute;top:100%;left:50%;transform:translateX(-50%);border:6px solid transparent;border-top-color:#0b1a2a}

@keyframes bbspot-pulse{0%{box-shadow:0 0 0 0 rgba(11,226,155,.6)}70%{box-shadow:0 0 0 9px rgba(11,226,155,0)}100%{box-shadow:0 0 0 0 rgba(11,226,155,0)}}

/* Modal */
.bbspot-modal-backdrop{position:fixed;inset:0;background:rgba(6,12,20,.6);backdrop-filter:blur(3px);display:none;z-index:9998}
.bbspot-modal{position:fixed;z-index:9999;inset:auto auto 24px 24px;max-width:360px;background:linear-gradient(180deg,var(--bb-spot-blue-600), var(--bb-spot-blue-500));border:1px solid rgba(255,255,255,.06);border-radius:18px;box-shadow:0 18px 60px rgba(0,0,0,.5);display:none;overflow:hidden}
.bbspot-header{display:flex;align-items:center;gap:10px;padding:10px 12px;border-bottom:1px solid rgba(255,255,255,.06);color:var(--bb-spot-text)}
.bbspot-spoticon{width:14px;height:14px;border-radius:50%;background:var(--bb-spot-green);position:relative}
.bbspot-spoticon::after{content:"";position:absolute;inset:-3px;border-radius:inherit;border:2px solid rgba(11,226,155,.25);animation:bbspot-think 1.6s infinite}
@keyframes bbspot-think{0%{transform:scale(1)}50%{transform:scale(1.2)}100%{transform:scale(1)}}
.bbspot-title{font-weight:700;letter-spacing:.2px}
.bbspot-close{margin-left:auto;background:transparent;border:none;color:#9fb4d1;cursor:pointer;font-size:16px}

.bbspot-body{padding:10px;height:300px;display:flex;flex-direction:column;gap:8px}
.bbspot-log{flex:1;overflow:auto;padding:8px;border-radius:14px;background:rgba(0,0,0,.25);border:1px solid rgba(255,255,255,.05)}
.bbspot-msg{display:flex;gap:8px;margin:8px 0}
.bbspot-msg .dot{min-width:10px;height:10px;background:var(--bb-spot-green);border-radius:50%;margin-top:7px}
.bbspot-msg .dot.thinking-spinner{animation:bbspot-spin 1s linear infinite}
@keyframes bbspot-spin{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}
.bbspot-msg .bubble{max-width:85%;padding:8px 10px;border-radius:12px;font-size:14px;line-height:1.35;word-wrap:break-word;overflow-wrap:break-word}
.bbspot-msg.user .bubble{background:#0d2338;color:#cfe6ff;border:1px solid rgba(255,255,255,.07);margin-left:auto}
.bbspot-msg.assistant .bubble{background:#0f2a44;color:#d7efff;border:1px solid rgba(255,255,255,.06)}

/* Markdown formatting in chat bubbles */
.bbspot-msg .bubble h1, .bbspot-msg .bubble h2, .bbspot-msg .bubble h3, .bbspot-msg .bubble h4{margin:8px 0 4px 0;font-weight:bold;line-height:1.2}
.bbspot-msg .bubble h1{font-size:16px}
.bbspot-msg .bubble h2{font-size:15px}
.bbspot-msg .bubble h3{font-size:14px}
.bbspot-msg .bubble h4{font-size:13px}
.bbspot-msg .bubble p{margin:4px 0;line-height:1.4}
.bbspot-msg .bubble p:first-child{margin-top:0}
.bbspot-msg .bubble p:last-child{margin-bottom:0}
.bbspot-msg .bubble strong{font-weight:bold}
.bbspot-msg .bubble em{font-style:italic}
.bbspot-msg .bubble code{background:rgba(0,0,0,.3);padding:2px 4px;border-radius:3px;font-family:monospace;font-size:12px}
.bbspot-msg .bubble pre{background:rgba(0,0,0,.3);padding:8px;border-radius:6px;margin:4px 0;overflow-x:auto}
.bbspot-msg .bubble pre code{background:none;padding:0}
.bbspot-msg .bubble ul{margin:6px 0;padding-left:16px;max-width:100%;overflow:hidden}
.bbspot-msg .bubble li{margin:2px 0;line-height:1.3;word-wrap:break-word;overflow-wrap:break-word;max-width:100%}
.bbspot-msg .bubble a{color:#4db8ff;text-decoration:underline}
.bbspot-msg .bubble a:hover{color:#6bc5ff}

/* Thinking spinner */
.bbspot-spinner{
  display:inline-block;
  width:12px;
  height:12px;
  border:2px solid rgba(77,184,255,.2);
  border-top:2px solid #4db8ff;
  border-radius:50%;
  animation:bbspot-spin 1s linear infinite;
  margin-right:6px;
  vertical-align:middle;
}

.bbspot-input{display:flex;gap:8px;margin-bottom:8px}
.bbspot-input input{flex:1;min-width:160px;padding:10px 12px;border-radius:12px;border:1px solid rgba(255,255,255,.08);background:#0e2237;color:#e6f1ff}
.bbspot-input button{padding:10px 14px;border-radius:12px;border:0;font-weight:700;cursor:pointer}
.bbspot-input .bbspot-send{background:var(--bb-spot-green);color:#06221a}
.bbspot-input button:disabled{opacity:.7;cursor:not-allowed}

/* Quick Links Menu */
.bbspot-quick-links{display:flex;gap:8px;flex-wrap:wrap;padding:8px 0;border-top:1px solid rgba(255,255,255,.08)}
.bbspot-quick-links a{color:#7fb3ff;text-decoration:none;font-size:12px;padding:4px 6px;border-radius:6px;transition:all .2s ease;white-space:nowrap}
.bbspot-quick-links a:hover{background:rgba(127,179,255,.1);color:#9fc7ff}

@media (max-width:520px){
  .bbspot-modal{inset:auto 12px 12px 12px;max-width:unset}
}

.bbspot-dot{border:0;appearance:none;-webkit-appearance:none}