/*!
 * ZITLAS — Zino AI Companion (assets/css/zino.css)
 * Self-contained (zn- prefix). Covers: first-time spotlight tutorial,
 * the permanent floating button, and the companion chat window.
 * Injected/driven by assets/js/zino.js on every page that includes it.
 */

/* ══════════════════════════════════════════════
   TUTORIAL — spotlight overlay + guide card
══════════════════════════════════════════════ */
.zn-tut-overlay {
  position: fixed; inset: 0; z-index: 20000;
  background: rgba(15,15,20,0.72);
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.zn-tut-overlay.show { display: block; }
.zn-tut-overlay.open { opacity: 1; }

.zn-spotlight {
  position: fixed;
  z-index: 20001;
  border-radius: 16px;
  border: 3px solid #FF9900;
  box-shadow: 0 0 0 5px rgba(255,153,0,0.25), 0 0 34px rgba(255,153,0,0.45);
  pointer-events: none;
  transition: top 0.35s cubic-bezier(.4,0,.2,1), left 0.35s cubic-bezier(.4,0,.2,1),
              width 0.35s cubic-bezier(.4,0,.2,1), height 0.35s cubic-bezier(.4,0,.2,1),
              opacity 0.25s ease;
  opacity: 0;
  display: none;
}
.zn-spotlight.show { display: block; }
.zn-spotlight.open { opacity: 1; }

.zn-guide-card {
  position: fixed;
  z-index: 20002;
  left: 50%; transform: translateX(-50%) translateY(16px);
  width: 92%; max-width: 380px;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 22px;
  padding: 18px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease, top 0.35s ease, bottom 0.35s ease;
  display: none;
}
.zn-guide-card.show { display: block; }
.zn-guide-card.open { opacity: 1; transform: translateX(-50%) translateY(0); }
.zn-guide-card--bottom { bottom: 24px; }
.zn-guide-card--top    { top: 24px; }

.zn-guide-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.zn-guide-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid #FF9900; object-fit: cover; flex-shrink: 0; }
.zn-guide-name { font-size: 13px; font-weight: 800; color: #1E293B; }
.zn-guide-step-dot { margin-left: auto; font-size: 11px; font-weight: 700; color: #94A3B8; }
.zn-guide-title { font-size: 15.5px; font-weight: 800; color: #1E293B; margin: 0 0 6px; line-height: 1.35; }
.zn-guide-body  { font-size: 13.5px; color: #475569; line-height: 1.55; margin: 0 0 16px; white-space: pre-line; }

.zn-guide-actions { display: flex; align-items: center; gap: 8px; }
.zn-guide-skip {
  background: transparent; border: none; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: #94A3B8; padding: 10px 6px;
}
.zn-guide-spacer { flex: 1; }
.zn-guide-back {
  padding: 11px 16px; border-radius: 13px; cursor: pointer;
  background: rgba(30,41,59,0.06); border: none;
  font-size: 13px; font-weight: 700; color: #1E293B;
}
.zn-guide-next {
  padding: 11px 20px; border-radius: 13px; cursor: pointer; border: none;
  background: linear-gradient(135deg, #FFA940, #FF7A00);
  color: #fff; font-size: 13.5px; font-weight: 800;
  box-shadow: 0 8px 22px rgba(255,122,0,0.4);
}

/* ── Full-slide intro / finish cards (no spotlight, hero image) ── */
.zn-slide {
  position: fixed; inset: 0; z-index: 20003;
  display: none;
  align-items: flex-end; justify-content: center;
  background: linear-gradient(180deg, rgba(15,15,20,0.45), rgba(15,15,20,0.82) 55%);
}
.zn-slide.show { display: flex; }
.zn-slide-hero {
  position: absolute;
  bottom: 30%; left: 50%;
  transform: translateX(-50%) translateY(40px);
  width: 220px; max-width: 60vw;
  opacity: 0;
  transition: transform 0.5s cubic-bezier(.34,1.4,.64,1), opacity 0.5s ease;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.35));
}
.zn-slide.open .zn-slide-hero { transform: translateX(-50%) translateY(0); opacity: 1; }
.zn-slide-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px;
  background: rgba(255,255,255,0.97);
  border-radius: 26px 26px 0 0;
  padding: 26px 22px calc(22px + env(safe-area-inset-bottom, 0px));
  transform: translateY(30px);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(.34,1.2,.64,1) 0.1s, opacity 0.4s ease 0.1s;
}
.zn-slide.open .zn-slide-card { transform: translateY(0); opacity: 1; }
.zn-slide-bubble {
  background: rgba(255,153,0,0.08);
  border: 1.5px solid rgba(255,153,0,0.3);
  border-radius: 18px; padding: 16px 16px;
  font-size: 14px; color: #1E293B; line-height: 1.6;
  margin-bottom: 18px; white-space: pre-line;
}
.zn-slide-actions { display: flex; align-items: center; gap: 10px; }
.zn-slide-primary {
  flex: 1; padding: 14px; border-radius: 16px; cursor: pointer; border: none;
  background: linear-gradient(135deg, #FFA940, #FF7A00);
  color: #fff; font-size: 15px; font-weight: 800;
  box-shadow: 0 10px 26px rgba(255,122,0,0.4);
}
.zn-slide-skip {
  background: transparent; border: none; cursor: pointer;
  font-size: 13px; font-weight: 700; color: #94A3B8; padding: 12px 8px;
}
@media (min-width: 761px) {
  .zn-slide-hero { bottom: 34%; width: 260px; }
  .zn-slide-card { border-radius: 26px; margin-bottom: 6vh; }
}

/* ══════════════════════════════════════════════
   FLOATING BUTTON (permanent companion)
══════════════════════════════════════════════ */
.zn-fab {
  position: fixed;
  top: calc(78px + env(safe-area-inset-top, 0px));
  right: 16px;
  z-index: 9400;
  width: 52px; height: 52px;
  border-radius: 50%;
  border: 2.5px solid #FF9900;
  background: #fff;
  box-shadow: 0 8px 22px rgba(255,122,0,0.32);
  cursor: pointer;
  padding: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: visible;
}
.zn-fab img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.zn-fab::after {
  content: '';
  position: absolute; inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255,153,0,0.55);
  animation: znPulse 2.6s ease-out infinite;
}
@keyframes znPulse {
  0%   { transform: scale(0.9); opacity: 0.9; }
  70%  { transform: scale(1.35); opacity: 0; }
  100% { opacity: 0; }
}
.zn-fab-badge {
  position: absolute; top: -3px; right: -3px;
  width: 15px; height: 15px; border-radius: 50%;
  background: #E5484D; border: 2px solid #fff;
  display: none;
}
.zn-fab-badge.show { display: block; }

/* ══════════════════════════════════════════════
   CHAT WINDOW (floating card, NOT fullscreen)
══════════════════════════════════════════════ */
.zn-chat-backdrop {
  position: fixed; inset: 0; z-index: 10600;
  background: rgba(15,15,20,0.35);
  display: none; align-items: flex-end; justify-content: center;
  opacity: 0; transition: opacity 0.22s ease;
}
.zn-chat-backdrop.show { display: flex; }
.zn-chat-backdrop.open { opacity: 1; }

.zn-chat-card {
  width: 100%; max-width: 420px;
  height: min(78vh, 640px);
  background: rgba(250,248,244,0.97);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -20px 60px rgba(0,0,0,0.3);
  display: flex; flex-direction: column;
  transform: translateY(40px);
  transition: transform 0.28s cubic-bezier(.34,1.1,.64,1);
}
.zn-chat-backdrop.open .zn-chat-card { transform: translateY(0); }

.zn-chat-head {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 11px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(30,41,59,0.07);
}
.zn-chat-avatar { width: 38px; height: 38px; border-radius: 50%; border: 2px solid #FF9900; object-fit: cover; }
.zn-chat-title { font-size: 14.5px; font-weight: 800; color: #1E293B; }
.zn-chat-sub { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: #64748B; }
.zn-chat-dot { width: 6px; height: 6px; border-radius: 50%; background: #4CAF50; }
.zn-chat-close {
  margin-left: auto; width: 30px; height: 30px; border-radius: 50%;
  border: none; background: rgba(30,41,59,0.06); cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #475569;
}

.zn-chat-msgs { flex: 1; overflow-y: auto; padding: 14px 14px 8px; display: flex; flex-direction: column; gap: 8px; }
.zn-bubble {
  max-width: 82%; padding: 10px 13px; border-radius: 17px;
  font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word;
}
.zn-bubble--zino {
  align-self: flex-start;
  background: #fff; border: 1px solid rgba(30,41,59,0.07);
  color: #1E293B; border-bottom-left-radius: 5px;
}
.zn-bubble--user {
  align-self: flex-end;
  background: linear-gradient(135deg, #FFA940, #FF7A00);
  color: #fff; border-bottom-right-radius: 5px;
}
.zn-typing { align-self: flex-start; display: flex; gap: 4px; padding: 12px 15px; }
.zn-typing span { width: 6px; height: 6px; border-radius: 50%; background: #CBD5E1; animation: znDot 1.2s infinite ease-in-out; }
.zn-typing span:nth-child(2) { animation-delay: 0.15s; }
.zn-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes znDot { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-4px); opacity: 1; } }

.zn-chips-row {
  flex-shrink: 0;
  display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none;
  padding: 8px 14px; border-top: 1px solid rgba(30,41,59,0.06);
}
.zn-chips-row::-webkit-scrollbar { display: none; }
.zn-chip {
  flex-shrink: 0; padding: 8px 13px; border-radius: 999px;
  background: rgba(255,153,0,0.09); border: 1px solid rgba(255,153,0,0.28);
  font-size: 12px; font-weight: 700; color: #B35900; white-space: nowrap; cursor: pointer;
}

.zn-chat-input-bar {
  flex-shrink: 0; display: flex; align-items: flex-end; gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(30,41,59,0.06);
}
.zn-chat-input {
  flex: 1; background: rgba(30,41,59,0.04);
  border: 1px solid rgba(30,41,59,0.1); border-radius: 20px;
  padding: 10px 14px; font-size: 13.5px; font-family: inherit;
  color: #1E293B; resize: none; max-height: 90px; outline: none;
}
.zn-chat-send {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, #FFA940, #FF7A00);
  color: #fff; display: flex; align-items: center; justify-content: center;
}

/* ── Celebration toast ── */
.zn-celebrate {
  position: fixed; left: 50%; top: 90px; z-index: 12800;
  transform: translateX(-50%) translateY(-12px);
  background: linear-gradient(135deg, #FFA940, #FF7A00);
  color: #fff; font-size: 13.5px; font-weight: 700;
  padding: 13px 20px; border-radius: 16px;
  box-shadow: 0 14px 34px rgba(255,122,0,0.4);
  max-width: 88vw; text-align: center; line-height: 1.5;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.zn-celebrate.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (min-width: 761px) {
  .zn-chat-backdrop { align-items: center; }
  .zn-chat-card { border-radius: 26px; height: min(72vh, 620px); }
}
@media (prefers-reduced-motion: reduce) {
  .zn-tut-overlay, .zn-spotlight, .zn-guide-card, .zn-slide, .zn-slide-hero, .zn-slide-card,
  .zn-chat-backdrop, .zn-chat-card, .zn-celebrate, .zn-fab::after { transition: none; animation: none; }
}
