/* ═══════════════════════════════════════════════════════
   Qira Chat Widget — all selectors scoped under .qira-*
═══════════════════════════════════════════════════════ */

/* ── Outer container (vertically centred, right edge) ── */
.qira-wrap {
  position: fixed;
  top: 50%;
  right: 20px;
  transform: translateY(-50%);
  z-index: 9999;
  pointer-events: none;
  overflow: visible;
}

/* ── Avatar button (no circle — house is the visual) ─── */
.qira-btn {
  width: 64px;
  height: 64px;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: all;
  flex-shrink: 0;
  padding: 0;
  position: relative;
  animation: qira-float 3s ease-in-out infinite;
  filter: drop-shadow(0 5px 12px rgba(9,103,199,0.50)) drop-shadow(0 2px 5px rgba(0,0,0,0.28));
  transition: filter 0.2s ease;
}
.qira-btn:hover {
  filter: drop-shadow(0 7px 18px rgba(9,103,199,0.70)) drop-shadow(0 3px 7px rgba(0,0,0,0.32));
  animation: qira-wiggle 0.4s ease;
}
.qira-btn:active {
  animation: none;
  transform: scale(0.94);
}

/* ── Speech bubble (grows from door/mouth, hides when chat open) */
.qira-btn::after {
  content: 'Hallo!';
  position: absolute;
  right: calc(100% + 6px);
  bottom: 8px;
  background: #ffffff;
  color: #1f3a5f;
  border: 1.5px solid #ccd8e4;
  border-radius: 10px 2px 10px 10px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  pointer-events: none;
  opacity: 0;
  transform: scale(0.3);
  transform-origin: right center;
  animation: qira-speech 7s ease-in-out infinite;
}
.qira-wrap:has(.qira-open) .qira-btn::after {
  animation: none;
  opacity: 0;
}

/* ── Wink eye ────────────────────────────────────────── */
.qira-eye-l {
  transform-box: fill-box;
  transform-origin: center;
  animation: qira-wink 7s ease-in-out infinite;
}

/* ── Chat window (opens left of button, vertically centred) */
.qira-window {
  position: absolute;
  top: 50%;
  right: 76px; /* 64px button + 12px gap */
  width: 340px;
  height: auto;
  max-height: calc(100vh - 80px);
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0,0,0,0.18), 0 2px 10px rgba(0,0,0,0.10);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-50%) translateX(12px) scale(0.97);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.qira-window.qira-open {
  opacity: 1;
  transform: translateY(-50%) translateX(0) scale(1);
  pointer-events: all;
}

/* ── Header ──────────────────────────────────────────── */
.qira-header {
  background: #1f3a5f;
  padding: 12px 14px 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.qira-header-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.qira-header-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.qira-header-name {
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
}
.qira-header-status {
  font-size: 11px;
  color: rgba(255,255,255,0.58);
  line-height: 1.2;
}
.qira-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  padding: 0;
}
.qira-close:hover { color: #ffffff; background: rgba(255,255,255,0.1); }

/* ── Messages area ───────────────────────────────────── */
.qira-msgs {
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}
.qira-msgs::-webkit-scrollbar { width: 4px; }
.qira-msgs::-webkit-scrollbar-thumb { background: #d0dce8; border-radius: 4px; }

.qira-msg {
  display: flex;
  flex-direction: column;
  max-width: 88%;
}
.qira-msg.qira-user { align-self: flex-end; align-items: flex-end; }
.qira-msg.qira-bot  { align-self: flex-start; align-items: flex-start; }

.qira-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 13.5px;
  line-height: 1.58;
  word-break: break-word;
  font-family: 'Noto Sans', 'DM Sans', 'Segoe UI', sans-serif;
}
.qira-user .qira-bubble {
  background: #0967c7;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}
.qira-bot .qira-bubble {
  background: #f0f4f8;
  color: #1A2B45;
  border-bottom-left-radius: 4px;
}
.qira-bubble a {
  pointer-events: auto;
  cursor: pointer;
  text-decoration: underline;
}

/* ── Typing indicator ────────────────────────────────── */
.qira-typing {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 13px 16px;
  background: #f0f4f8;
  border-radius: 14px;
  border-bottom-left-radius: 4px;
  width: fit-content;
}
.qira-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #7a94a8;
  animation: qira-bounce 1.2s ease-in-out infinite;
}
.qira-dot:nth-child(2) { animation-delay: 0.18s; }
.qira-dot:nth-child(3) { animation-delay: 0.36s; }

/* ── CTA booking button ──────────────────────────────── */
.qira-cta-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 9px 18px;
  background: #0967c7;
  color: #ffffff !important;
  text-decoration: none !important;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', 'Segoe UI', sans-serif;
  transition: background 0.15s;
  cursor: pointer;
}
.qira-cta-btn:hover { background: #0759b0; }

/* ── Input row ───────────────────────────────────────── */
.qira-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid #e4ecf2;
  flex-shrink: 0;
}
.qira-input {
  flex: 1;
  border: 1.5px solid #ccd8e4;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 16px; /* ≥16px prevents iOS zoom */
  font-family: 'Noto Sans', 'DM Sans', 'Segoe UI', sans-serif;
  color: #1A2B45;
  outline: none;
  background: #f8fafd;
  transition: border-color 0.18s, background 0.18s;
  min-height: 44px;
}
.qira-input:focus { border-color: #0967c7; background: #ffffff; }
.qira-input:disabled { opacity: 0.6; }

.qira-send {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 10px;
  background: #0967c7;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  flex-shrink: 0;
}
.qira-send:hover    { background: #0759b0; }
.qira-send:disabled { background: #b8c8d8; cursor: default; }

/* ── Mobile — button at bottom-right, window opens upward */
@media (max-width: 480px) {
  .qira-wrap {
    top: auto;
    bottom: 80px;
    right: 16px;
    transform: none;
  }
  .qira-window {
    top: auto;
    bottom: 76px;
    right: 0;
    width: calc(100vw - 32px);
    max-width: none;
    height: auto;
    max-height: calc(100vh - 180px);
    transform: translateY(10px) scale(0.97);
  }
  .qira-window.qira-open {
    transform: translateY(0) scale(1);
  }
  .qira-bubble { font-size: 13px; }
}
@media (max-width: 360px) {
  .qira-wrap   { right: 8px; }
  .qira-window { width: calc(100vw - 16px); }
  .qira-btn::after { font-size: 10.5px; padding: 4px 8px; right: calc(100% + 2px); }
}

/* ── Keyframes ───────────────────────────────────────── */
@keyframes qira-float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-7px); }
}
@keyframes qira-speech {
  0%,   7%  { opacity: 0; transform: scale(0.3); }
  16%, 62%  { opacity: 1; transform: scale(1);   }
  72%, 100% { opacity: 0; transform: scale(0.7); }
}
@keyframes qira-wink {
  0%,  33%, 46%, 100% { transform: scaleY(1); }
  37%, 42%            { transform: scaleY(0.06); }
}
@keyframes qira-wiggle {
  0%   { transform: rotate(0deg); }
  15%  { transform: rotate(-12deg); }
  45%  { transform: rotate(10deg); }
  75%  { transform: rotate(-5deg); }
  100% { transform: rotate(0deg); }
}
@keyframes qira-bounce {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30%            { opacity: 1;   transform: translateY(-4px); }
}
