#aichat-widget * {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Floating button */
.aichat-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: #2563eb;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    box-shadow: 0 6px 24px rgba(37, 99, 235, 0.4);
    transition: transform .2s, background .2s;
}

.aichat-fab:hover {
    transform: scale(1.08);
}

.aichat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ef4444;
    border: 2px solid #fff;
    font-size: 10px;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

/* Modal */
.aichat-modal {
    position: fixed;
    bottom: 92px;
    right: 24px;
    z-index: 99998;
    width: 340px;
    height: 460px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    animation: aichatSlideUp .25s ease;
}

@keyframes aichatSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header */
.aichat-header {
    background: #0f172a;
    padding: 13px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.aichat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.aichat-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aichat-avatar .dashicons {
    color: white;
    font-size: 18px;
}

.aichat-title {
    color: white;
    font-weight: 600;
    font-size: 14px;
}

.aichat-status {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 2px;
}

.aichat-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    display: inline-block;
}

#aichat-status-text {
    color: rgba(255, 255, 255, 0.55);
    font-size: 11px;
}

.aichat-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    width: 28px;
    height: 28px;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Messages */
.aichat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #f8fafc;
}

.aichat-bubble {
    max-width: 84%;
    padding: 9px 13px;
    font-size: 13px;
    line-height: 1.55;
    border-radius: 12px;
}

.aichat-bot {
    align-self: flex-start;
    background: #fff;
    color: #1f2937;
    border-radius: 12px 12px 12px 3px;
    border: 1px solid #e5e7eb;
}

.aichat-user {
    align-self: flex-end;
    background: #2563eb;
    color: white;
    border-radius: 12px 12px 3px 12px;
}

/* Typing dots */
.aichat-typing {
    display: flex;
    gap: 4px;
    align-items: center;
}

.aichat-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #2563eb;
    animation: aichatBounce 1.2s ease-in-out infinite;
}

.aichat-typing span:nth-child(2) {
    animation-delay: .2s;
}

.aichat-typing span:nth-child(3) {
    animation-delay: .4s;
}

@keyframes aichatBounce {

    0%,
    60%,
    100% {
        transform: translateY(0);
        opacity: .4;
    }

    30% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

/* Suggestions */
.aichat-suggestions {
    padding: 7px 12px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    background: #f8fafc;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.aichat-suggestions button {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 4px 11px;
    font-size: 11px;
    color: #6b7280;
    cursor: pointer;
}

.aichat-suggestions button:hover {
    background: #f3f4f6;
}

/* Input row */
.aichat-input-row {
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.aichat-input-row input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 22px;
    padding: 9px 14px;
    font-size: 13px;
    outline: none;
    background: #f9fafb;
}

.aichat-input-row input:focus {
    border-color: #2563eb;
    background: #fff;
}

#aichat-send-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #2563eb;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.aichat-footer {
    text-align: center;
    padding: 6px;
    font-size: 10px;
    color: #9ca3af;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}
