/* AI Chat Interface */
.ai-chat-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 400px;
    max-width: 90%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    z-index: 1050;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ai-chat-header {
    padding: 12px 15px;
    background: #4a6cf7;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.ai-chat-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 0 5px;
    opacity: 0.8;
}

.ai-chat-close:hover {
    opacity: 1;
}

.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.ai-message {
    margin-bottom: 15px;
    max-width: 85%;
    clear: both;
}

.ai-message-ai {
    float: left;
    text-align: left;
}

.ai-message-user {
    float: right;
    text-align: right;
}

.ai-message-content {
    padding: 10px 15px;
    border-radius: 18px;
    display: inline-block;
    word-wrap: break-word;
}

.ai-message-ai .ai-message-content {
    background: white;
    border-top-left-radius: 4px;
    color: #333;
}

.ai-message-user .ai-message-content {
    background: #4a6cf7;
    color: white;
}

.ai-chat-input-container {
    padding: 15px;
    background: white;
    border-top: 1px solid #e9ecef;
}

.ai-chat-input {
    width: 100%;
    margin-bottom: 10px;
    resize: none;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 10px 15px;
    font-size: 14px;
}

.ai-chat-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.ai-chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1040;
    padding: 10px 20px;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-chat-toggle i {
    font-size: 16px;
}

/* SVG Preview */
.ai-svg-preview {
    margin-top: 10px;
    text-align: center;
}

.ai-svg-preview .svg-container {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-bottom: 10px;
    max-height: 200px;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ai-svg-preview svg {
    max-width: 100%;
    max-height: 150px;
    display: block;
    margin: 0 auto;
}

.ai-apply-svg {
    margin-top: 8px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ai-apply-svg.highlight {
    animation: pulse 2s infinite;
    box-shadow: 0 0 0 0 rgba(74, 108, 247, 0.7);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 108, 247, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(74, 108, 247, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(74, 108, 247, 0);
    }
}

/* Loading state */
.ai-message-typing {
    display: inline-block;
    padding: 10px 15px;
    background: #f1f3f5;
    border-radius: 18px;
}

.ai-message-typing span {
    height: 8px;
    width: 8px;
    background: #6c757d;
    border-radius: 50%;
    display: inline-block;
    margin: 0 2px;
    opacity: 0.4;
}

.ai-message-typing span:nth-child(1) {
    animation: 1s blink infinite 0.3333s;
}

.ai-message-typing span:nth-child(2) {
    animation: 1s blink infinite 0.6666s;
}

.ai-message-typing span:nth-child(3) {
    animation: 1s blink infinite 0.9999s;
}

@keyframes blink {
    50% {
        opacity: 1;
    }
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .ai-chat-container {
        width: 90%;
        right: 5%;
        bottom: 70px;
    }
    
    .ai-message {
        max-width: 90%;
    }
}
