/* Lya Chatbot — Widget */

#lya-bubble {
    position: fixed;
    bottom: 28px;
    right: 28px;
    width: 56px;
    height: 56px;
    background: #1a1a2e;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 99999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    user-select: none;
}

#lya-bubble:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(0,0,0,0.35);
}

#lya-bubble-icon {
    color: #c9b8ff;
    font-size: 22px;
    line-height: 1;
    transition: transform 0.3s ease;
}

#lya-bubble.open #lya-bubble-icon {
    transform: rotate(45deg);
}

/* Panel */

#lya-panel {
    position: fixed;
    bottom: 96px;
    right: 28px;
    width: 360px;
    max-height: 540px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 99998;
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease;
}

#lya-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Header */

#lya-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: #1a1a2e;
    color: #fff;
}

#lya-avatar {
    width: 36px;
    height: 36px;
    background: #c9b8ff22;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #c9b8ff;
    flex-shrink: 0;
}

#lya-header-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

#lya-header-info strong {
    font-size: 15px;
    font-weight: 600;
}

#lya-header-info span {
    font-size: 12px;
    opacity: 0.65;
}

#lya-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
    padding: 4px;
    line-height: 1;
    transition: opacity 0.15s;
}

#lya-close:hover {
    opacity: 1;
}

/* Messages */

#lya-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.lya-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

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

.lya-msg.lya-assistant {
    align-self: flex-start;
    background: #f3f0ff;
    color: #1a1a2e;
    border-bottom-left-radius: 4px;
}

.lya-msg.lya-typing {
    align-self: flex-start;
    background: #f3f0ff;
    color: #888;
    font-style: italic;
    font-size: 13px;
}

/* Input */

#lya-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

#lya-input {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 100px;
    overflow-y: auto;
    transition: border-color 0.15s;
    background: #fff;
}

#lya-input:focus {
    border-color: #9b7bff;
}

#lya-send {
    width: 38px;
    height: 38px;
    background: #1a1a2e;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: #fff;
    transition: background 0.15s, transform 0.15s;
}

#lya-send:hover {
    background: #2d2d5e;
    transform: scale(1.05);
}

#lya-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}


/* Responsive mobile */

@media (max-width: 480px) {
    #lya-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
    }

    #lya-bubble {
        bottom: 20px;
        right: 20px;
    }
}
