/* Minimal chat styles with CSS variables for customization */
.amc-chat {
    /* Use theme presets as fallbacks where sensible */
    --amc-header-bg: var(--wp--preset--color--primary, #0d6186);
    --amc-header-color: var(--wp--preset--color--foreground, #ffffff);
    --amc-chat-bg: var(--wp--preset--color--background, #ffffff);
    --amc-user-bg: #e9f5ff;
    /* custom token; not exposed in Global Styles */
    --amc-bot-bg: var(--wp--preset--color--background, #f6f7f7);
    --amc-input-bg: #ffffff;
    --amc-input-color: #000000;
    --amc-chat-width: 640px;
    --amc-chat-height: 220px;
    color: #111;
    font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
    max-width: var(--amc-chat-width);
}

/* If block wrapper is alignwide or alignfull, let the chat expand to container width by default */
.wp-block-amc-ask-my-content.alignwide .amc-chat,
.wp-block-amc-ask-my-content.alignfull .amc-chat {
    max-width: 100%;
}

.amc-chat-window {
    border: 1px solid #ccd0d4;
    background: var(--amc-chat-bg);
    padding: 10px;
    height: var(--amc-chat-height);
    overflow: auto;
    border-radius: 4px;
}

.amc-chat-controls {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.amc-user-question {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid #8c8f94;
    border-radius: 4px;
    background: var(--amc-input-bg);
    color: var(--amc-input-color);
    font-size: 16px;
    line-height: 1.5;
    transition: border-color 0.2s ease;
}

.amc-user-question::placeholder {
    color: var(--amc-input-color);
    opacity: 0.6;
}

.amc-user-question:focus {
    outline: none;
    border-color: #2271b1;
    animation: amc-pulse-border 1.5s ease-in-out infinite;
}

@keyframes amc-pulse-border {

    0%,
    100% {
        border-color: #2271b1;
    }

    50% {
        border-color: #4f94d4;
    }
}

.amc-send-btn {
    padding: 6px 14px;
    background: #2271b1;
    color: #fff;
    border: 1px solid #1d5f91;
    border-radius: 4px;
    cursor: pointer;
}

.amc-send-btn:hover {
    background: #1d5f91;
}

.amc-send-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.amc-bubble {
    padding: 6px 8px;
    border-radius: 8px;
    margin: 6px 0;
    white-space: pre-wrap;
}

.amc-user {
    background: var(--amc-user-bg);
}

.amc-bot {
    background: var(--amc-bot-bg);
}

.amc-info {
    background: #fff3cd;
}

.amc-error {
    color: #b32d2e;
    margin-top: 6px;
}