/**
 * ReWeave Assistant — assistant.css
 * Premium Organic Bot Styles
 */

#rw360-assistant-root {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: 'DM Sans', sans-serif;
}

/* Nudge Pop-up */
#rw360-assistant-nudge {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 220px;
    background: #1a2e1a; /* Forest */
    color: white;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.85rem;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    line-height: 1.4;
    transition: all 0.4s ease;
    animation: nudgeBounce 3s infinite ease-in-out;
    z-index: 9998;
}

#rw360-assistant-nudge.hidden {
    opacity: 0;
    transform: translateY(10px) scale(0.9);
    pointer-events: none;
}

#rw360-assistant-nudge::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 24px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #1a2e1a;
}

@keyframes nudgeBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* FAB Toggle Button */
#rw360-assistant-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #ffffff; /* White for PNG visibility */
    color: white;
    border: 2px solid #1a2e1a;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    animation: botGlow 2s infinite alternate;
}

@keyframes botGlow {
    0% { box-shadow: 0 0 5px rgba(168, 216, 168, 0.2); border-color: #1a2e1a; }
    100% { box-shadow: 0 0 20px rgba(168, 216, 168, 0.8); border-color: #a8d8a8; }
}

#rw360-assistant-toggle.active {
    animation: none; /* Stop pulsing when open */
    background: #a8d8a8; /* Sage */
    color: #1a2e1a;
    transform: rotate(90deg);
}

#rw360-assistant-toggle img {
    transition: transform 0.3s;
}

#rw360-assistant-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(26, 46, 26, 0.4);
}

#rw360-assistant-toggle.active {
    background: #a8d8a8; /* Sage */
    color: #1a2e1a;
    transform: rotate(90deg);
}

/* Chat Window */
#rw360-assistant-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    max-height: calc(100vh - 120px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 1;
    transform: translateY(0);
}

#rw360-assistant-window.hidden {
    opacity: 0;
    transform: translateY(30px);
    pointer-events: none;
}

/* Header */
.rw360-assistant-header {
    background: #1a2e1a;
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bot-avatar {
    width: 32px;
    height: 32px;
    background: #a8d8a8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.bot-name {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 1.1rem;
}

.bot-status {
    font-size: 0.75rem;
    opacity: 0.8;
}

#rw360-assistant-close {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.2s;
}

#rw360-assistant-close:hover {
    opacity: 1;
}

/* Messages Area */
#rw360-assistant-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 300px;
    background: #fdfcf8; /* Light linen */
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.5;
    position: relative;
    animation: slideUp 0.3s ease;
}

.bot-msg {
    background: #f2ede4;
    color: #1a2e1a;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.user-msg {
    background: #1a2e1a;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Action Tags */
#rw360-assistant-actions {
    background: #fdfcf8;
    padding: 0 20px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    transition: all 0.3s ease;
}

#rw360-assistant-actions.hidden-actions {
    display: none;
}

.assistant-tag {
    background: white;
    border: 1px solid #a8d8a8;
    color: #1a2e1a;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
}

.assistant-tag:hover {
    background: #a8d8a8;
    color: #1a2e1a;
}

/* Inline Action Tags (Follow-ups) */
.inline-actions-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 5px;
    margin-bottom: 10px;
    animation: slideUp 0.3s ease;
}

.inline-assistant-tag {
    background: transparent;
    border: 1px solid #1a2e1a;
    color: #1a2e1a;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: 0.2s;
}

.inline-assistant-tag:hover {
    background: #1a2e1a;
    color: white;
}

/* Footer & Input */
.rw360-assistant-footer {
    border-top: 1px solid #f2ede4;
}

.rw360-assistant-input-wrapper {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
}

#rw360-assistant-input {
    flex: 1;
    border: 1px solid #f2ede4;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

#rw360-assistant-input:focus {
    border-color: #a8d8a8;
}

#rw360-assistant-send {
    background: transparent;
    border: none;
    color: #1a2e1a;
    cursor: pointer;
    opacity: 0.5;
    transition: 0.2s;
}

#rw360-assistant-send:hover {
    opacity: 1;
    color: #1a2e1a;
}

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

/* Mobile Adjustments */
@media (max-width: 480px) {
    #rw360-assistant-window {
        width: calc(100vw - 40px);
        bottom: 70px;
        right: -10px;
    }
}
