/* AI asistent: svítící koule vpravo dole a tmavé skleněné okno chatu. */
.ai {
  --ai-cyan: #3fd0ff;
  --ai-blue: #0b72d9;
  --ai-violet: #7c5cff;
  --ai-glass: rgba(7, 20, 42, 0.86);
  --ai-line: rgba(140, 200, 255, 0.18);
  --ai-text: #e8f2ff;
  --ai-dim: #9fb4d0;
  --ai-ease: cubic-bezier(0.23, 1, 0.32, 1);
  position: fixed;
  z-index: 60;
  right: max(20px, env(safe-area-inset-right, 0px));
  bottom: max(20px, env(safe-area-inset-bottom, 0px));
  font-family: 'Nunito Sans', system-ui, sans-serif;
}
/* v otevřené rezervaci asistent nepřekáží */
body:has(#bookingApp:not([hidden])) .ai { display: none; }

/* ---------- tlačítko ---------- */
.ai-launch { position: relative; display: block; width: 62px; height: 62px; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; }
.ai-orb { position: absolute; inset: 0; border-radius: 50%; padding: 3px; background: conic-gradient(from var(--ai-turn, 0deg), var(--ai-cyan), var(--ai-blue), var(--ai-violet), var(--ai-cyan)); box-shadow: 0 10px 30px -8px rgba(11, 114, 217, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06); animation: ai-turn 6s linear infinite; }
.ai-orb::after { content: ''; position: absolute; inset: -6px; border-radius: 50%; background: radial-gradient(closest-side, rgba(63, 208, 255, 0.35), transparent); z-index: -1; animation: ai-breathe 3.2s ease-in-out infinite; }
.ai-core { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(120% 120% at 30% 20%, #16365f 0%, #071a33 60%, #040e1e 100%); }
.ai-core svg { width: 26px; height: 26px; fill: #fff; filter: drop-shadow(0 0 6px rgba(63, 208, 255, 0.9)); }
.ai-core .ai-spark-sm { fill: var(--ai-cyan); }
@property --ai-turn { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes ai-turn { to { --ai-turn: 360deg; } }
@keyframes ai-breathe { 0%, 100% { opacity: 0.5; transform: scale(0.96); } 50% { opacity: 1; transform: scale(1.06); } }
.ai-launch:focus-visible { outline: 3px solid var(--ai-cyan); outline-offset: 4px; }
@media (hover: hover) and (pointer: fine) {
  .ai-launch .ai-orb { transition: transform 200ms var(--ai-ease); }
  .ai-launch:hover .ai-orb { transform: scale(1.06); }
}
.ai-launch:active .ai-orb { transform: scale(0.95); }

/* popisek se ukáže jednou za návštěvu, jinak jen při najetí */
.ai-tip { position: absolute; right: 74px; top: 50%; translate: 0 -50%; white-space: nowrap; padding: 9px 14px; border-radius: 99px; font-size: 14px; font-weight: 800; color: var(--ai-text); background: var(--ai-glass); box-shadow: inset 0 0 0 1px var(--ai-line), 0 10px 24px -10px rgba(0, 0, 0, 0.5); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); opacity: 0; transform: translateX(6px); pointer-events: none; transition: opacity 220ms var(--ai-ease), transform 220ms var(--ai-ease); }
.ai.hint .ai-tip { opacity: 1; transform: none; }
@media (hover: hover) and (pointer: fine) { .ai-launch:hover .ai-tip { opacity: 1; transform: none; } }
.ai.open .ai-tip { opacity: 0; }

/* ---------- okno ---------- */
.ai-panel { position: absolute; right: 0; bottom: 78px; width: min(390px, calc(100vw - 32px)); height: min(580px, calc(100dvh - 120px)); display: flex; flex-direction: column; border-radius: 22px; color: var(--ai-text); background: var(--ai-glass); backdrop-filter: blur(18px) saturate(1.3); -webkit-backdrop-filter: blur(18px) saturate(1.3); box-shadow: 0 30px 70px -20px rgba(2, 10, 24, 0.7); transform-origin: bottom right; animation: ai-in 240ms var(--ai-ease); overflow: hidden; }
.ai-panel[hidden] { display: none; }
/* barevný okraj */
.ai-panel::before { content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 1px; background: linear-gradient(140deg, rgba(63, 208, 255, 0.7), rgba(124, 92, 255, 0.35) 40%, rgba(140, 200, 255, 0.1) 70%, rgba(63, 208, 255, 0.45)); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none; }
/* jemná mřížka v pozadí */
.ai-panel::after { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(80% 50% at 100% 0%, rgba(11, 114, 217, 0.35), transparent 70%), radial-gradient(60% 40% at 0% 100%, rgba(124, 92, 255, 0.22), transparent 70%), repeating-linear-gradient(0deg, rgba(140, 200, 255, 0.04) 0 1px, transparent 1px 28px), repeating-linear-gradient(90deg, rgba(140, 200, 255, 0.04) 0 1px, transparent 1px 28px); }
@keyframes ai-in { from { opacity: 0; transform: translateY(8px) scale(0.96); } }

.ai-head { display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 18px; border-bottom: 1px solid var(--ai-line); }
.ai-orb-sm { position: relative; inset: auto; display: block; flex: none; width: 38px; height: 38px; padding: 2px; }
.ai-orb-sm .ai-core svg { width: 17px; height: 17px; }
.ai-head div { flex: 1; display: grid; line-height: 1.25; }
.ai-head b { font-size: 16px; font-weight: 900; letter-spacing: -0.01em; color: #fff; }
.ai-head div span { font-size: 12.5px; color: var(--ai-dim); font-weight: 600; }
.ai-head div span::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: #4be38a; box-shadow: 0 0 8px #4be38a; vertical-align: 1px; }
.ai-x { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.06); color: var(--ai-dim); cursor: pointer; }
.ai-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
@media (hover: hover) and (pointer: fine) { .ai-x:hover { color: #fff; background: rgba(255, 255, 255, 0.12); } }

.ai-log { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px; display: flex; flex-direction: column; gap: 10px; scrollbar-width: thin; scrollbar-color: rgba(140, 200, 255, 0.25) transparent; }
.ai-msg { max-width: 88%; font-size: 15px; line-height: 1.5; animation: ai-msg 260ms var(--ai-ease); }
@keyframes ai-msg { from { opacity: 0; transform: translateY(4px); } }
.ai-msg p { margin: 0; }
.ai-msg p + p, .ai-msg p + ul, .ai-msg ul + p { margin-top: 6px; }
.ai-msg ul { margin: 4px 0 0; padding-left: 18px; }
.ai-msg li { margin: 2px 0; }
.ai-msg b { color: #fff; }
.ai-msg a { color: var(--ai-cyan); font-weight: 700; }
.ai-assistant { align-self: flex-start; padding: 11px 14px; border-radius: 4px 16px 16px 16px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--ai-line); }
.ai-user { align-self: flex-end; padding: 10px 14px; border-radius: 16px 4px 16px 16px; color: #fff; background: linear-gradient(135deg, var(--ai-blue), #2a59d6 60%, #5b4fe0); box-shadow: 0 8px 20px -10px rgba(11, 114, 217, 0.9); }

.ai-suggest { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.ai-suggest button, .ai-actions button, .ai-actions a { border: 0; border-radius: 99px; padding: 8px 12px; font: 700 13.5px 'Nunito Sans', system-ui, sans-serif; color: var(--ai-text); background: rgba(63, 208, 255, 0.08); box-shadow: inset 0 0 0 1px rgba(63, 208, 255, 0.35); cursor: pointer; text-decoration: none; transition: background-color 150ms ease; }
@media (hover: hover) and (pointer: fine) { .ai-suggest button:hover, .ai-actions button:hover, .ai-actions a:hover { background: rgba(63, 208, 255, 0.18); } }
.ai-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ai-actions button { color: #04101f; background: linear-gradient(90deg, var(--ai-cyan), #7fb8ff); box-shadow: none; }

.ai-typing { display: inline-flex; gap: 5px; padding: 4px 2px; }
.ai-typing i { width: 7px; height: 7px; border-radius: 50%; background: linear-gradient(135deg, var(--ai-cyan), var(--ai-violet)); animation: ai-dot 1.1s ease-in-out infinite; }
.ai-typing i:nth-child(2) { animation-delay: 0.15s; }
.ai-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ai-dot { 0%, 100% { opacity: 0.35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }

.ai-form { display: flex; align-items: flex-end; gap: 8px; margin: 0 12px; padding: 6px 6px 6px 14px; border-radius: 16px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--ai-line); transition: box-shadow 150ms ease; }
.ai-form:focus-within { box-shadow: inset 0 0 0 1px rgba(63, 208, 255, 0.7), 0 0 0 4px rgba(63, 208, 255, 0.12); }
.ai-form textarea { flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: none; color: #fff; font: 500 16px/1.4 'Nunito Sans', system-ui, sans-serif; padding: 8px 0; height: 38px; max-height: 120px; overflow: hidden; scrollbar-width: none; }
.ai-form textarea::-webkit-scrollbar { display: none; }
.ai-form textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-form textarea::placeholder { color: var(--ai-dim); }
.ai-send { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 12px; cursor: pointer; background: linear-gradient(135deg, var(--ai-cyan), var(--ai-blue) 55%, var(--ai-violet)); box-shadow: 0 6px 16px -6px rgba(63, 208, 255, 0.8); }
.ai-send svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ai-send:active { transform: scale(0.95); }
.ai-note { margin: 8px 16px 12px; font-size: 11.5px; color: var(--ai-dim); text-align: center; }
.ai-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* telefon: okno přes celou obrazovku */
@media (max-width: 560px) {
  .ai { right: 14px; bottom: max(14px, env(safe-area-inset-bottom, 0px)); }
  .ai-launch { width: 56px; height: 56px; }
  .ai.open .ai-launch { display: none; }
  .ai-panel { position: fixed; inset: 0; width: auto; height: 100dvh; border-radius: 0; transform-origin: bottom center; background: #06142a; }
  body:has(.ai.open) { overflow: hidden; }
  .ai-panel::before { display: none; }
  .ai-head { padding-top: max(16px, env(safe-area-inset-top, 0px)); }
  .ai-note { margin-bottom: max(12px, env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) {
  .ai-orb, .ai-orb::after, .ai-typing i { animation: none; }
  .ai-panel, .ai-msg { animation: ai-fade 160ms ease; }
  @keyframes ai-fade { from { opacity: 0; } }
}

/* na webu kempu zelený nádech (lodě zůstávají modré) */
.ai-kemp { --ai-cyan: #6ee7a0; --ai-blue: #0a9809; --ai-violet: #1aa37a; --ai-glass: rgba(6, 30, 16, 0.88); --ai-line: rgba(140, 230, 170, 0.2); --ai-text: #eafff0; --ai-dim: #a6cdb2; }
/* nad spodní lištou na mobilu, schovaný u rezervace pobytu se spodním souhrnem */
@media (max-width: 760px) { body:has(.tabbar) .ai { bottom: calc(84px + env(safe-area-inset-bottom)); } body:has(.st-mbar) .ai { display: none; } }
