/* AI Editor Styles */
#ai-editor-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    font-family: 'Inter', sans-serif;
}

#ai-editor-popup.active {
    display: block;
}

.ai-editor-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
}

.ai-editor-modal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 500px;
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

.ai-editor-header {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ai-editor-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
}

.ai-editor-title i {
    font-size: 20px;
}

.ai-editor-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.ai-editor-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.ai-editor-body {
    padding: 24px;
}

.ai-editor-element-info {
    background: #F3F4F6;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.element-tag {
    color: #6366F1;
    font-weight: 600;
}

.element-classes {
    color: #8B5CF6;
}

#ai-editor-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #E5E7EB;
    border-radius: 10px;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    resize: vertical;
    transition: all 0.2s;
    margin-bottom: 16px;
}

#ai-editor-input:focus {
    outline: none;
    border-color: #6366F1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.ai-editor-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.ai-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.ai-btn-secondary {
    background: #F3F4F6;
    color: #374151;
}

.ai-btn-secondary:hover {
    background: #E5E7EB;
}

.ai-btn-primary {
    background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
    color: white;
}

.ai-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.ai-editor-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #F0F9FF;
    border-radius: 8px;
    margin-top: 16px;
    color: #0369A1;
}

.ai-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #E0F2FE;
    border-top-color: #0369A1;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.ai-editor-result {
    margin-top: 16px;
}

.ai-success {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #F0FDF4;
    border-radius: 8px;
    color: #15803D;
    margin-bottom: 12px;
}

.ai-success i {
    font-size: 20px;
}

.ai-error {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: #FEF2F2;
    border-radius: 8px;
    color: #DC2626;
}

.ai-error i {
    font-size: 20px;
}

.ai-css-preview {
    background: #1F2937;
    color: #F9FAFB;
    padding: 16px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.ai-css-preview strong {
    display: block;
    margin-bottom: 8px;
    color: #60A5FA;
}

.ai-css-preview pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate(-50%, -40%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .ai-editor-modal {
        width: 95%;
        max-width: none;
    }

    .ai-editor-header {
        padding: 16px 20px;
    }

    .ai-editor-body {
        padding: 20px;
    }

    .ai-editor-title {
        font-size: 16px;
    }
}