/* ==========================================================================
   روزنة — animated guide (chat widget)
   ========================================================================== */

/* ---------- Launcher ---------- */
.rz-ai-launch {
  position: fixed; z-index: 95; right: 22px; bottom: 22px;
  width: 66px; height: 66px; padding: 0; border-radius: 50%; cursor: pointer;
  background: radial-gradient(circle at 50% 35%, #7d8d52, #46542a);
  border: 2px solid rgba(227, 210, 160, .75);
  box-shadow: 0 18px 40px -14px rgba(0, 0, 0, .6);
  overflow: visible; transition: transform .3s cubic-bezier(.2, .7, .2, 1);
}
.rz-ai-launch:hover { transform: translateY(-3px) scale(1.04); }
.rz-ai-launch__logo { position: absolute; left: 50%; top: 50%; width: 44px; height: auto; transform: translate(-50%, -50%); }
.rz-ai-launch::after {
  content: ""; position: absolute; inset: -7px; border-radius: 50%;
  border: 1.5px solid rgba(227, 210, 160, .55); animation: rzPulse 2.6s ease-out infinite; pointer-events: none;
}
@keyframes rzPulse { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.25); opacity: 0; } }
.rz-ai-launch__dot { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: #3fbf6a; border: 2px solid #f4efe4; }
.rz-ai-tip {
  position: absolute; right: calc(100% + 14px); top: 50%; transform: translateY(-50%) translateX(8px);
  white-space: nowrap; padding: 10px 16px; border-radius: 14px 14px 4px 14px;
  background: #f4efe4; color: #1a1e16; font: 500 .92rem/1.4 "IBM Plex Sans Arabic", sans-serif;
  box-shadow: 0 14px 30px -12px rgba(0, 0, 0, .45); opacity: 0; pointer-events: none;
  transition: opacity .4s, transform .4s;
}
.rz-ai-tip.is-on { opacity: 1; transform: translateY(-50%); }
.rz-ai-open .rz-ai-launch { transform: scale(0); pointer-events: none; }

/* ---------- Panel ---------- */
.rz-ai {
  position: fixed; z-index: 96; right: 22px; bottom: 22px;
  width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100vh - 44px));
  display: flex; flex-direction: column; overflow: hidden;
  background: #11160f; color: #f4efe4; border-radius: 26px;
  border: 1px solid rgba(227, 210, 160, .22);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8);
  font-family: "IBM Plex Sans Arabic", system-ui, sans-serif; direction: rtl;
  transform-origin: bottom right; transform: translateY(16px) scale(.96); opacity: 0; visibility: hidden;
  transition: transform .45s cubic-bezier(.2, .7, .2, 1), opacity .35s, visibility .45s;
}
.rz-ai-open .rz-ai { transform: none; opacity: 1; visibility: visible; }

.rz-ai__top {
  flex: none; position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 16px 14px 60px;
  background: radial-gradient(120% 140% at 90% 0%, #6f7e47, #2d3720 70%);
  border-bottom: 1px solid rgba(227, 210, 160, .18);
}
.rz-ai__badge { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(13, 17, 12, .35); border: 1px solid rgba(227, 210, 160, .45); }
.rz-ai__badge img { width: 34px; height: auto; }
.rz-ai__title { line-height: 1.35; }
.rz-ai__title strong { display: block; font-family: "Amiri", serif; font-size: 1.4rem; font-weight: 700; color: #fff; }
.rz-ai__status { display: flex; align-items: center; gap: 7px; font-size: .78rem; color: rgba(244, 239, 228, .8); }
.rz-ai__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #3fbf6a; }
.rz-ai__close {
  position: absolute; top: 50%; left: 14px; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%; border: 0; cursor: pointer;
  background: rgba(13, 17, 12, .35); color: #fff; display: grid; place-items: center; transition: background-color .2s;
}
.rz-ai__close:hover { background: rgba(13, 17, 12, .6); }
.rz-ai__close svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }

.rz-ai__log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 12px; scroll-behavior: smooth; }
.rz-ai__msg { max-width: 88%; padding: 12px 15px; border-radius: 18px; font-size: .95rem; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; }
.rz-ai__msg--bot { align-self: flex-start; background: #1d251a; border: 1px solid rgba(227, 210, 160, .14); border-top-right-radius: 6px; font-family: "Amiri", serif; font-size: 1.12rem; line-height: 1.9; }
.rz-ai__msg--me { align-self: flex-end; background: #c6a964; color: #11160f; border-top-left-radius: 6px; font-weight: 500; }
.rz-ai__typing { display: inline-flex; gap: 5px; padding: 6px 2px; }
.rz-ai__typing i { width: 7px; height: 7px; border-radius: 50%; background: #e3d2a0; animation: rzDots 1.1s infinite ease-in-out; }
.rz-ai__typing i:nth-child(2) { animation-delay: .15s; }
.rz-ai__typing i:nth-child(3) { animation-delay: .3s; }
@keyframes rzDots { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-4px); } }

.rz-ai__chips { display: flex; gap: 8px; padding: 4px 16px 10px; overflow-x: auto; scrollbar-width: none; flex: none; }
.rz-ai__chips::-webkit-scrollbar { display: none; }
.rz-ai__chip {
  flex: none; padding: 8px 14px; border-radius: 999px; cursor: pointer; font: inherit; font-size: .85rem;
  background: transparent; color: #e3d2a0; border: 1px solid rgba(227, 210, 160, .35); transition: background-color .2s, color .2s;
}
.rz-ai__chip:hover { background: #c6a964; color: #11160f; }

.rz-ai__form { flex: none; display: flex; align-items: flex-end; gap: 8px; margin: 0 12px 6px; padding: 6px 6px 6px 6px; border-radius: 18px; background: #1d251a; border: 1px solid rgba(227, 210, 160, .2); }
.rz-ai__form:focus-within { border-color: rgba(227, 210, 160, .55); }
.rz-ai__input { flex: 1; resize: none; max-height: 110px; padding: 9px 10px; border: 0; background: transparent; color: #f4efe4; font: inherit; font-size: .95rem; line-height: 1.6; outline: none; }
.rz-ai__input::placeholder { color: rgba(244, 239, 228, .45); }
.rz-ai__send { flex: none; width: 42px; height: 42px; border-radius: 14px; border: 0; cursor: pointer; display: grid; place-items: center; background: #c6a964; color: #11160f; transition: opacity .2s, transform .2s; }
.rz-ai__send:disabled { opacity: .4; cursor: default; }
.rz-ai__send svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform: scaleX(-1); }
.rz-ai__note { flex: none; margin: 0; padding: 2px 16px 12px; text-align: center; font-size: .7rem; color: rgba(244, 239, 228, .42); }

/* keep the hero "discover" cue clear of the launcher */
@media (max-width: 1380px) { .hero__bar .wrap { padding-inline-start: 78px; } }

@media (max-width: 560px) {
  .rz-ai-launch { right: 16px; bottom: 16px; width: 60px; height: 60px; }
  .rz-ai { right: 0; bottom: 0; width: 100vw; height: 100dvh; border-radius: 0; border: 0; }
  .rz-ai-tip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .rz-ai-launch::after { animation: none; }
}
