/* ── Assistant Setharkk - Widget Chatbot v2 (premium design) ── */

#shkk-chatbot-root{
  --shkk-bg: #0a0908;
  --shkk-bg-2: #14110f;
  --shkk-bg-3: #1c1815;
  --shkk-ink: #f5f1e8;
  --shkk-ink-2: #a8a39a;
  --shkk-ink-3: #6b665e;
  --shkk-rule: #2a2520;
  --shkk-gold: #d4a747;
  --shkk-gold-2: #e8c477;
  --shkk-gold-3: #b88a2e;
  --shkk-gold-glow: rgba(212, 167, 71, .35);
  --shkk-gold-soft: rgba(212, 167, 71, .12);
  font-family: 'Geist', ui-sans-serif, system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  color-scheme: dark;
}

/* ─────────────────── Bouton flottant FAB ─────────────────── */
#shkk-fab{
  position: fixed;
  bottom: 28px; right: 28px;
  width: 68px; height: 68px;
  border-radius: 22px;
  background:
    radial-gradient(circle at 30% 30%, var(--shkk-gold-2) 0%, var(--shkk-gold) 60%, var(--shkk-gold-3) 100%);
  border: none;
  color: #0a0908;
  cursor: pointer;
  z-index: 999998;
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 200, .5),
    inset 0 -1px 0 rgba(0, 0, 0, .2),
    0 10px 32px rgba(0, 0, 0, .5),
    0 0 0 1px rgba(212, 167, 71, .3),
    0 0 48px var(--shkk-gold-glow);
  transition: transform .35s cubic-bezier(.2,.9,.3,1.4), box-shadow .35s, border-radius .35s;
  overflow: hidden;
}
#shkk-fab::before{
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.4) 0%, transparent 50%);
  opacity: .8;
  pointer-events: none;
}
#shkk-fab:hover{
  transform: scale(1.08) rotate(-3deg);
  border-radius: 24px;
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 200, .6),
    inset 0 -1px 0 rgba(0, 0, 0, .2),
    0 14px 44px rgba(0, 0, 0, .6),
    0 0 0 1px rgba(212, 167, 71, .5),
    0 0 72px rgba(212, 167, 71, .65);
}
#shkk-fab svg{ width: 30px; height: 30px; position: relative; z-index: 1; stroke-width: 2.4; }
#shkk-fab .shkk-fab-pulse-ring{
  position: absolute; inset: -8px;
  border-radius: 30px;
  border: 2px solid var(--shkk-gold);
  opacity: 0;
  pointer-events: none;
  animation: shkk-pulse-ring 2.6s ease-out infinite;
}
#shkk-fab .shkk-fab-pulse-ring:nth-child(2){ animation-delay: 1.3s; }
#shkk-fab .shkk-fab-label{
  position: absolute; right: 80px; top: 50%; transform: translate(8px, -50%);
  background: rgba(20, 17, 15, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--shkk-ink);
  padding: 10px 16px; border-radius: 12px;
  font-size: 13px; font-weight: 500; white-space: nowrap;
  border: 1px solid rgba(212, 167, 71, .25);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}
#shkk-fab .shkk-fab-label::after{
  content: "";
  position: absolute; left: 100%; top: 50%; transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: rgba(20, 17, 15, .92);
}
#shkk-fab:hover .shkk-fab-label{
  opacity: 1; transform: translate(0, -50%);
}
#shkk-fab.shkk-fab-active{ transform: scale(.92) rotate(0deg); }
#shkk-fab.shkk-fab-active:hover{ transform: scale(.96) rotate(0deg); }
#shkk-fab.shkk-fab-active .shkk-fab-pulse-ring{ display: none; }
#shkk-fab.shkk-fab-active svg.shkk-icon-chat{ display: none; }
#shkk-fab.shkk-fab-active svg.shkk-icon-close{ display: block; }
#shkk-fab svg.shkk-icon-close{ display: none; }
@keyframes shkk-pulse-ring{
  0%{ opacity: .8; transform: scale(.85); }
  100%{ opacity: 0; transform: scale(1.35); }
}
@media (prefers-reduced-motion: reduce){
  #shkk-fab, #shkk-fab:hover{ transform: none; transition: none; }
  #shkk-fab .shkk-fab-pulse-ring{ animation: none; display: none; }
}

/* ─────────────────── Modal de chat ─────────────────── */
#shkk-modal{
  position: fixed;
  bottom: 112px; right: 28px;
  width: 420px; max-width: calc(100vw - 32px);
  height: 640px; max-height: calc(100vh - 140px);
  background: linear-gradient(180deg, var(--shkk-bg-2) 0%, var(--shkk-bg) 100%);
  border: 1px solid rgba(212, 167, 71, .15);
  border-radius: 20px;
  box-shadow:
    0 32px 96px rgba(0, 0, 0, .75),
    0 0 0 1px rgba(255, 255, 255, .03),
    inset 0 1px 0 rgba(255, 255, 255, .04);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 999999;
  isolation: isolate;
}
#shkk-modal::before{
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 80% -10%, rgba(212, 167, 71, .12) 0%, transparent 50%),
    radial-gradient(circle at 0% 110%, rgba(86, 99, 214, .06) 0%, transparent 50%);
  pointer-events: none;
  z-index: -1;
}
#shkk-modal.shkk-open{
  display: flex;
  animation: shkk-modal-in .35s cubic-bezier(.2, .9, .3, 1.05);
}
@keyframes shkk-modal-in{
  from{ opacity: 0; transform: translateY(24px) scale(.96); }
  to{ opacity: 1; transform: translateY(0) scale(1); }
}

/* ─────────────────── Header ─────────────────── */
#shkk-header{
  padding: 18px 20px;
  border-bottom: 1px solid rgba(212, 167, 71, .12);
  background:
    linear-gradient(180deg, rgba(212, 167, 71, .12) 0%, rgba(212, 167, 71, 0) 100%);
  display: flex; align-items: center; gap: 14px;
  position: relative;
}
#shkk-header::after{
  content: "";
  position: absolute; left: 20px; right: 20px; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--shkk-gold), transparent);
  opacity: .4;
}
#shkk-header .shkk-avatar{
  width: 44px; height: 44px;
  border-radius: 14px;
  background: #0a0908;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(212, 167, 71, .35),
    0 4px 14px rgba(0, 0, 0, .5),
    0 0 16px rgba(212, 167, 71, .25);
  flex-shrink: 0;
}
#shkk-header .shkk-avatar img{
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
#shkk-header .shkk-title{ flex: 1; min-width: 0; }
#shkk-header .shkk-title b{
  display: block;
  color: var(--shkk-ink);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 2px;
}
#shkk-header .shkk-title small{
  display: flex; align-items: center; gap: 6px;
  color: var(--shkk-ink-2);
  font-size: 11.5px;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  letter-spacing: .03em;
}
#shkk-header .shkk-status-dot{
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80, 0 0 0 3px rgba(74, 222, 128, .15);
  animation: shkk-status-pulse 2.4s ease-in-out infinite;
}
@keyframes shkk-status-pulse{
  0%, 100%{ box-shadow: 0 0 8px #4ade80, 0 0 0 3px rgba(74, 222, 128, .15); }
  50%{ box-shadow: 0 0 12px #4ade80, 0 0 0 6px rgba(74, 222, 128, .08); }
}
#shkk-header .shkk-close-btn{
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--shkk-rule);
  color: var(--shkk-ink-2);
  width: 32px; height: 32px;
  border-radius: 10px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, color .15s, border-color .15s;
  flex-shrink: 0;
}
#shkk-header .shkk-close-btn:hover{
  background: rgba(212, 167, 71, .1);
  color: var(--shkk-gold);
  border-color: rgba(212, 167, 71, .3);
}
#shkk-header .shkk-close-btn svg{ width: 16px; height: 16px; }

/* ─────────────────── Messages list ─────────────────── */
#shkk-messages{
  flex: 1; overflow-y: auto;
  padding: 20px 18px 12px;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 167, 71, .25) transparent;
}
#shkk-messages::-webkit-scrollbar{ width: 6px; }
#shkk-messages::-webkit-scrollbar-thumb{
  background: rgba(212, 167, 71, .25);
  border-radius: 3px;
}
#shkk-messages::-webkit-scrollbar-thumb:hover{
  background: rgba(212, 167, 71, .45);
}

/* Bulles de message */
.shkk-msg{
  max-width: 86%;
  padding: 12px 16px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.55;
  word-wrap: break-word;
  animation: shkk-msg-in .3s ease-out;
}
@keyframes shkk-msg-in{
  from{ opacity: 0; transform: translateY(8px); }
  to{ opacity: 1; transform: translateY(0); }
}
.shkk-msg.shkk-msg-bot{
  align-self: flex-start;
  background: linear-gradient(135deg, var(--shkk-bg-3) 0%, var(--shkk-bg-2) 100%);
  color: var(--shkk-ink);
  border: 1px solid rgba(255, 255, 255, .04);
  border-top-left-radius: 6px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.shkk-msg.shkk-msg-user{
  align-self: flex-end;
  background: linear-gradient(135deg, var(--shkk-gold-2) 0%, var(--shkk-gold) 100%);
  color: #0a0908;
  border-top-right-radius: 6px;
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(212, 167, 71, .25);
}
.shkk-msg strong{ font-weight: 600; }
.shkk-msg em{ font-style: italic; }
.shkk-msg ul, .shkk-msg ol{ margin: 8px 0; padding-left: 22px; }
.shkk-msg li{ margin: 3px 0; }
.shkk-msg a{
  color: var(--shkk-gold);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  transition: color .15s;
}
.shkk-msg a:hover{ color: var(--shkk-gold-2); }
.shkk-msg-user a{ color: #0a0908; }

/* ─────────────────── Suggestions initiales ─────────────────── */
.shkk-suggestions{
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  margin-top: 4px;
}
.shkk-suggestion{
  background: linear-gradient(135deg, var(--shkk-bg-3) 0%, var(--shkk-bg-2) 100%);
  color: var(--shkk-ink);
  border: 1px solid rgba(255, 255, 255, .05);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 12.5px;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  display: flex; align-items: flex-start; gap: 8px;
  transition: border-color .2s, color .2s, background .2s, transform .15s;
  position: relative;
  overflow: hidden;
}
.shkk-suggestion::before{
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(212, 167, 71, .1) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.shkk-suggestion:hover{
  border-color: rgba(212, 167, 71, .35);
  color: var(--shkk-gold-2);
  transform: translateY(-1px);
}
.shkk-suggestion:hover::before{ opacity: 1; }
.shkk-suggestion .shkk-sug-icon{
  font-size: 16px; line-height: 1;
  flex-shrink: 0;
}

/* ─────────────────── Action cards (tools) ─────────────────── */
.shkk-action{
  align-self: flex-start; max-width: 90%;
  background:
    linear-gradient(135deg, rgba(212, 167, 71, .18) 0%, rgba(212, 167, 71, .04) 100%);
  border: 1px solid rgba(212, 167, 71, .35);
  border-radius: 16px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 4px 20px rgba(212, 167, 71, .12);
  animation: shkk-msg-in .35s ease-out;
}
.shkk-action b{
  color: var(--shkk-gold-2);
  font-size: 13.5px;
  font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  letter-spacing: -.005em;
}
.shkk-action small{
  color: var(--shkk-ink-2);
  font-size: 12.5px;
  line-height: 1.5;
}
.shkk-action button{
  align-self: flex-start;
  background: linear-gradient(135deg, var(--shkk-gold-2) 0%, var(--shkk-gold) 100%);
  color: #0a0908; border: none;
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  display: flex; align-items: center; gap: 6px;
  transition: transform .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(212, 167, 71, .25), inset 0 1px 0 rgba(255, 240, 200, .4);
}
.shkk-action button:hover{
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(212, 167, 71, .4), inset 0 1px 0 rgba(255, 240, 200, .5);
}
.shkk-action button svg{ width: 14px; height: 14px; }

/* ─────────────────── Typing indicator ─────────────────── */
.shkk-typing{
  align-self: flex-start;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--shkk-bg-3) 0%, var(--shkk-bg-2) 100%);
  border: 1px solid rgba(255, 255, 255, .04);
  border-radius: 18px;
  border-top-left-radius: 6px;
  display: flex; gap: 5px;
  animation: shkk-msg-in .25s ease-out;
}
.shkk-typing span{
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--shkk-gold);
  opacity: .4;
  animation: shkk-typing-dot 1.3s ease-in-out infinite;
}
.shkk-typing span:nth-child(2){ animation-delay: .15s; }
.shkk-typing span:nth-child(3){ animation-delay: .3s; }
@keyframes shkk-typing-dot{
  0%, 60%, 100%{ opacity: .3; transform: translateY(0) scale(.85); }
  30%{ opacity: 1; transform: translateY(-4px) scale(1); }
}
@media (prefers-reduced-motion: reduce){
  .shkk-typing span{ animation: none; opacity: .5; }
}

/* ─────────────────── Input zone ─────────────────── */
#shkk-input-wrap{
  border-top: 1px solid rgba(212, 167, 71, .12);
  padding: 14px 16px 16px;
  background: linear-gradient(180deg, transparent 0%, var(--shkk-bg-2) 100%);
  display: flex; gap: 10px; align-items: flex-end;
  position: relative;
}
#shkk-input-wrap::before{
  content: "";
  position: absolute; left: 0; right: 0; top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 167, 71, .25), transparent);
}
#shkk-input{
  flex: 1;
  background: var(--shkk-bg);
  color: var(--shkk-ink);
  border: 1px solid var(--shkk-rule);
  border-radius: 14px;
  padding: 14px 16px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  min-height: 56px; max-height: 140px;
  line-height: 1.5;
  transition: border-color .2s, box-shadow .2s;
}
#shkk-input:focus{
  outline: none;
  border-color: rgba(212, 167, 71, .55);
  box-shadow: 0 0 0 3px rgba(212, 167, 71, .12);
}
#shkk-input::placeholder{ color: var(--shkk-ink-3); }
#shkk-send{
  background: linear-gradient(135deg, var(--shkk-gold-2) 0%, var(--shkk-gold) 100%);
  color: #0a0908;
  border: none;
  width: 56px; height: 56px;
  border-radius: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-family: inherit;
  transition: opacity .15s, transform .15s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(212, 167, 71, .3), inset 0 1px 0 rgba(255, 240, 200, .4);
}
#shkk-send:disabled{
  opacity: .4;
  cursor: not-allowed;
  filter: saturate(.5);
}
#shkk-send:not(:disabled):hover{
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212, 167, 71, .5), inset 0 1px 0 rgba(255, 240, 200, .5);
}
#shkk-send svg{
  width: 18px; height: 18px;
  transform: translateX(-1px);
}

/* ─────────────────── Mobile ─────────────────── */
@media (max-width: 520px){
  #shkk-fab{ bottom: 18px; right: 18px; width: 60px; height: 60px; border-radius: 20px; }
  #shkk-fab svg{ width: 26px; height: 26px; }
  #shkk-modal{
    bottom: 92px; right: 8px; left: 8px;
    width: auto; max-width: none;
    height: calc(100vh - 110px);
    border-radius: 18px;
  }
  #shkk-fab .shkk-fab-label{ display: none; }
  .shkk-suggestions{ grid-template-columns: 1fr; }
}

/* ─────────────────── Focus-visible a11y ─────────────────── */
#shkk-fab:focus-visible{
  outline: 3px solid var(--shkk-gold);
  outline-offset: 4px;
}
#shkk-send:focus-visible,
.shkk-suggestion:focus-visible,
.shkk-action button:focus-visible,
#shkk-header .shkk-close-btn:focus-visible{
  outline: 2px solid var(--shkk-gold);
  outline-offset: 3px;
}
#shkk-input:focus-visible{
  outline: 2px solid var(--shkk-gold);
  outline-offset: 1px;
}
