/* ADM Event – AI poradce: chat widget (v3 – ladí s barvami webu) */
#admevent-ai-root {
	--adm-accent: #f5b14c;                                   /* hlavní barva (přepisuje admin) */
	--adm-accent-2: var(--adm-accent);                       /* fallback, pokud color-mix není */
	--adm-accent-2: color-mix(in srgb, var(--adm-accent) 74%, #000);  /* tmavší odstín téže barvy */
	--adm-grad: linear-gradient(135deg, var(--adm-accent) 0%, var(--adm-accent-2) 100%);
	--adm-on-accent: #241a07;                                /* tmavý text na světlém akcentu */
	--adm-bg: #14121b;
	--adm-bg-2: #1d1a27;
	--adm-line: rgba(255,255,255,.10);
	--adm-text: #f3f1ec;
	--adm-muted: #a7a299;
	--adm-bot: #26222f;
	--adm-tint: rgba(255,255,255,.05);
	--adm-safe: env(safe-area-inset-bottom, 0px);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
#admevent-ai-root *, #admevent-ai-root *::before, #admevent-ai-root *::after { box-sizing: border-box; }

/* ---------- Launcher (vpravo dole) ---------- */
.adm-launcher {
	position: fixed; right: 22px; bottom: calc(22px + var(--adm-safe)); z-index: 999999;
	display: flex; flex-direction: row-reverse; align-items: center; gap: 12px;
	cursor: pointer; border: 0; padding: 0; background: none; -webkit-tap-highlight-color: transparent;
}
.adm-bubble {
	position: relative; width: 66px; height: 66px; border-radius: 50%; flex: 0 0 auto;
	display: grid; place-items: center; color: var(--adm-on-accent); background: var(--adm-grad);
	box-shadow: 0 12px 32px rgba(0,0,0,.5), 0 2px 8px rgba(0,0,0,.35);
	transition: transform .25s cubic-bezier(.34,1.56,.64,1), box-shadow .25s ease;
}
.adm-launcher:hover .adm-bubble { transform: translateY(-3px) scale(1.05); }
.adm-launcher:active .adm-bubble { transform: scale(.96); }
.adm-bubble svg { width: 30px; height: 30px; }
.adm-bubble::after { content: ""; position: absolute; inset: -7px; border-radius: 50%; background: var(--adm-accent); opacity: .3; z-index: -1; animation: admPulse 2.6s ease-out infinite; }
.adm-bubble .adm-dot { position: absolute; top: 3px; right: 3px; width: 15px; height: 15px; border-radius: 50%; background: #34d27b; border: 2.5px solid var(--adm-bg); }
@keyframes admPulse { 0% { transform: scale(.9); opacity: .45; } 70% { transform: scale(1.45); opacity: 0; } 100% { transform: scale(1.45); opacity: 0; } }

/* Hláška */
.adm-tip {
	position: relative; background: var(--adm-bg); color: var(--adm-text); border: 1px solid var(--adm-line);
	padding: 11px 15px; border-radius: 16px 16px 4px 16px; font-size: 14px; font-weight: 600; line-height: 1.35;
	max-width: 230px; box-shadow: 0 10px 30px rgba(0,0,0,.4);
	opacity: 0; transform: translateX(10px) scale(.96); pointer-events: none;
	transition: opacity .35s ease, transform .35s cubic-bezier(.34,1.56,.64,1);
}
.adm-launcher.adm-tip-show .adm-tip { opacity: 1; transform: translateX(0) scale(1); pointer-events: auto; }
.adm-tip-close { position: absolute; top: -8px; left: -8px; width: 20px; height: 20px; border-radius: 50%; background: var(--adm-bot); color: var(--adm-muted); border: 1px solid var(--adm-line); font-size: 13px; line-height: 18px; text-align: center; cursor: pointer; }
.adm-tip-close:hover { color: #fff; }

/* ---------- Panel ---------- */
.adm-panel {
	position: fixed; right: 22px; bottom: calc(22px + var(--adm-safe)); z-index: 1000000;
	width: 392px; max-width: calc(100vw - 32px); height: 620px; max-height: calc(100vh - 40px);
	background: var(--adm-bg); border: 1px solid var(--adm-line); border-radius: 22px;
	box-shadow: 0 28px 80px rgba(0,0,0,.55); display: none; flex-direction: column; overflow: hidden;
	transform: translateY(18px) scale(.97); opacity: 0;
	transition: opacity .24s ease, transform .24s cubic-bezier(.34,1.4,.64,1);
}
#admevent-ai-root[data-state="open"] .adm-panel { display: flex; opacity: 1; transform: translateY(0) scale(1); }
#admevent-ai-root[data-state="open"] .adm-launcher { display: none; }

/* Header */
.adm-head { position: relative; padding: 17px 18px; background: var(--adm-bg-2); border-bottom: 1px solid var(--adm-line); display: flex; align-items: center; gap: 12px; }
.adm-head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--adm-grad); }
.adm-head .adm-ava { width: 42px; height: 42px; border-radius: 13px; flex: 0 0 auto; display: grid; place-items: center; color: var(--adm-on-accent); background: var(--adm-grad); }
.adm-head .adm-ava svg { width: 23px; height: 23px; }
.adm-head h3 { margin: 0; font-size: 15px; color: var(--adm-text); font-weight: 700; letter-spacing: -.01em; }
.adm-head p { margin: 2px 0 0; font-size: 12px; color: var(--adm-muted); display: flex; align-items: center; gap: 6px; }
.adm-head p::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #34d27b; }
.adm-head .adm-close { margin-left: auto; background: none; border: 0; cursor: pointer; color: var(--adm-muted); font-size: 24px; line-height: 1; padding: 4px 8px; border-radius: 9px; }
.adm-head .adm-close:hover { color: var(--adm-text); background: rgba(255,255,255,.06); }

/* Zprávy */
.adm-msgs {
	flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 18px;
	display: flex; flex-direction: column; gap: 12px;
	background: radial-gradient(700px 280px at 100% 0%, var(--adm-tint), transparent 60%), var(--adm-bg);
}
.adm-msg { max-width: 86%; padding: 11px 14px; font-size: 14px; line-height: 1.5; border-radius: 16px; animation: admIn .25s ease; }
@keyframes admIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.adm-msg.bot { align-self: flex-start; background: var(--adm-bot); color: var(--adm-text); border-bottom-left-radius: 5px; }
.adm-msg.me  { align-self: flex-end; color: var(--adm-on-accent); border-bottom-right-radius: 5px; background: var(--adm-grad); font-weight: 600; }
.adm-msg a { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.adm-msg.bot a { color: var(--adm-accent); }
.adm-msg.me a { color: var(--adm-on-accent); }
.adm-msg p { margin: 0 0 8px; } .adm-msg p:last-child { margin: 0; }
.adm-msg ul { margin: 6px 0; padding-left: 18px; } .adm-msg li { margin: 4px 0; }
.adm-msg strong { font-weight: 700; }

.adm-typing { align-self: flex-start; display: flex; gap: 5px; padding: 14px 16px; background: var(--adm-bot); border-radius: 16px; border-bottom-left-radius: 5px; }
.adm-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--adm-muted); animation: admBlink 1.2s infinite both; }
.adm-typing span:nth-child(2) { animation-delay: .2s; }
.adm-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes admBlink { 0%,80%,100% { opacity:.3 } 40% { opacity:1 } }

/* Rychlé volby */
.adm-quick { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 12px; }
.adm-quick button { background: var(--adm-tint); color: var(--adm-text); border: 1px solid var(--adm-line); border-radius: 999px; padding: 8px 14px; font-size: 13px; cursor: pointer; transition: .15s; -webkit-tap-highlight-color: transparent; }
.adm-quick button:hover { border-color: var(--adm-accent); transform: translateY(-1px); }

/* Vstup */
.adm-input { display: flex; gap: 8px; padding: 12px; padding-bottom: calc(12px + var(--adm-safe)); border-top: 1px solid var(--adm-line); background: var(--adm-bg-2); }
.adm-input textarea { flex: 1; resize: none; max-height: 120px; background: var(--adm-bg); color: var(--adm-text); border: 1px solid var(--adm-line); border-radius: 13px; padding: 12px 14px; font-size: 15px; font-family: inherit; line-height: 1.4; }
.adm-input textarea:focus { outline: none; border-color: var(--adm-accent); }
.adm-input textarea::placeholder { color: var(--adm-muted); }
.adm-send { flex: 0 0 auto; width: 46px; border: 0; border-radius: 13px; cursor: pointer; color: var(--adm-on-accent); display: grid; place-items: center; background: var(--adm-grad); transition: transform .15s; -webkit-tap-highlight-color: transparent; }
.adm-send:hover { transform: scale(1.06); }
.adm-send:disabled { opacity: .5; cursor: default; transform: none; }
.adm-send svg { width: 20px; height: 20px; }

.adm-foot { text-align: center; font-size: 11px; color: var(--adm-muted); padding: 0 12px 10px; padding-bottom: calc(10px + var(--adm-safe)); background: var(--adm-bg-2); }

/* ---------- Mobil / iPhone ---------- */
@media (max-width: 560px) {
	.adm-panel { right: 0; left: 0; bottom: 0; top: 0; width: 100%; height: 100vh; height: 100dvh; max-width: 100%; max-height: 100dvh; border-radius: 0; border: 0; }
	.adm-launcher { right: 16px; bottom: calc(16px + var(--adm-safe)); }
	.adm-input textarea { font-size: 16px; }
	.adm-tip { max-width: 200px; font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
	.adm-bubble::after { animation: none; }
	.adm-panel, .adm-msg, .adm-tip, .adm-bubble { transition: none; animation: none; }
}

/* ---------- Ochrana proti přebití barvami webu (vysoká priorita) ---------- */
#admevent-ai-root .adm-msg.bot,
#admevent-ai-root .adm-tip,
#admevent-ai-root .adm-head h3,
#admevent-ai-root .adm-quick button,
#admevent-ai-root .adm-input textarea { color: var(--adm-text) !important; }
#admevent-ai-root .adm-input textarea { background: var(--adm-bg) !important; }
#admevent-ai-root .adm-msg.me,
#admevent-ai-root .adm-send,
#admevent-ai-root .adm-bubble,
#admevent-ai-root .adm-head .adm-ava { color: var(--adm-on-accent) !important; }
#admevent-ai-root .adm-msg.bot a { color: var(--adm-accent) !important; }
#admevent-ai-root .adm-head p,
#admevent-ai-root .adm-foot,
#admevent-ai-root .adm-input textarea::placeholder { color: var(--adm-muted) !important; }
#admevent-ai-root .adm-msg.bot strong { color: #fff !important; }
