/* ImperialHost.cc: the chat bubble on the public pages (assets/js/chat.js). Uses the site's own variables (style.css),
   so it follows the light and dark theme. */
.ihc { font-family: var(--font); }
.ihc-bubble {
  position: fixed; z-index: 90; right: 20px; bottom: calc(20px + env(safe-area-inset-bottom));
  width: 56px; height: 56px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--btn-bg); color: var(--btn-fg); box-shadow: var(--shadow), 0 8px 24px -8px rgba(0, 0, 0, .35);
  transition: transform .25s var(--ease);
  animation: ihc-pop .45s var(--ease) backwards; /* backwards: the hover zoom still works after it */
}
.ihc-bubble:hover { transform: scale(1.06); }
.ihc-bubble svg { animation: ihc-pop .3s var(--ease) both; }
@keyframes ihc-pop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.ihc-bubble:focus-visible { outline: 3px solid var(--line-2); outline-offset: 3px; }
.ihc-dot { position: absolute; top: 4px; right: 4px; width: 12px; height: 12px; border-radius: 50%; background: #ff3b30; border: 2px solid var(--bg); }
.ihc-dot[hidden] { display: none; }
.ihc-dot { animation: ihc-pulse 1.8s ease-out infinite; }
@keyframes ihc-pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 48, .55); } 70% { box-shadow: 0 0 0 8px rgba(255, 59, 48, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 48, 0); } }

.ihc-panel {
  position: fixed; z-index: 90; right: 20px; bottom: calc(88px + env(safe-area-inset-bottom));
  width: 360px; height: min(560px, calc(100vh - 120px)); display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow), 0 24px 60px -20px rgba(0, 0, 0, .35);
  animation: ihc-in .25s var(--ease);
}
.ihc-panel[hidden] { display: none; }
@keyframes ihc-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.ihc-panel.is-closing { animation: ihc-out .18s ease-in both; pointer-events: none; }
@keyframes ihc-out { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(8px) scale(.98); } }

.ihc-head { display: flex; align-items: center; gap: 8px; padding: 14px 14px 12px 18px; border-bottom: 1px solid var(--line); }
.ihc-brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
/* the site's mark, inline and in the text colour (assets/js/chat.js LOGO), like the header's */
.ihc-logo { flex: none; width: 13px; height: 22px; color: var(--text); }
.ihc-brand div { display: flex; flex-direction: column; line-height: 1.2; }
.ihc-brand b { font-size: 15px; font-weight: 700; }
.ihc-brand span { font-size: 12px; color: var(--text-2); }
.ihc-x { border: 0; background: transparent; color: var(--text-2); width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; cursor: pointer; }
.ihc-x:hover { background: var(--surface-2); color: var(--text); }

.ihc-body { flex: 1; overflow-y: auto; padding: 16px 18px; margin: 0; overscroll-behavior: contain; }
.ihc-greet { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.ihc-sub { margin: 0 0 10px; font-size: 13px; color: var(--text-2); }
.ihc-faq { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ihc-q {
  width: 100%; text-align: left; font: 500 14px/1.35 var(--font); color: var(--text); cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px;
}
.ihc-q:hover, .ihc-q[aria-expanded="true"] { border-color: var(--line-2); }
.ihc-a { margin: 6px 4px 4px; font-size: 14px; line-height: 1.5; color: var(--text-2); animation: ihc-faq-in .22s var(--ease) both; }
@keyframes ihc-faq-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ihc-a a, .ihc-msg a, .ihc-note a { color: inherit; text-decoration: underline; }

.ihc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 14px 18px; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.ihc-btn {
  border: 0; border-radius: 999px; padding: 10px 16px; font: 600 14px/1 var(--font); cursor: pointer;
  background: var(--btn-bg); color: var(--btn-fg); white-space: nowrap;
}
.ihc-btn[disabled] { opacity: .6; cursor: default; }
.ihc-link { border: 0; background: transparent; color: var(--text-2); font: 500 13px/1 var(--font); cursor: pointer; padding: 8px 6px; text-decoration: underline; }
.ihc-link:hover { color: var(--text); }

.ihc-form { display: flex; flex-direction: column; gap: 10px; }
.ihc-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.ihc-form input, .ihc-form textarea, .ihc-input textarea {
  font: 400 15px/1.4 var(--font); color: var(--text); background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 9px 12px; resize: none; width: 100%; box-sizing: border-box;
}
.ihc-form input:focus, .ihc-form textarea:focus, .ihc-input textarea:focus { outline: none; border-color: var(--line-2); }
.ihc-row { display: flex; justify-content: space-between; align-items: center; }
.ihc-note { margin: 0; font-size: 12px; line-height: 1.45; color: var(--text-2); }
.ihc-err { margin: 0; font-size: 13px; color: #ff3b30; }
.ihc-err[hidden] { display: none; }
.ihc-err--chat { padding: 0 18px 10px; }

.ihc-list { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.ihc-list li { display: flex; gap: 8px; max-width: 100%; }
.ihc-me { justify-content: flex-end; }
.ihc-me .ihc-msg { background: var(--btn-bg); color: var(--btn-fg); border-bottom-right-radius: 6px; }
.ihc-them > div { min-width: 0; max-width: 82%; }
.ihc-them .ihc-msg { background: var(--surface-2); border-bottom-left-radius: 6px; }
.ihc-msg { padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; max-width: 82%; }
.ihc-them .ihc-msg { max-width: 100%; }
.ihc-msg code { font-family: var(--mono); font-size: 13px; }
/* a team message's pictures and GIFs (assets/js/chat.js mediaHtml) */
.ihc-media { display: block; max-width: 100%; height: auto; border-radius: 10px; margin-top: 6px; background: var(--line); }
.ihc-media:first-child { margin-top: 0; }
.ihc-msg--media { padding: 4px; }
/* the end-chat question inside the panel */
.ihc-confirm { padding: 12px 14px 14px 18px; border-top: 1px solid var(--line); }
.ihc-confirm p { margin: 0 0 10px; font-size: 14px; line-height: 1.45; }
.ihc-who { display: block; font-size: 12px; color: var(--text-2); margin: 0 0 3px 2px; }
.ihc-tag { font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 6px; background: var(--line); color: var(--text-2); }
/* a message that arrives while the chat is open slides in (only new ones: assets/js/chat.js state.fresh) */
.ihc-new { animation: ihc-msg-in .28s var(--ease) both; }
.ihc-me.ihc-new { transform-origin: right bottom; }
.ihc-them.ihc-new { transform-origin: left bottom; }
@keyframes ihc-msg-in { from { opacity: 0; transform: translateY(8px) scale(.97); } to { opacity: 1; transform: none; } }
/* "Zavolat operátora" under Aurel's latest answer (assets/js/chat.js offerHtml), in line with his bubble */
.ihc-offer { padding-left: 38px; }
.ihc-human {
  display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); border-radius: 999px; padding: 8px 14px;
  background: var(--surface); color: var(--text); font: 600 13px/1 var(--font); cursor: pointer; transition: background .15s, border-color .15s;
}
.ihc-human:hover { background: var(--surface-2); }
.ihc-human:focus-visible { outline: 3px solid var(--line-2); outline-offset: 2px; }
.ihc-human[disabled] { opacity: .6; cursor: default; }
.ihc-sys { justify-content: center; text-align: center; font-size: 12px; color: var(--text-2); padding: 0 12px; }
.ihc-av { flex: none; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; position: relative; margin-top: 18px; }
.ihc-av img { width: 100%; height: 100%; object-fit: cover; }
.ihc-av--ai { overflow: visible; border: 1px solid var(--line); }
.ihc-av--ai .ihc-logo { width: 10px; height: 17px; }
.ihc-av--ai i { position: absolute; right: -6px; bottom: -4px; font: 700 8px/1 var(--font); font-style: normal; padding: 2px 3px; border-radius: 5px; background: var(--btn-bg); color: var(--btn-fg); }
.ihc-av--txt { font: 600 13px/1 var(--font); color: var(--text-2); }
.ihc-dots { display: flex; gap: 4px; align-items: center; height: 18px; }
/* someone is typing: three dots bouncing in a wave, the row sliding in once (assets/js/chat.js typingHtml) */
.ihc-dots i, .ihc-badge-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: ihc-bounce 1.2s ease-in-out infinite; }
.ihc-dots i:nth-child(2), .ihc-badge-typing i:nth-child(2) { animation-delay: .15s; }
.ihc-dots i:nth-child(3), .ihc-badge-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes ihc-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: .45; } 30% { transform: translateY(-4px); opacity: 1; } }
.ihc-typing-new { animation: ihc-msg-in .28s var(--ease) both; }
/* the same dots in a small badge above the closed bubble */
.ihc-badge-typing {
  position: fixed; z-index: 90; right: 24px; bottom: calc(84px + env(safe-area-inset-bottom)); display: none; gap: 4px; align-items: center;
  padding: 9px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.ihc.is-typing .ihc-badge-typing { display: flex; animation: ihc-pop .3s var(--ease) backwards; }

.ihc-input { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px 12px 14px; border-top: 1px solid var(--line); }
.ihc-input textarea { flex: 1; max-height: 120px; }
.ihc-send { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--btn-bg); color: var(--btn-fg); display: grid; place-items: center; cursor: pointer; }

@media (max-width: 480px) {
  .ihc-panel { right: 0; bottom: 0; left: 0; top: 0; width: auto; height: auto; border-radius: 0; border: 0; padding-bottom: env(safe-area-inset-bottom); }
  .ihc.is-open .ihc-bubble { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ihc-panel, .ihc-panel.is-closing, .ihc-new, .ihc-typing-new, .ihc-a, .ihc-dot, .ihc-bubble, .ihc-bubble svg, .ihc-dots i, .ihc-badge-typing i, .ihc.is-typing .ihc-badge-typing { animation: none; }
  .ihc-bubble { transition: none; }
}
