/* ============================================================
   Shakass Assistant — widget
   Palette dark + accent jaune, cohérente avec l'app-shell.
   ============================================================ */

#shka-root {
	--shka-bg:      #0d0d0f;
	--shka-surface: #16161a;
	--shka-line:    #26262c;
	--shka-text:    #e8e8ea;
	--shka-muted:   #8a8a94;
	--shka-accent:  #f5c518;

	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Bouton flottant ---------- */
#shka-toggle {
	width: 56px; height: 56px;
	border: none; border-radius: 50%;
	background: var(--shka-accent);
	color: #0d0d0f;
	cursor: pointer;
	display: grid; place-items: center;
	box-shadow: 0 8px 28px rgba(0,0,0,.45);
	transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s;
}
#shka-toggle:hover { transform: scale(1.08); box-shadow: 0 10px 34px rgba(245,197,24,.35); }
#shka-root.is-open #shka-toggle { transform: scale(.85); opacity: 0; pointer-events: none; }

/* ---------- Panneau ---------- */
#shka-panel {
	position: absolute;
	right: 0; bottom: 0;
	width: 380px;
	height: 560px;
	max-height: calc(100vh - 48px);
	background: var(--shka-bg);
	border: 1px solid var(--shka-line);
	border-radius: 16px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 24px 60px rgba(0,0,0,.6);
	animation: shkaIn .32s cubic-bezier(.16,1,.3,1);
}
@keyframes shkaIn {
	from { opacity: 0; transform: translateY(16px) scale(.97); }
	to   { opacity: 1; transform: none; }
}

/* ---------- Header ---------- */
#shka-header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 14px 16px;
	border-bottom: 1px solid var(--shka-line);
	background: var(--shka-surface);
}
.shka-title {
	display: flex; align-items: center; gap: 8px;
	color: var(--shka-text);
	font-size: 14px; font-weight: 600;
	letter-spacing: .04em; text-transform: uppercase;
}
.shka-dot {
	width: 7px; height: 7px; border-radius: 50%;
	background: #3ddc84;
	box-shadow: 0 0 0 0 rgba(61,220,132,.6);
	animation: shkaPulse 2.4s infinite;
}
@keyframes shkaPulse {
	70%  { box-shadow: 0 0 0 7px rgba(61,220,132,0); }
	100% { box-shadow: 0 0 0 0 rgba(61,220,132,0); }
}
#shka-close {
	background: none; border: none;
	color: var(--shka-muted);
	font-size: 26px; line-height: 1;
	cursor: pointer; padding: 0 4px;
	transition: color .2s;
}
#shka-close:hover { color: var(--shka-text); }

/* ---------- Messages ---------- */
#shka-messages {
	flex: 1;
	overflow-y: auto;
	padding: 18px 16px;
	display: flex; flex-direction: column; gap: 12px;
	scrollbar-width: thin;
	scrollbar-color: var(--shka-line) transparent;
}
#shka-messages::-webkit-scrollbar { width: 6px; }
#shka-messages::-webkit-scrollbar-thumb { background: var(--shka-line); border-radius: 3px; }

.shka-msg {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 14px;
	font-size: 14px; line-height: 1.5;
	white-space: pre-wrap;
	word-wrap: break-word;
	animation: shkaMsgIn .28s ease both;
}
@keyframes shkaMsgIn { from { opacity: 0; transform: translateY(6px); } }

.shka-msg.bot {
	align-self: flex-start;
	background: var(--shka-surface);
	color: var(--shka-text);
	border: 1px solid var(--shka-line);
	border-bottom-left-radius: 4px;
}
.shka-msg.user {
	align-self: flex-end;
	background: var(--shka-accent);
	color: #0d0d0f;
	font-weight: 500;
	border-bottom-right-radius: 4px;
}

/* ---------- Indicateur de frappe ---------- */
.shka-typing { display: flex; gap: 4px; align-items: center; padding: 14px; }
.shka-typing span {
	width: 6px; height: 6px; border-radius: 50%;
	background: var(--shka-muted);
	animation: shkaBounce 1.3s infinite;
}
.shka-typing span:nth-child(2) { animation-delay: .18s; }
.shka-typing span:nth-child(3) { animation-delay: .36s; }
@keyframes shkaBounce {
	0%,60%,100% { transform: translateY(0); opacity: .4; }
	30%         { transform: translateY(-5px); opacity: 1; }
}

/* ---------- Cartes produit ---------- */
.shka-products {
	display: flex; flex-direction: column; gap: 8px;
	align-self: flex-start; width: 85%;
}
.shka-product {
	display: flex; gap: 10px; align-items: center;
	padding: 8px;
	background: var(--shka-surface);
	border: 1px solid var(--shka-line);
	border-radius: 10px;
	text-decoration: none;
	transition: border-color .2s, transform .2s;
}
.shka-product:hover { border-color: var(--shka-accent); transform: translateX(3px); }
.shka-product img {
	width: 46px; height: 46px;
	object-fit: cover; border-radius: 6px;
	flex-shrink: 0; background: #222;
}
.shka-product-info { min-width: 0; }
.shka-product-name {
	color: var(--shka-text); font-size: 13px; font-weight: 500;
	display: block; overflow: hidden;
	text-overflow: ellipsis; white-space: nowrap;
}
.shka-product-price { color: var(--shka-accent); font-size: 13px; font-weight: 600; }

/* ---------- Suggestions ---------- */
#shka-suggestions {
	display: flex; flex-wrap: wrap; gap: 6px;
	padding: 0 16px 10px;
}
.shka-chip {
	background: transparent;
	border: 1px solid var(--shka-line);
	color: var(--shka-muted);
	font-size: 12px;
	padding: 6px 12px;
	border-radius: 999px;
	cursor: pointer;
	transition: all .2s;
}
.shka-chip:hover { border-color: var(--shka-accent); color: var(--shka-accent); }

/* ---------- Formulaire ---------- */
#shka-form {
	display: flex; gap: 8px;
	padding: 12px 14px;
	border-top: 1px solid var(--shka-line);
	background: var(--shka-surface);
}
#shka-input {
	flex: 1;
	background: var(--shka-bg);
	border: 1px solid var(--shka-line);
	border-radius: 10px;
	padding: 11px 14px;
	color: var(--shka-text);
	font-size: 14px;
	outline: none;
	transition: border-color .2s;
}
#shka-input::placeholder { color: var(--shka-muted); }
#shka-input:focus { border-color: var(--shka-accent); }
#shka-send {
	width: 42px;
	background: var(--shka-accent);
	border: none; border-radius: 10px;
	color: #0d0d0f;
	cursor: pointer;
	display: grid; place-items: center;
	transition: opacity .2s, transform .2s;
}
#shka-send:hover  { transform: scale(1.05); }
#shka-send:disabled { opacity: .4; cursor: not-allowed; transform: none; }

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
	#shka-root { right: 16px; bottom: 16px; }
	#shka-panel {
		position: fixed;
		inset: 0;
		width: 100%; height: 100%;
		max-height: none;
		border-radius: 0;
		border: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	#shka-root *, #shka-panel { animation: none !important; transition: none !important; }
}
