/* ============================================================
   jeury.agent — a tiny dock-summoned AI-persona widget
   Author: Jeury Santos · jeurysantos1.com
   Drop-in feature: include agent.css + agent.js, then call
   JeuryAgent.init({...}) — see README.md
   ============================================================ */

:root {
  --ja-blue: #3D6BBF;
  --ja-blue-light: #5A8AE0;
  --ja-blue-soft: #7DA4E8;
  --ja-ink: #1A1A18;
  --ja-paper: #F6F4F0;
  --ja-green: #5AE08F;
  --ja-font-hand: 'Caveat', cursive;
  --ja-font-body: 'Inter', system-ui, sans-serif;
}

/* ---------- Floating dock ---------- */
.ja-dock {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9990;
  display: flex;
  gap: 0.4rem;
  padding: 0.55rem 0.8rem;
  border-radius: 100px;
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 10px 32px rgba(26, 26, 24, 0.12),
              inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.ja-dock-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.3s,
              transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-decoration: none;
}

.ja-dock-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  transform: scale(1.15) translateY(-3px);
}

.ja-dock-btn svg {
  width: 19px;
  height: 19px;
  stroke: #4A4A44;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke 0.3s, fill 0.3s;
}

.ja-dock-btn:hover svg { stroke: var(--ja-blue); }

/* The sparkle (agent trigger) */
.ja-sparkle svg {
  stroke: var(--ja-blue);
  fill: rgba(61, 107, 191, 0.12);
}
.ja-sparkle:hover svg { fill: rgba(61, 107, 191, 0.3); }
.ja-sparkle.ja-active { background: rgba(61, 107, 191, 0.18); }

/* Attention pulse — single gentle bounce after load */
@keyframes ja-nudge {
  0%, 100% { transform: translateY(0); }
  30%      { transform: translateY(-7px) scale(1.12); }
  55%      { transform: translateY(0) scale(1); }
  70%      { transform: translateY(-3px); }
}
.ja-sparkle.ja-nudge { animation: ja-nudge 0.9s cubic-bezier(0.34, 1.56, 0.64, 1); }

/* ---------- Tooltip ---------- */
.ja-tip {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  white-space: nowrap;
  font-family: var(--ja-font-hand);
  font-size: 1.02rem;
  color: var(--ja-ink);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 100px;
  padding: 0.4rem 0.95rem;
  box-shadow: 0 10px 26px rgba(26, 26, 24, 0.14),
              inset 0 1px 0 rgba(255, 255, 255, 0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.ja-dock-btn:hover .ja-tip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.ja-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: rgba(255, 255, 255, 0.85);
}

/* ---------- Agent panel ---------- */
.ja-panel {
  position: fixed;
  z-index: 9991;
  left: 50%;
  bottom: 84px;
  width: 288px;
  margin-left: -144px;
  border-radius: 20px;
  background: rgba(20, 20, 19, 0.55);
  backdrop-filter: blur(22px) saturate(1.4);
  -webkit-backdrop-filter: blur(22px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.45),
              inset 0 1px 0 rgba(255, 255, 255, 0.22);
  overflow: hidden;
  transform-origin: bottom center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) scale(0.92);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
              opacity 0.35s ease;
}
.ja-panel.ja-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.ja-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.ja-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ja-green);
  box-shadow: 0 0 8px var(--ja-green);
  animation: ja-pulse 2s ease-in-out infinite;
}
@keyframes ja-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.ja-title {
  font-family: var(--ja-font-body);
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(246, 244, 240, 0.75);
}
.ja-badge {
  margin-left: auto;
  font-family: var(--ja-font-hand);
  font-size: 0.85rem;
  color: var(--ja-blue-soft);
}

.ja-body {
  padding: 0.9rem 0.95rem;
  min-height: 88px;
}
.ja-msg {
  font-family: var(--ja-font-body);
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--ja-paper);
  margin: 0;
}
.ja-cursor {
  display: inline-block;
  width: 2px;
  height: 0.85em;
  background: var(--ja-blue-light);
  margin-left: 2px;
  vertical-align: middle;
  animation: ja-blink 0.9s infinite;
}
@keyframes ja-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.ja-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.95rem 0.95rem;
}
.ja-chip {
  font-family: var(--ja-font-body);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: #CDD9F0;
  background: rgba(90, 138, 224, 0.16);
  border: 1px solid rgba(90, 138, 224, 0.35);
  border-radius: 100px;
  padding: 0.38rem 0.8rem;
  cursor: pointer;
  transition: background 0.25s,
              transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
              border-color 0.25s;
}
.ja-chip:hover {
  background: rgba(90, 138, 224, 0.32);
  border-color: rgba(90, 138, 224, 0.6);
  transform: translateY(-2px);
}
.ja-chip:active { transform: scale(0.96); }

.ja-foot {
  font-family: var(--ja-font-hand);
  font-size: 0.92rem;
  color: rgba(125, 164, 232, 0.85);
  text-align: right;
  padding: 0 0.95rem 0.7rem;
  transform: rotate(-1deg);
}

/* ---------- Responsive ---------- */
@media (max-width: 480px) {
  .ja-panel {
    width: min(92vw, 300px);
    margin-left: calc(min(92vw, 300px) / -2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ja-panel, .ja-dock-btn, .ja-tip, .ja-chip { transition: none; }
  .ja-dot, .ja-cursor, .ja-sparkle.ja-nudge { animation: none; }
}
