/* ═══════════════════════════════════════════════════════════
   YA-EVENT AI Chat Widget — Styles
   ═══════════════════════════════════════════════════════════ */

#ya-chat-widget {
  --chat-accent:#b8966c;
  --chat-bg:#faf9f7;
  --chat-ink:#1a1a1a;
  --chat-muted:#71717a;
  --chat-radius:14px;
  position:fixed; bottom:0; right:0; z-index:9999;
  font-family:'Inter','Manrope',Arial,sans-serif;
}

/* ── Toggle button ── */
#ya-chat-toggle {
  position:fixed; bottom:24px; right:24px;
  width:56px; height:56px; border-radius:50%;
  border:none; cursor:pointer;
  background:linear-gradient(135deg,#2a2825,#3a3733);
  color:#fafafa;
  box-shadow:0 4px 20px rgba(0,0,0,0.35), 0 0 0 3px rgba(184,150,108,0.2);
  display:flex; align-items:center; justify-content:center;
  transition:transform 0.2s, box-shadow 0.2s;
  z-index:10000;
}
#ya-chat-toggle:hover {
  transform:scale(1.08);
  box-shadow:0 6px 28px rgba(0,0,0,0.45), 0 0 0 4px rgba(184,150,108,0.35);
}
#ya-chat-toggle svg { width:24px; height:24px; }

.ya-chat-badge {
  position:absolute; top:0; right:0;
  width:12px; height:12px; border-radius:50%;
  background:#22c55e; border:2px solid #2a2825;
}

/* ── Panel ── */
#ya-chat-panel {
  position:fixed; bottom:24px; right:24px;
  width:380px; max-width:calc(100vw - 32px);
  height:520px; max-height:calc(100dvh - 48px);
  border-radius:var(--chat-radius);
  background:var(--chat-bg);
  box-shadow:
    0 4px 16px rgba(0,0,0,0.18),
    0 16px 56px rgba(0,0,0,0.35),
    inset 0 0 0 1px rgba(255,255,255,0.12);
  display:flex; flex-direction:column;
  overflow:hidden;
  transition:opacity 0.25s ease, transform 0.25s cubic-bezier(.4,0,.2,1);
  z-index:10001;
}
#ya-chat-panel.ya-chat-closed {
  opacity:0; pointer-events:none;
  transform:translateY(16px) scale(0.95);
}
#ya-chat-panel.ya-chat-open {
  opacity:1; pointer-events:auto;
  transform:translateY(0) scale(1);
}

/* ── Header ── */
.ya-chat-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:16px 18px 14px;
  background:linear-gradient(135deg,#2a2825,#3a3733);
  color:#fafafa;
  flex-shrink:0;
}
.ya-chat-header-info strong {
  display:block; font-size:15px; font-weight:700;
  font-family:'Cormorant Garamond',Georgia,serif;
  letter-spacing:-0.01em;
}
.ya-chat-header-info span {
  font-size:11px; color:rgba(255,255,255,0.5); font-weight:400;
}
.ya-chat-close {
  background:none; border:none; color:rgba(255,255,255,0.5);
  font-size:22px; cursor:pointer; padding:0 4px;
  line-height:1; transition:color 0.15s;
}
.ya-chat-close:hover { color:#fff; }

/* ── Messages area ── */
#ya-chat-messages {
  flex:1 1 0; overflow-y:auto; padding:16px 16px 8px;
  display:flex; flex-direction:column; gap:8px;
  scrollbar-width:thin; scrollbar-color:rgba(0,0,0,0.1) transparent;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.018'/%3E%3C/svg%3E"),
    linear-gradient(180deg,#faf9f7,#f7f5f2);
}
#ya-chat-messages::-webkit-scrollbar { width:4px; }
#ya-chat-messages::-webkit-scrollbar-thumb { background:rgba(0,0,0,0.1); border-radius:2px; }

.ya-chat-actions {
  display:flex; align-items:center; gap:10px;
  padding:10px 12px 0;
  background:#fff;
  flex-shrink:0;
}

#ya-chat-manager-btn {
  border:none;
  background:#2a2825;
  color:#fff;
  border-radius:999px;
  padding:8px 12px;
  font-size:12px;
  font-weight:600;
  cursor:pointer;
  transition:opacity 0.15s, transform 0.15s;
}

#ya-chat-manager-btn:hover {
  transform:translateY(-1px);
}

#ya-chat-manager-btn:disabled {
  opacity:0.55;
  cursor:default;
  transform:none;
}

#ya-chat-manager-status {
  font-size:12px;
  color:var(--chat-muted);
  line-height:1.35;
}

/* ── Message bubbles ── */
.ya-chat-msg {
  max-width:82%; padding:10px 14px;
  font-size:14px; line-height:1.55;
  border-radius:14px;
  word-break:break-word;
  animation:chatFadeIn 0.2s ease;
}
@keyframes chatFadeIn {
  from { opacity:0; transform:translateY(6px); }
  to { opacity:1; transform:translateY(0); }
}

.ya-chat-user {
  align-self:flex-end;
  background:linear-gradient(135deg,var(--chat-accent),#a07c5a);
  color:#fff;
  border-bottom-right-radius:4px;
}
.ya-chat-bot {
  align-self:flex-start;
  background:#fff;
  color:var(--chat-ink);
  border:1px solid rgba(0,0,0,0.06);
  border-bottom-left-radius:4px;
  box-shadow:0 1px 3px rgba(0,0,0,0.04);
}

.ya-chat-manager {
  align-self:flex-start;
  background:#f4ede2;
  color:#33291d;
  border:1px solid rgba(184,150,108,0.35);
  border-bottom-left-radius:4px;
  box-shadow:0 1px 3px rgba(0,0,0,0.04);
}

/* ── Typing indicator ── */
.ya-chat-typing {
  display:flex; align-items:center; gap:4px;
  padding:12px 18px;
}
.ya-chat-typing span {
  width:7px; height:7px; border-radius:50%;
  background:var(--chat-accent); opacity:0.4;
  animation:chatDot 1.2s infinite;
}
.ya-chat-typing span:nth-child(2) { animation-delay:0.15s; }
.ya-chat-typing span:nth-child(3) { animation-delay:0.3s; }
@keyframes chatDot {
  0%,60%,100% { opacity:0.3; transform:scale(0.85); }
  30% { opacity:1; transform:scale(1.1); }
}

/* ── Form ── */
#ya-chat-form {
  display:flex; gap:0; padding:10px 12px 12px;
  border-top:1px solid rgba(0,0,0,0.06);
  background:#fff;
  flex-shrink:0;
}
#ya-chat-input {
  flex:1; border:1px solid rgba(0,0,0,0.1);
  border-radius:10px 0 0 10px;
  padding:10px 14px; font-size:14px;
  font-family:inherit; outline:none;
  background:#faf9f7;
  transition:border-color 0.15s;
}
#ya-chat-input:focus { border-color:var(--chat-accent); }
#ya-chat-input::placeholder { color:rgba(0,0,0,0.3); }
#ya-chat-form button[type="submit"] {
  border:none; cursor:pointer;
  background:var(--chat-accent);
  color:#fff;
  padding:0 14px;
  border-radius:0 10px 10px 0;
  display:flex; align-items:center; justify-content:center;
  transition:background 0.15s;
}
#ya-chat-form button[type="submit"]:hover { background:#a07c5a; }

/* ── Mobile ── */
@media(max-width:480px){
  #ya-chat-panel {
    bottom:0; right:0; left:0;
    width:100%; max-width:100%;
    height:100dvh; max-height:100dvh;
    border-radius:0;
  }
  #ya-chat-toggle { bottom:16px; right:16px; width:50px; height:50px; }
}

/* ── Quick action buttons ── */
.ya-chat-quick {
  display:flex; flex-wrap:wrap; gap:6px;
  padding:4px 0 8px;
  animation:chatFadeIn 0.3s ease;
}
.ya-chat-quick-btn {
  padding:7px 14px;
  border:1.5px solid var(--chat-accent);
  border-radius:18px;
  background:transparent;
  color:var(--chat-accent);
  font-size:13px; font-weight:600;
  font-family:inherit;
  cursor:pointer;
  transition:background 0.15s, color 0.15s;
}
.ya-chat-quick-btn:hover {
  background:var(--chat-accent);
  color:#fff;
}
