/* AI Chat Widget */
#aiChatWidget {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 9999;
    font-family: inherit;
}

.ai-chat-fab {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(99,102,241,0.4);
    transition: transform 0.2s;
}

.ai-chat-fab:hover {
    transform: scale(1.1);
}

.ai-chat-panel {
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ai-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}

.ai-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.4rem;
    cursor: pointer;
    line-height: 1;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.ai-msg {
    max-width: 85%;
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-msg-bot {
    background: #f1f5f9;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-right-radius: 4px;
}

.ai-msg-user {
    background: #6366f1;
    color: white;
    align-self: flex-end;
    border-bottom-left-radius: 4px;
}

.ai-typing {
    opacity: 0.6;
    font-style: italic;
}

.ai-chat-input-row {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid #e2e8f0;
}

.ai-chat-input-row input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 0.85rem;
    outline: none;
}

.ai-chat-input-row input:focus {
    border-color: #6366f1;
}

.ai-chat-input-row button {
    padding: 0.5rem 1rem;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.ai-chat-input-row button:hover {
    background: #4f46e5;
}

@media (max-width: 480px) {
    .ai-chat-panel {
        width: calc(100vw - 2rem);
        height: 70vh;
    }
}
