/*!
 * Chat Relay v7.2.0
 * (c) 2026 Edgely. All rights reserved.
 * License: Proprietary / Commercial
 */

/* Chat Relay Frontend CSS */
#chat-relay-widget-container { box-sizing: border-box; }
#chat-relay-widget-container * { box-sizing: border-box; }

/* Variables are injected via PHP inline style with prefix --chat-relay- */

/* TRIGGER */
.chat-relay-trigger { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; background: var(--chat-relay-brand); border-radius: 50%; cursor: pointer; z-index: 99999; box-shadow: 0 5px 20px rgba(0,0,0,0.15); transition: transform 0.2s ease; display: flex; align-items: center; justify-content: center; padding: 0; border: none; }
.chat-relay-trigger:hover { transform: scale(1.05); }
.chat-relay-trigger .icon-msg, .chat-relay-trigger .icon-close { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); }
.chat-relay-trigger svg { display: block; }
.chat-relay-trigger .icon-close { opacity: 0; transform: translate(-50%, -50%) rotate(-90deg) scale(0.5); }
.chat-relay-trigger .icon-msg { opacity: 1; transform: translate(-50%, -50%) rotate(0) scale(1); }
.chat-relay-trigger.is-open .icon-msg { opacity: 0; transform: translate(-50%, -50%) rotate(90deg) scale(0.5); }
.chat-relay-trigger.is-open .icon-close { opacity: 1; transform: translate(-50%, -50%) rotate(0) scale(1); }

/* WINDOW */
.chat-relay-window { position: fixed; bottom: 110px; right: 30px; width: 380px; height: 500px; background: var(--chat-relay-bg); border-radius: 20px; box-shadow: 0 12px 40px rgba(0,0,0,0.15); display: none; flex-direction: column; z-index: 100000; font-family: var(--chat-relay-font); border: 1px solid var(--chat-relay-border); overflow: hidden; opacity: 0; transform: translateY(20px); transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); }
.chat-relay-window.show { opacity: 1; transform: translateY(0); }

/* HEADER */
.chat-relay-header { padding: 24px 28px 10px 28px; background: var(--chat-relay-bg); display: flex; justify-content: space-between; align-items: center; }
.chat-relay-brand { font-size: 18px; font-weight: 700; color: var(--chat-relay-text); letter-spacing: -0.5px; }
.chat-relay-close { background: transparent; border: none; cursor: pointer; padding: 6px; display: flex; border-radius: 50%; color: var(--chat-relay-text); transition: background 0.2s; }
.chat-relay-close:hover { background: var(--chat-relay-hover); }

/* BODY */
.chat-relay-body { flex: 1; padding: 20px 28px; background: var(--chat-relay-bg); overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.chat-relay-row { display: flex; gap: 12px; align-items: flex-start; animation: fadePop 0.3s ease; }
.chat-relay-avatar { width: 24px; height: 24px; margin-top: 5px; display: flex; align-items: center; justify-content: center; color: var(--chat-relay-avatar); flex-shrink: 0; }
.chat-relay-bubble { background: var(--chat-relay-bubble); padding: 16px 20px; border-radius: 18px; font-size: 15px; line-height: 1.5; color: var(--chat-relay-text); max-width: 85%; }

/* FOOTER */
.chat-relay-footer { padding: 20px 28px 24px 28px; background: var(--chat-relay-bg); position: relative; }
.chat-relay-input-wrapper { position: relative; width: 100%; display: flex; align-items: center; }
#chat-relay-input-field { width: 100%; padding: 16px 50px 16px 20px; border: 1px solid var(--chat-relay-border); background: var(--chat-relay-input); color: var(--chat-relay-text); border-radius: 50px; outline: none; font-size: 15px; font-family: inherit; transition: border 0.2s, box-shadow 0.2s; }
#chat-relay-input-field:focus { border-color: var(--chat-relay-brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--chat-relay-brand), transparent 85%); }

.chat-relay-send-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; background: var(--chat-relay-brand); border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background-color 0.2s ease; }
.chat-relay-send-btn:hover { opacity: 0.85; }
.chat-relay-send-btn:active { opacity: 0.7; }

.chat-relay-legal { font-size: 11px; color: var(--chat-relay-sub); text-align: center; margin-top: 12px; opacity: 0.7; }
.chat-relay-legal a { color: var(--chat-relay-text); text-decoration: underline; }

.chat-relay-typing { display: none; margin-left: 40px; padding: 12px 16px; background: var(--chat-relay-bubble); border-radius: 18px; width: fit-content; }
.chat-relay-typing span { display: inline-block; width: 5px; height: 5px; background: #bbb; border-radius: 50%; margin-right: 4px; animation: dotTyping 1.4s infinite ease-in-out both; }
.chat-relay-typing span:nth-child(1) { animation-delay: -0.32s; } .chat-relay-typing span:nth-child(2) { animation-delay: -0.16s; }

.chat-relay-backdrop { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--chat-relay-backdrop); z-index: 99998; display: none; opacity: 0; transition: opacity 0.3s ease; }
.chat-relay-backdrop.show { opacity: 1; }

@media (max-width: 600px) { .chat-relay-window { bottom: 0; right: 0; left: 0; width: 100%; height: 85vh; border-radius: 24px 24px 0 0; border: none; box-shadow: 0 -5px 30px rgba(0,0,0,0.15); transform: translateY(100%); } .chat-relay-window.show { transform: translateY(0); } }

@keyframes fadePop { from{opacity:0; transform:translateY(5px);} to{opacity:1; transform:translateY(0);} }
@keyframes dotTyping { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }