/* AI Chat Panel Styles */

.ai-chat-panel {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 380px;
    height: 600px;
    background: #2d2d2d;
    border: 1px solid #3e3e3e;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ai-chat-panel.collapsed {
    height: 50px;
}

.ai-chat-panel.collapsed .ai-messages,
.ai-chat-panel.collapsed .ai-chat-input-area {
    display: none;
}

.ai-chat-header {
    background: linear-gradient(135deg, #04aa6d, #038a57);
    color: white;
    padding: 15px;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3e3e3e;
    cursor: pointer;
}

.ai-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.ai-close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ai-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ai-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-messages::-webkit-scrollbar-track {
    background: #2d2d2d;
}

.ai-messages::-webkit-scrollbar-thumb {
    background: #4e4e4e;
    border-radius: 3px;
}

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

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

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

.ai-message-content {
    max-width: 85%;
    padding: 10px 12px;
    border-radius: 6px;
    line-height: 1.4;
    font-size: 13px;
}

.ai-message-user .ai-message-content {
    background: #04aa6d;
    color: white;
}

.ai-message-assistant .ai-message-content {
    background: #3e3e3e;
    color: #d4d4d4;
}

.ai-message-content.ai-error {
    background: #c53030;
    color: white;
}

.ai-message-content em {
    font-style: italic;
}

.ai-message-content strong {
    font-weight: 600;
}

.ai-code-block {
    background: #1e1e1e;
    border: 1px solid #4e4e4e;
    border-radius: 4px;
    margin: 8px 0;
    overflow: hidden;
}

.ai-code-header {
    background: #2d2d2d;
    padding: 8px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #4e4e4e;
}

.ai-code-lang {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.ai-insert-code-btn {
    background: #04aa6d;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    transition: background 0.2s;
}

.ai-insert-code-btn:hover {
    background: #038a57;
}

.ai-code-block pre {
    margin: 0;
    padding: 10px;
    background: #1e1e1e;
    color: #d4d4d4;
    font-size: 11px;
    overflow-x: auto;
}

.ai-code-block code {
    font-family: 'Courier New', Courier, monospace;
}

.ai-chat-input-area {
    border-top: 1px solid #3e3e3e;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ai-input {
    background: #3e3e3e;
    color: #d4d4d4;
    border: 1px solid #4e4e4e;
    border-radius: 4px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 13px;
    resize: none;
    transition: border-color 0.2s;
}

.ai-input:focus {
    outline: none;
    border-color: #04aa6d;
    box-shadow: 0 0 0 2px rgba(4, 170, 109, 0.1);
}

.ai-send-btn {
    background: #04aa6d;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.2s;
}

.ai-send-btn:hover {
    background: #038a57;
}

.ai-send-btn:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .ai-chat-panel {
        width: calc(100vw - 20px);
        height: 400px;
        bottom: 10px;
        right: 10px;
        left: 10px;
    }

    .ai-message-content {
        max-width: 90%;
    }
}
