/* RiffinAI Chat Widget */

:root {
    --riffin-primary: #FF7A18;
    /* Updated to user brand color */
    --riffin-bg: #1e1e1e;
    --riffin-text: #ffffff;
    --riffin-bubble-bg: #ffffff;
    --riffin-bubble-text: #000000;
    --riffin-user-bg: #FF7A18;
    /* User bubbles also use primary color */
}

/* 1. Floating Trigger Button */
#riffin-chat-trigger {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background-color: var(--riffin-primary);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

#riffin-chat-trigger:hover {
    transform: scale(1.1);
}

#riffin-chat-trigger svg {
    width: 30px;
    height: 30px;
    fill: white;
}

/* 2. Chat Window */
#riffin-chat-window {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 350px;
    height: 500px;
    background-color: var(--riffin-bg);
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

#riffin-chat-window.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Header */
.riffin-chat-header {
    padding: 15px;
    background-color: #252525;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.riffin-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.riffin-close-btn {
    background: none;
    border: none;
    color: #aaa;
    cursor: pointer;
    font-size: 20px;
}

.riffin-close-btn:hover {
    color: white;
}

/* Messages Area */
#riffin-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background-color: #121212;
}

.riffin-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.riffin-message.bot {
    background-color: #2c2c2c;
    color: #e0e0e0;
    align-self: flex-start;
    border-bottom-left-radius: 2px;
}

.riffin-message.user {
    background-color: var(--riffin-user-bg);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 2px;
}

/* Input Area */
.riffin-chat-input-area {
    padding: 10px;
    border-top: 1px solid #333;
    background-color: #252525;
    display: flex;
    gap: 10px;
}

#riffin-chat-input {
    flex: 1;
    padding: 10px;
    border-radius: 20px;
    border: 1px solid #444;
    background-color: #1e1e1e;
    color: white;
    outline: none;
}

#riffin-chat-input:focus {
    border-color: var(--riffin-primary);
}

#riffin-send-btn {
    background-color: var(--riffin-primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#riffin-send-btn:disabled {
    background-color: #555;
    cursor: not-allowed;
}

/* Loading Indicator */
.riffin-typing-indicator {
    font-style: italic;
    font-size: 12px;
    color: #888;
    margin-left: 5px;
    display: none;
}

.riffin-typing-indicator.active {
    display: block;
}

/* Mobile Responsiveness */
@media (max-width: 480px) {
    #riffin-chat-window {
        width: 90%;
        right: 5%;
        bottom: 80px;
        height: 60vh;
    }
}