/* =====================================================
   ReallyVisuals Support — Floating AI Chat Widget
   ===================================================== */

/* Floating "ask AI" bubble (bottom-right) hidden site-wide, per request.
   Kept in the DOM/JS so it can be re-enabled later by removing this rule. */
.rv-chat-fab, .rv-chat-panel { display: none !important; }

.rv-chat-fab {
    position: fixed;
    right: 28px;
    bottom: 28px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--rv-primary);
    color: #0A0A0C;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    box-shadow: 0 12px 36px rgba(255, 123, 29, 0.35);
    transition: transform var(--t-norm), box-shadow var(--t-norm);
}

.rv-chat-fab:hover {
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 16px 42px rgba(255, 123, 29, 0.5);
}

.rv-chat-fab svg { width: 26px; height: 26px; }

.rv-chat-fab .ping {
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--rv-primary);
    opacity: 0;
    animation: rvPing 2.4s ease-out infinite;
}

@keyframes rvPing {
    0%   { transform: scale(0.95); opacity: 0.6; }
    100% { transform: scale(1.4);  opacity: 0; }
}

.rv-chat-panel {
    position: fixed;
    right: 28px;
    bottom: 100px;
    width: 380px;
    max-height: 560px;
    background: var(--rv-bg-2);
    border: 1px solid var(--rv-border);
    border-radius: 24px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 123, 29, 0.05);
    display: flex;
    flex-direction: column;
    z-index: 201;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(16px) scale(0.96);
    transform-origin: bottom right;
    transition: opacity var(--t-norm), transform var(--t-norm);
}

.rv-chat-panel.open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
}

.rv-chat-head {
    padding: 18px 20px;
    border-bottom: 1px solid var(--rv-border);
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--rv-surface);
}

.rv-chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rv-primary), var(--rv-primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 123, 29, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    overflow: hidden;
}
.rv-chat-avatar img {
    width: 22px;
    height: auto;
    display: block;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.25));
}

.rv-chat-title {
    flex: 1;
    min-width: 0;
}
.rv-chat-title strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--rv-text);
}
.rv-chat-title small {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--rv-text-muted);
}
.rv-chat-title small::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rv-success);
    box-shadow: 0 0 6px var(--rv-success);
}

.rv-chat-close {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    border: none;
    background: transparent;
    color: var(--rv-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--t-fast), color var(--t-fast);
}
.rv-chat-close:hover {
    background: var(--rv-elevated);
    color: var(--rv-text);
}

.rv-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scrollbar-width: thin;
    scrollbar-color: var(--rv-border-2) transparent;
}
.rv-chat-body::-webkit-scrollbar { width: 6px; }
.rv-chat-body::-webkit-scrollbar-thumb {
    background: var(--rv-border-2);
    border-radius: 6px;
}

.rv-msg {
    max-width: 82%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.45;
    word-wrap: break-word;
    animation: rvMsgIn 0.3s ease;
}

@keyframes rvMsgIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.rv-msg.bot {
    background: var(--rv-elevated);
    color: var(--rv-text-2);
    border-bottom-left-radius: 6px;
    align-self: flex-start;
}

.rv-msg.user {
    background: var(--rv-primary);
    color: #0A0A0C;
    border-bottom-right-radius: 6px;
    align-self: flex-end;
    font-weight: 500;
}

.rv-msg.typing {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 14px 18px;
}
.rv-msg.typing span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rv-text-muted);
    animation: rvTyping 1.2s infinite ease-in-out;
}
.rv-msg.typing span:nth-child(2) { animation-delay: 0.15s; }
.rv-msg.typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes rvTyping {
    0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
    30%           { opacity: 1;   transform: translateY(-3px); }
}

.rv-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: -4px;
}
.rv-chat-suggestions button {
    background: transparent;
    border: 1px solid var(--rv-border);
    color: var(--rv-text-muted);
    font-size: 12px;
    padding: 6px 12px;
    border-radius: var(--r-pill);
    transition: all var(--t-fast);
    font-family: inherit;
}
.rv-chat-suggestions button:hover {
    border-color: var(--rv-primary);
    color: var(--rv-primary);
}

.rv-chat-input-wrap {
    padding: 14px 16px 16px;
    border-top: 1px solid var(--rv-border);
    background: var(--rv-surface);
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.rv-chat-input {
    flex: 1;
    background: var(--rv-bg);
    border: 1px solid var(--rv-border);
    border-radius: 14px;
    padding: 10px 14px;
    color: var(--rv-text);
    font-family: 'Onest', sans-serif;
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 100px;
    line-height: 1.4;
    transition: border-color var(--t-fast);
}
.rv-chat-input:focus { border-color: var(--rv-primary); }
.rv-chat-input::placeholder { color: var(--rv-text-disabled); }

.rv-chat-send {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    border: none;
    background: var(--rv-primary);
    color: #0A0A0C;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--t-fast), transform var(--t-fast);
}
.rv-chat-send:hover { background: var(--rv-primary-dark); transform: translateY(-1px); }
.rv-chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

@media (max-width: 560px) {
    .rv-chat-panel {
        right: 12px;
        left: 12px;
        bottom: 88px;
        width: auto;
        max-height: 70vh;
    }
    .rv-chat-fab {
        right: 16px;
        bottom: 16px;
        width: 54px;
        height: 54px;
    }
}
