/**
 * WP AI Chatbot - Frontend widget styles.
 */

#wpaic-chat-root {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.wpaic-bubble {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--wpaic-primary, #0073aa);
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.wpaic-bubble:hover {
    transform: scale(1.08);
}

.wpaic-bubble svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.wpaic-window {
    width: 360px;
    max-width: calc(100vw - 40px);
    height: 520px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: wpaic-fade-in 0.2s ease;
}

@keyframes wpaic-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wpaic-header {
    background: var(--wpaic-primary, #0073aa);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
}

.wpaic-close {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    padding: 0 4px;
}

.wpaic-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f7f7f8;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.wpaic-msg-bot {
    background: #fff;
    color: #222;
    align-self: flex-start;
    border: 1px solid #e5e5e5;
    border-bottom-left-radius: 4px;
}

.wpaic-msg-user {
    background: var(--wpaic-primary, #0073aa);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.wpaic-msg-thinking {
    opacity: 0.7;
    font-style: italic;
}

.wpaic-input-area {
    border-top: 1px solid #e5e5e5;
    padding: 10px;
    display: flex;
    gap: 8px;
    background: #fff;
}

.wpaic-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 20px;
    font-size: 14px;
    outline: none;
    resize: none;
    font-family: inherit;
}

.wpaic-input:focus {
    border-color: var(--wpaic-primary, #0073aa);
}

.wpaic-send {
    background: var(--wpaic-primary, #0073aa);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.wpaic-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wpaic-send svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.wpaic-cursor {
    display: inline-block;
    animation: wpaic-blink 1s step-start infinite;
    margin-left: 1px;
    opacity: 0.7;
}

@keyframes wpaic-blink {
    50% { opacity: 0; }
}

@media (max-width: 480px) {
    .wpaic-window {
        position: fixed;
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}
