/**
 * WP Shop Agent - Chat Widget Styles
 *
 * @package WP_Shop_Agent
 * @version 1.0.0
 */

/* Chat Widget Container */
.wp-shop-agent-chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1d2327;
}

/* Toggle Button */
.wp-shop-agent-chat-toggle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2271b1;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    position: absolute;
    bottom: 0;
    right: 0;
}

.wp-shop-agent-chat-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.wp-shop-agent-chat-toggle svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

/* Chat Window */
.wp-shop-agent-chat-window {
    display: none;
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 380px;
    max-height: 520px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    flex-direction: column;
}

.wp-shop-agent-chat-widget.open .wp-shop-agent-chat-window {
    display: flex;
}

/* Chat Header */
.wp-shop-agent-chat-header {
    background: #2271b1;
    color: #fff;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.wp-shop-agent-chat-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.wp-shop-agent-chat-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.wp-shop-agent-chat-close:hover {
    opacity: 1;
}

/* Chat Messages */
.wp-shop-agent-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    max-height: 360px;
    min-height: 200px;
}

.wp-shop-agent-message {
    margin-bottom: 12px;
    max-width: 85%;
}

.wp-shop-agent-message.user {
    margin-left: auto;
}

.wp-shop-agent-message p {
    margin: 0;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.wp-shop-agent-message.user p {
    background: #2271b1;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.wp-shop-agent-message.agent p {
    background: #f0f0f1;
    color: #1d2327;
    border-bottom-left-radius: 4px;
}

.wp-shop-agent-message.agent.typing p {
    color: #646970;
    font-style: italic;
}

.wp-shop-agent-message.agent.error p {
    background: #fcf0f1;
    color: #d63638;
}

/* Chat Input */
.wp-shop-agent-chat-form {
    display: flex;
    border-top: 1px solid #e0e0e0;
    padding: 0;
}

.wp-shop-agent-chat-input {
    flex: 1;
    border: none;
    padding: 14px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    resize: none;
    height: 48px;
    background: transparent;
}

.wp-shop-agent-chat-input::placeholder {
    color: #a7aaad;
}

.wp-shop-agent-chat-send {
    background: #2271b1;
    color: #fff;
    border: none;
    padding: 0 16px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s;
}

.wp-shop-agent-chat-send:hover {
    background: #135e96;
}

/* Responsive */
@media screen and (max-width: 480px) {
    .wp-shop-agent-chat-window {
        width: calc(100vw - 20px);
        right: -10px;
        bottom: 60px;
        max-height: 70vh;
    }
}
