/* InterioNotion Chat Widget — chat-widget.css */
/* Upload to: public_html/assets/chat-widget.css on Hostinger */

:root {
  --chat-primary: #25D366;
  --chat-primary-dark: #1da851;
  --chat-bg: #ffffff;
  --chat-header-bg: #128C7E;
  --chat-header-text: #ffffff;
  --chat-bot-bubble: #f0f0f0;
  --chat-bot-text: #1a1a1a;
  --chat-user-bubble: #DCF8C6;
  --chat-user-text: #1a1a1a;
  --chat-input-bg: #f7f7f7;
  --chat-shadow: 0 8px 32px rgba(0,0,0,0.18);
  --chat-radius: 16px;
  --chat-z: 99999;
}

/* ── Floating launcher button ── */
#interio-chat-launcher {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--chat-header-bg);
  box-shadow: var(--chat-shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: var(--chat-z);
  border: none;
  outline: none;
  transition: transform 0.2s, box-shadow 0.2s;
}
#interio-chat-launcher:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(0,0,0,0.24);
}
#interio-chat-launcher svg {
  width: 28px;
  height: 28px;
  fill: #fff;
  transition: transform 0.25s;
}
#interio-chat-launcher.open svg.icon-chat  { display: none; }
#interio-chat-launcher.open svg.icon-close { display: block !important; }
#interio-chat-launcher svg.icon-close      { display: none; }

/* Notification dot */
#interio-chat-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 12px;
  height: 12px;
  background: #ff4444;
  border-radius: 50%;
  border: 2px solid #fff;
  display: none;
}
#interio-chat-dot.visible { display: block; }

/* ── Chat window ── */
#interio-chat-window {
  position: fixed;
  bottom: 96px;
  right: 24px;
  width: 360px;
  max-width: calc(100vw - 32px);
  height: 520px;
  max-height: calc(100vh - 120px);
  background: var(--chat-bg);
  border-radius: var(--chat-radius);
  box-shadow: var(--chat-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: var(--chat-z);
  transform: scale(0.9) translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), opacity 0.2s;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
#interio-chat-window.visible {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}

/* Header */
#interio-chat-header {
  background: var(--chat-header-bg);
  color: var(--chat-header-text);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
#interio-chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
#interio-chat-title { flex: 1; min-width: 0; }
#interio-chat-title strong { display: block; font-size: 15px; font-weight: 600; }
#interio-chat-title span   { display: block; font-size: 12px; opacity: 0.85; }
#interio-chat-close {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.15s;
  font-size: 20px;
}
#interio-chat-close:hover { opacity: 1; }

/* Messages area */
#interio-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #ece5dd;
}
#interio-chat-messages::-webkit-scrollbar { width: 4px; }
#interio-chat-messages::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }

/* Message bubbles */
.interio-msg {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  animation: msgIn 0.2s ease-out;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.interio-msg.bot  { align-self: flex-start; }
.interio-msg.user { align-self: flex-end; }

.interio-msg-bubble {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}
.interio-msg.bot  .interio-msg-bubble { background: var(--chat-bot-bubble);  color: var(--chat-bot-text);  border-bottom-left-radius: 3px; }
.interio-msg.user .interio-msg-bubble { background: var(--chat-user-bubble); color: var(--chat-user-text); border-bottom-right-radius: 3px; }

.interio-msg-time {
  font-size: 11px;
  color: #888;
  margin-top: 3px;
  padding: 0 2px;
}
.interio-msg.user .interio-msg-time { text-align: right; }

/* Typing indicator */
#interio-typing {
  display: none;
  align-self: flex-start;
  padding: 8px 14px;
  background: var(--chat-bot-bubble);
  border-radius: 12px;
  border-bottom-left-radius: 3px;
  gap: 4px;
  align-items: center;
}
#interio-typing.visible { display: flex; }
#interio-typing span {
  width: 7px; height: 7px;
  background: #999;
  border-radius: 50%;
  animation: typingDot 1.2s infinite ease-in-out;
}
#interio-typing span:nth-child(2) { animation-delay: 0.2s; }
#interio-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingDot {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%           { transform: translateY(-5px); opacity: 1; }
}

/* Image preview bar */
#interio-img-preview {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #f0f7ff;
  border-top: 1px solid #d0e8ff;
  flex-shrink: 0;
  font-size: 12px;
  color: #555;
}
#interio-img-preview img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #cce0ff;
}
#interio-img-preview span {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#interio-preview-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #888;
  font-size: 16px;
  padding: 0 4px;
  line-height: 1;
}
#interio-preview-remove:hover { color: #333; }

/* Input area */
#interio-chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  padding: 10px 12px;
  background: var(--chat-bg);
  border-top: 1px solid #e8e8e8;
  flex-shrink: 0;
}
#interio-chat-input {
  flex: 1;
  border: 1px solid #ddd;
  border-radius: 22px;
  padding: 9px 14px;
  font-size: 14px;
  background: var(--chat-input-bg);
  outline: none;
  resize: none;
  max-height: 90px;
  line-height: 1.4;
  font-family: inherit;
  transition: border-color 0.2s;
}
#interio-chat-input:focus { border-color: var(--chat-header-bg); }
#interio-chat-input::placeholder { color: #aaa; }

#interio-chat-send {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--chat-header-bg);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
}
#interio-chat-send:hover  { background: #0a7a6f; }
#interio-chat-send:active { transform: scale(0.92); }
#interio-chat-send svg { width: 18px; height: 18px; fill: #fff; }
#interio-chat-send:disabled { background: #ccc; cursor: default; }

/* Attach button */
#interio-chat-attach {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border-radius: 50%;
  background: transparent;
  border: 1px solid #ddd;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
#interio-chat-attach:hover  { background: #f0f0f0; border-color: #bbb; }
#interio-chat-attach svg    { width: 16px; height: 16px; fill: #666; }

/* Image bubble in chat */
.interio-msg-img {
  max-width: 200px;
  max-height: 180px;
  border-radius: 10px;
  display: block;
  object-fit: cover;
  cursor: pointer;
}

/* Mobile */
@media (max-width: 420px) {
  #interio-chat-window { width: calc(100vw - 16px); right: 8px; bottom: 86px; }
  #interio-chat-launcher { right: 16px; bottom: 16px; }
}
