.ai-chat-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

.ai-chat-toggle {
    width: 50px;
    height: 50px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.ai-chat-toggle .ai-chat-icon {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.ai-chat-panel {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 420px;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
    transition: width 0.1s, max-height 0.1s;
}

.ai-chat-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    cursor: nw-resize;
    z-index: 10;
    background: linear-gradient(135deg, rgba(255,255,255,0.3) 40%, transparent 40%);
    border-top-left-radius: 12px;
}

.ai-chat-resize-handle:hover {
    background: linear-gradient(135deg, rgba(255,255,255,0.6) 40%, transparent 40%);
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    max-height: 400px;
    min-height: 150px;
}

.ai-chat-message {
    margin-bottom: 12px;
    display: flex;
}

.ai-chat-message--user {
    justify-content: flex-end;
}

.ai-chat-message--assistant {
    justify-content: flex-start;
}

.ai-chat-message--error {
    justify-content: center;
}

.ai-chat-bubble {
    max-width: 85%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.4;
    word-wrap: break-word;
}

.ai-chat-bubble--user {
    background-color: #2c7be5;
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-chat-bubble--assistant {
    background-color: #f1f3f5;
    color: #333;
    border-bottom-left-radius: 4px;
}

.ai-chat-bubble--error {
    background-color: #fde8e8;
    color: #e63757;
    font-size: 0.8rem;
}

.ai-chat-bubble--loading {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background-color: #f1f3f5;
}

.ai-chat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #999;
    animation: ai-chat-bounce 1.4s infinite ease-in-out both;
}

.ai-chat-dot:nth-child(1) { animation-delay: -0.32s; }
.ai-chat-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes ai-chat-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

.ai-chat-json {
    background-color: #1e1e2e;
    color: #cdd6f4;
    padding: 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    overflow-x: auto;
    margin: 6px 0;
}

.ai-chat-json code {
    color: #cdd6f4;
}

.ai-chat-apply-btn {
    font-size: 0.75rem;
}

.ai-chat-bubble code {
    background-color: rgba(0, 0, 0, 0.08);
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.8rem;
}

.ai-chat-panel .card-footer {
    border-top: 1px solid #e3ebf6;
}

.ai-chat-panel .card-footer textarea {
    resize: none;
    border-radius: 8px;
}

.ai-nav-link .btn {
    font-size: 0.8rem;
    border-radius: 20px;
    padding: 4px 12px;
    transition: transform 0.2s ease;
}

.ai-nav-link .btn:hover {
    transform: translateX(4px);
}
